diff options
author | Ken Raeburn <raeburn@mit.edu> | 2009-01-27 23:14:35 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2009-01-27 23:14:35 +0000 |
commit | fb96845a0ef8a47e6f35d7cd6aaadf20473dc3f5 (patch) | |
tree | e84b01ae85600821cb4f67d5b2d977e73d88987b | |
parent | 9457bdd0b72bc7154496eb32be9587acc210668c (diff) | |
download | krb5-fb96845a0ef8a47e6f35d7cd6aaadf20473dc3f5.tar.gz krb5-fb96845a0ef8a47e6f35d7cd6aaadf20473dc3f5.tar.xz krb5-fb96845a0ef8a47e6f35d7cd6aaadf20473dc3f5.zip |
Helper script for processing valgrind logs that don't indicate any errors, or are for system programs
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21810 dc483132-0cff-0310-8789-dd5450dbe970
-rwxr-xr-x | src/util/trim-valgrind-logs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/util/trim-valgrind-logs b/src/util/trim-valgrind-logs new file mode 100755 index 0000000000..af6839d918 --- /dev/null +++ b/src/util/trim-valgrind-logs @@ -0,0 +1,71 @@ +#!/bin/sh + +files=vg.* + +logname() { +# sed -n -e 7p $1 | awk '{print $2}' +# head -7 $1 | tail -1 | awk '{print $2}' + awk '{ if (NR == 9) { print $2; exit 0; } }' $1 +} + +show_names() { + if test "$*" = "$files" ; then + return + fi + for f in $* ; do + echo $f : `logname $f` + done +} + +discard_list="/bin/ps /bin/sh /bin/stty /usr/bin/cmp awk cat chmod cmp cp env expr find grep kill mv rev rlogin rm sed sh sleep sort tail test touch wc whoami xargs" +discard_list="$discard_list tcsh tokens" +#discard_list="$discard_list ./rtest ./dbtest" +# The t_inetd program's logs seem to always wind up incomplete for some +# reason. It's also not terribly important. +discard_list="$discard_list /path/to/.../t_inetd" + +filter() { + if test "$*" = "$files" ; then + return + fi + for f in $* ; do + n=`logname $f` + for d in $discard_list; do + if test "$n" = "$d"; then + echo rm $f : $n + rm $f + break + fi + done + done +} + +kill_error_free_logs() { + if test "$*" = "$files" ; then + return + fi + grep -l "ERROR SUMMARY: 0 errors" $* | while read name ; do + echo rm $name : no errors in `logname $name` + rm $name + done +} + +kill_no_leak_logs() { + if test "$*" = "$files" ; then + return + fi + grep -l "ERROR SUMMARY: 0 errors" $* | \ + grep -l "definitely lost: 0 bytes" $* | \ + xargs grep -l "possibly lost: 0 bytes" | \ + xargs grep -l "still reachable: 0 bytes in 0 blocks" | \ + while read name ; do + echo rm $name : no leaks or errors in `logname $name` + rm $name + done +} + +filter $files +kill_error_free_logs $files +#kill_no_leak_logs $files +echo Remaining files: +show_names $files |