mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-29 07:24:55 +00:00
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
This commit is contained in:
@@ -99,6 +99,10 @@
|
|||||||
# is run.
|
# is run.
|
||||||
#LIVE_AST_BRISTUFFED_LIBPRI=yes
|
#LIVE_AST_BRISTUFFED_LIBPRI=yes
|
||||||
#
|
#
|
||||||
|
# LIVE_AST_VALGRIND_ARGS
|
||||||
|
# Extra parameters to be passed to valgrind in the 'valgrind' subcommand.
|
||||||
|
#LIVE_AST_VALGRIND_ARGS="-v --leak-check=full --suppressions=$PWD/contrib/valgrind.supp"
|
||||||
|
#
|
||||||
# LIVE_AST_FOR_SYSTEM
|
# LIVE_AST_FOR_SYSTEM
|
||||||
# When generating asterisk.conf, use most components from the installed
|
# When generating asterisk.conf, use most components from the installed
|
||||||
# system. Also provide a sane var-run directory for those of us who want
|
# system. Also provide a sane var-run directory for those of us who want
|
||||||
@@ -235,6 +239,10 @@ run)
|
|||||||
set_ld_env
|
set_ld_env
|
||||||
$AST_BIN -C $AST_CONF "$@"
|
$AST_BIN -C $AST_CONF "$@"
|
||||||
;;
|
;;
|
||||||
|
valgrind)
|
||||||
|
set_ld_env
|
||||||
|
valgrind $LIVE_AST_VALGRIND_ARGS --log-fd=9 -- $AST_BIN -C $AST_CONF "$@" 9>$PWD/live/valgrind.txt
|
||||||
|
;;
|
||||||
rsync)
|
rsync)
|
||||||
remote_host="$1"
|
remote_host="$1"
|
||||||
remote_dir="$2"
|
remote_dir="$2"
|
||||||
@@ -261,6 +269,7 @@ gdb)
|
|||||||
echo "$0 install make install"
|
echo "$0 install make install"
|
||||||
echo "$0 samples make samples"
|
echo "$0 samples make samples"
|
||||||
echo "$0 run [params] asterisk [params]"
|
echo "$0 run [params] asterisk [params]"
|
||||||
|
echo "$0 valgrind [params] valgrind -- asterisk [params]"
|
||||||
echo "$0 gdb gdb asterisk"
|
echo "$0 gdb gdb asterisk"
|
||||||
echo "$0 rsync [user@]host dir copy files over to [user@]host:dir"
|
echo "$0 rsync [user@]host dir copy files over to [user@]host:dir"
|
||||||
echo "$0 gen-live-asterisk regenerate the wrapper ./live/asterisk"
|
echo "$0 gen-live-asterisk regenerate the wrapper ./live/asterisk"
|
||||||
|
|||||||
21
contrib/scripts/valgrind_compare
Executable file
21
contrib/scripts/valgrind_compare
Executable file
@@ -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]\+$/ <snipped>/' \
|
||||||
|
-e 's/^ Address 0x[0-9a-f]\+/ Address 0x<snipped>/' \
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
diff -u -L "$log1" <(pipe_log "$log1") -L "$log2" <(pipe_log "$log2")
|
||||||
Reference in New Issue
Block a user