From fdf0fd973b9dc4cd97db37fbe9d2e04a4fda87b6 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 9 Jan 2012 18:57:14 +0000 Subject: [PATCH] Multiple revisions 350127-350128 ........ r350127 | rmudgett | 2012-01-09 12:40:33 -0600 (Mon, 09 Jan 2012) | 12 lines Update contrib script live_ast to invoke Asterisk with valgrind and suppression file. * Added valgrind_compare script to compare two valgrind log files for differences. (issue ASTERISK-17339) Reported by: Tzafrir Cohen Patches: valgrind_compare (license #5035) script uploaded by Tzafrir Cohen live_ast_valgrind.diff (license #5035) patch uploaded by Tzafrir Cohen live_ast_valgrind_v2.diff (license #5185) patch uploaded by Paul Belanger ........ r350128 | rmudgett | 2012-01-09 12:54:56 -0600 (Mon, 09 Jan 2012) | 11 lines live_ast: valgrind: run asterisk under valgrind Adds a new sub-command, "valgrind" to live_ast. It runs asterisk under valgrind. The extra command-line parameters are passed to Asterisk as usual, and parameters to valgrind are passed through LIVE_AST_VALGRIND_ARGS in live.conf . Review: https://reviewboard.asterisk.org/r/1109/ Merged revisions 326636 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 350127-350128 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@350129 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- contrib/scripts/valgrind_compare | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 contrib/scripts/valgrind_compare diff --git a/contrib/scripts/valgrind_compare b/contrib/scripts/valgrind_compare new file mode 100755 index 0000000000..9f814d4548 --- /dev/null +++ b/contrib/scripts/valgrind_compare @@ -0,0 +1,21 @@ +#!/bin/bash + +# compare_valgrind: diff two valgrinf memory usage logs. Masks out PIDs, +# addresses and such that should normally be different. +# +# Usage: ./compare_valgrind file1.log file2.log | less +# +# (Requires /bin/bash due to usage of '<()' ) + +log1="$1" +log2="$2" + +pipe_log() { + sed \ + -e 's/^--[0-9]\+-- //' -e 's/^==[0-9]\+== //' "$1" \ + -e 's/ record [0-9]\+ of [0-9]\+$/ /' \ + -e 's/^ Address 0x[0-9a-f]\+/ Address 0x/' \ + +} + +diff -u -L "$log1" <(pipe_log "$log1") -L "$log2" <(pipe_log "$log2")