blob: 3300450d416ba11d3178c666d465ff55f0bd7cb8 [file] [log] [blame]
njn25e49d8e72002-09-23 09:36:25 +00001#! /bin/sh
2
sewardj77b38022004-12-14 09:18:57 +00003# This filter should be applied to *every* stderr result. It removes
4# Valgrind startup stuff and pid numbers.
njnf9c4b812009-05-18 05:29:41 +00005#
6# Nb: The GNU and BSD implementations of 'sed' are quite different, so
7# anything remotely complicated (e.g. "\(a\|b\)" alternatives) can't be
8# easily done. Use Perl instead for any such cases.
njn25e49d8e72002-09-23 09:36:25 +00009
sewardjb5f6f512005-03-10 23:59:00 +000010dir=`dirname $0`
11
njn18a71e82010-07-06 04:21:47 +000012# Remove ==pid== and --pid-- and **pid** strings
13perl -p -e 's/(==|--|\*\*)[0-9]{1,7}\1 //' |
sewardjb6837202006-10-17 01:48:41 +000014
15# Remove any --pid:0: strings (debuglog level zero output)
sewardj2f3bcd22006-12-12 01:38:15 +000016sed "/^--[0-9]\{1,7\}:0:*/d" |
sewardjb6837202006-10-17 01:48:41 +000017
njn53162bf2009-07-29 23:34:49 +000018# Remove "Command: line". (If wrapping occurs, it won't remove the
19# subsequent lines...)
20sed "/^Command: .*$/d" |
21
sewardjb6837202006-10-17 01:48:41 +000022# Remove "WARNING: assuming toc 0x.." strings
23sed "/^WARNING: assuming toc 0x*/d" |
njn25e49d8e72002-09-23 09:36:25 +000024
njnf73d87f2009-07-24 04:47:04 +000025# Remove "Using Valgrind-$VERSION and LibVEX..." line.
26# Tools have to filter their own line themselves.
27sed "/^Using Valgrind-.* and LibVEX; rerun with -h for copyright info/ d" |
sewardj77b38022004-12-14 09:18:57 +000028
sewardj45f4e7c2005-09-27 19:20:21 +000029# Anonymise line numbers in vg_replace_malloc.c, remove dirname if present
njnd55f0d92009-08-03 01:38:56 +000030perl -p -e "s/(m_replacemalloc\/)?vg_replace_malloc.c:\d+\)/vg_replace_malloc.c:...\)/" |
31
32# Likewise for valgrind.h
33perl -p -e "s/valgrind\.h:\d+\)/valgrind\.h:...\)/" |
njncb130522003-05-05 09:09:08 +000034
fitzhardinge98abfc72003-12-16 02:05:15 +000035# Hide suppressed error counts
mueller3547d0b2004-01-03 15:02:59 +000036sed "s/^\(ERROR SUMMARY[^(]*(suppressed: \)[0-9]*\( from \)[0-9]*)$/\10\20)/" |
fitzhardinge98abfc72003-12-16 02:05:15 +000037
daywalker5b881112003-04-24 01:01:01 +000038# Reduce some libc incompatibility
njnf9c4b812009-05-18 05:29:41 +000039$dir/filter_libc |
thughesdd468ff2004-02-29 13:00:18 +000040
41# Remove line info out of order warnings
njnf9c4b812009-05-18 05:29:41 +000042sed "/warning: line info addresses out of order/d" |
thughes18467b72004-03-16 11:03:09 +000043
bartbce804c2008-03-22 07:52:44 +000044# Older bash versions print abnormal termination messages on the stderr
45# of the bash process. Newer bash versions redirect such messages properly.
46# Suppress any redirected abnormal termination messages. You can find the
47# complete list of messages in the bash source file siglist.c.
njnf9c4b812009-05-18 05:29:41 +000048perl -n -e 'print if !/^(Segmentation fault|Alarm clock|Aborted|Bus error)( \(core dumped\))?$/' |
bartbce804c2008-03-22 07:52:44 +000049
thughes18467b72004-03-16 11:03:09 +000050# Remove any ": dumping core" message as the user might have a
51# limit set that prevents the core dump
njn5281fd12009-04-15 07:11:36 +000052sed "s/\(signal [0-9]* (SIG[A-Z]*)\): dumping core/\1/" |
53
54# Remove the size in "The main thread stack size..." message.
florian567e80e2011-10-20 20:37:46 +000055sed "s/The main thread stack size used in this run was [0-9]*/The main thread stack size used in this run was .../" |
njn5281fd12009-04-15 07:11:36 +000056
florian567e80e2011-10-20 20:37:46 +000057# Suppress warnings from incompatible debug info
58sed '/warning: the debug information found in "[^"]*" does not match/d' |
59
60# Suppress warnings from Dwarf reader
61sed '/warning: evaluate_Dwarf3_Expr: unhandled DW_OP_/d'