Files
asterisk/contrib/scripts/valgrind_compare
Richard Mudgett 3609b8c19b 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@350127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 18:40:33 +00:00

22 lines
525 B
Bash
Executable File

#!/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]\+$/ <snipped>/' \
-e 's/^ Address 0x[0-9a-f]\+/ Address 0x<snipped>/' \
}
diff -u -L "$log1" <(pipe_log "$log1") -L "$log2" <(pipe_log "$log2")