3 # Ensure that strace -k works.
5 . "${srcdir=.}/init.sh"
7 # strace -k is implemented using /proc/$pid/maps
8 [ -f /proc/self/maps ] ||
9 framework_skip_ '/proc/self/maps is not available'
15 fail_ 'stack-fcall failed'
17 $STRACE -h | grep '^-k' > /dev/null ||
18 skip_ 'strace -k is not available'
20 args="-e getpid -k ./stack-fcall"
21 $STRACE $args > $LOG 2>&1 || {
23 fail_ "$STRACE $args failed"
26 expected='getpid f3 f2 f1 f0 main '
27 result=$(sed -n '1,/(main+0x[a-f0-9]\+) .*/ s/^.*(\([^+]\+\)+0x[a-f0-9]\+) .*/\1/p' $LOG |
30 test "$result" = "$expected" || {
32 echo "expected: \"$expected\""
33 echo "result: \"$result\""
34 fail_ "unexpected output from $STRACE $args"