njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | |
sewardj | 77b3802 | 2004-12-14 09:18:57 +0000 | [diff] [blame] | 3 | # This filter should be applied to *every* stderr result. It removes |
| 4 | # Valgrind startup stuff and pid numbers. |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 5 | |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 6 | dir=`dirname $0` |
| 7 | |
fitzhardinge | 39de4b4 | 2003-10-31 07:12:21 +0000 | [diff] [blame] | 8 | # Remove ==pid== and --pid-- and ++pid++ and **pid** strings |
sewardj | 2f3bcd2 | 2006-12-12 01:38:15 +0000 | [diff] [blame] | 9 | sed "s/\(==\|--\|\+\+\|\*\*\)[0-9]\{1,7\}\1 //" | |
sewardj | b683720 | 2006-10-17 01:48:41 +0000 | [diff] [blame] | 10 | |
| 11 | # Remove any --pid:0: strings (debuglog level zero output) |
sewardj | 2f3bcd2 | 2006-12-12 01:38:15 +0000 | [diff] [blame] | 12 | sed "/^--[0-9]\{1,7\}:0:*/d" | |
sewardj | b683720 | 2006-10-17 01:48:41 +0000 | [diff] [blame] | 13 | |
| 14 | # Remove "WARNING: assuming toc 0x.." strings |
| 15 | sed "/^WARNING: assuming toc 0x*/d" | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 16 | |
njn | b9c427c | 2004-12-01 14:14:42 +0000 | [diff] [blame] | 17 | # Remove "Using valgrind..." line and the following |
| 18 | # copyright notice line. Tools have to filter their own line themselves. |
| 19 | sed "/^Using valgrind-.*, a dynamic binary instrumentation framework/ , /./ d" | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 20 | |
sewardj | 77b3802 | 2004-12-14 09:18:57 +0000 | [diff] [blame] | 21 | # ... and also remove the "Using LibVEX..." line and the one after it. |
sewardj | 8b20c22 | 2004-12-20 05:44:49 +0000 | [diff] [blame] | 22 | sed "/^Using LibVEX rev .*, a library for dynamic binary translation/ , /./ d" | |
sewardj | 77b3802 | 2004-12-14 09:18:57 +0000 | [diff] [blame] | 23 | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 24 | # Remove other introductory lines |
mueller | 3547d0b | 2004-01-03 15:02:59 +0000 | [diff] [blame] | 25 | sed "/Estimated CPU clock rate is [0-9]* MHz/d" | |
sewardj | 77b3802 | 2004-12-14 09:18:57 +0000 | [diff] [blame] | 26 | sed "/For more details, rerun with: -v/d" | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 27 | |
sewardj | 45f4e7c | 2005-09-27 19:20:21 +0000 | [diff] [blame] | 28 | # Anonymise line numbers in vg_replace_malloc.c, remove dirname if present |
| 29 | sed "s/\(m_replacemalloc\/\)\?vg_replace_malloc.c:[0-9]*/vg_replace_malloc.c:.../" | |
njn | cb13052 | 2003-05-05 09:09:08 +0000 | [diff] [blame] | 30 | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 31 | # Hide suppressed error counts |
mueller | 3547d0b | 2004-01-03 15:02:59 +0000 | [diff] [blame] | 32 | sed "s/^\(ERROR SUMMARY[^(]*(suppressed: \)[0-9]*\( from \)[0-9]*)$/\10\20)/" | |
fitzhardinge | 98abfc7 | 2003-12-16 02:05:15 +0000 | [diff] [blame] | 33 | |
| 34 | |
daywalker | 5b88111 | 2003-04-24 01:01:01 +0000 | [diff] [blame] | 35 | # Reduce some libc incompatibility |
sewardj | b5f6f51 | 2005-03-10 23:59:00 +0000 | [diff] [blame] | 36 | $dir/filter_libc | |
thughes | dd468ff | 2004-02-29 13:00:18 +0000 | [diff] [blame] | 37 | |
| 38 | # Remove line info out of order warnings |
thughes | 18467b7 | 2004-03-16 11:03:09 +0000 | [diff] [blame] | 39 | sed "/warning: line info addresses out of order/d" | |
| 40 | |
bart | bce804c | 2008-03-22 07:52:44 +0000 | [diff] [blame] | 41 | # Older bash versions print abnormal termination messages on the stderr |
| 42 | # of the bash process. Newer bash versions redirect such messages properly. |
| 43 | # Suppress any redirected abnormal termination messages. You can find the |
| 44 | # complete list of messages in the bash source file siglist.c. |
njn | 9818bee | 2009-02-11 00:21:53 +0000 | [diff] [blame] | 45 | sed -r "/^(Segmentation fault|Alarm clock|Aborted|Bus error)( \(core dumped\))?$/d" | |
bart | bce804c | 2008-03-22 07:52:44 +0000 | [diff] [blame] | 46 | |
thughes | 18467b7 | 2004-03-16 11:03:09 +0000 | [diff] [blame] | 47 | # Remove any ": dumping core" message as the user might have a |
| 48 | # limit set that prevents the core dump |
| 49 | sed "s/\(signal [0-9]* (SIG[A-Z]*)\): dumping core/\1/" |