#! /bin/sh

dir=`dirname $0`

$dir/../../tests/filter_stderr_basic    |

# Remove "Lackey, ..." line and the following copyright line.
sed "/^Lackey, an example Valgrind tool./ , /./ d" |

# Output looks like this...
#
# Counted 53 calls to _dl_runtime_resolve()
#  
#  Executed:
#    BBs:         47131
#    x86 instrs:  193330
#    UInstrs:     523996
#  
#  Jccs:
#    total:       36368
#    % taken:     58%
#  
#  Ratios:
#    x86 instrs : BB        =  41 : 10
#       UInstrs : BB        = 111 : 10
#       UInstrs : x86_instr =  27 : 10
#
#  Exit code:     0
#
# ...so chop all lines between first and last (inclusive)
sed "/^Counted [0-9]\+ calls to _dl_runtime_resolve()$/ ,   \
     /UInstrs : x86_instrs = [0-9]\+ : [0-9]\+/             \
     d"

