1 #! /bin/sh 2 3 dir=`dirname $0` 4 5 $dir/../../tests/filter_stderr_basic | 6 7 # Anonymise addresses 8 $dir/../../tests/filter_addresses | 9 10 # Remove "Helgrind, ..." line and the following copyright line; 11 # also the standard postamble (does such a word exist?) 12 sed \ 13 -e "/^Helgrind, a thread error detector/ , /./ d" \ 14 -e "/^For counts of detected and suppressed errors, rerun with: -v$/d" \ 15 -e "/^Use --history-level=approx or =none to gain increased speed, at$/d" \ 16 -e "/^the cost of reduced accuracy of conflicting-access information$/d" | 17 18 # Anonymise line numbers in hg_intercepts.c 19 sed "s/hg_intercepts.c:[0-9]*/hg_intercepts.c:.../g" | 20 21 # Change (eg) "/lib64/libpthread-2.5.so" into "/...libpthread..." 22 sed \ 23 -e "s/(in \/.*libpthread.*)$/(in \/...libpthread...)/" \ 24 -e "s/(within \/.*libpthread.*)$/(within \/...libpthread...)/" | 25 26 # Tidy up in cases where glibc (+ libdl + libpthread + ld) have 27 # been built with debugging information, hence source locs are present 28 sed \ 29 -e "s/(createthread.c:[0-9]*)/(in \/...libpthread...)/g" \ 30 -e "s/(clone.S:[0-9]*)/(in \/...libc...)/g" \ 31 -e "s/start_thread (pthread_create.c:[0-9]*)$/start_thread (in \/...libpthread...)/g" | 32 33 # Merge sem_wait and sem_wait@*, as either could be used. Likewise for 34 # sem_post. 35 sed \ 36 -e "s/sem_wait@\*/sem_wait/" \ 37 -e "s/sem_post@\*/sem_post/" | 38 39 # get rid of the numbers in bits of text "Thread #n", "thread #n", 40 # "Thread n" and "thread n", 41 # as these make some tests more scheduling sensitive -- those where 42 # there are multiple threads which play interchangeable roles. 43 sed \ 44 -e "s/hread #[0-9][0-9]*/hread #x/g" \ 45 -e "s/hread [0-9][0-9]*/hread x/g" | 46 47 # Likewise for frame numbers, which depend on compilation. 48 sed -e "s/frame #[0-9][0-9]*/frame #x/g" | \ 49 50 # "Thread #x was created" stack traces are unreliable once you get above 51 # "pthread_create@* (hg_intercepts.c:...)" -- they can contan 52 # "pthread_create@GLIBC_", "do_clone", "clone", etc. So we cut all the 53 # "at"/"by" lines above "pthread_create@*". We also convert 54 # "pthread_create" into "pthread_create@*". 55 perl -p -0 -e 's/(Thread #. was created\n)( (at|by)[^\n]*\n)*( by 0x........: pthread_create)(@\*)?( \(hg_intercepts.c:...\)\n)/$1 ...\n$4@*$6/gs' | 56 57 # Anything below "mythread_wrapper" in stack traces is unreliable, 58 # containing libc and libpthread stuff like start_thread, clone, etc. So we 59 # remove all the "by" lines below "mythread_wrapper". 60 perl -p -0 -e 's/( by 0x........: mythread_wrapper \(hg_intercepts.c:...\)\n)( by[^\n]*\n)*/$1 ...\n/gs' | 61 62 # Entire trace in a "Exiting thread still holds <N> lock(s)" is unreliable, 63 # containing libc stuff like _Exit(), exit(), etc. So we remove all the 64 # "at"/"by" lines below the message. 65 perl -p -0 -e 's/(Thread #.: Exiting thread still holds [0-9]+ locks?\n)( (at|by)[^\n]*\n)*/$1 ...\n/gs' 66 67