Bug 17831

Summary: kprobes_onthefly.exp fails on powerpc
Product: systemtap Reporter: Martin Cermak <mcermak>
Component: runtimeAssignee: Unassigned <systemtap>
Status: RESOLVED FIXED    
Severity: normal CC: dsmith
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Martin Cermak 2015-01-12 16:55:09 UTC
Running ./systemtap.onthefly/kprobes_onthefly.exp ...
FAIL: kprobes_onthefly - otf_finish_at_start_disabled (invalid output)
FAIL: kprobes_onthefly - otf_start_disabled_iter_1 (invalid output)
FAIL: kprobes_onthefly - otf_start_enabled_iter_1 (invalid output)
FAIL: kprobes_onthefly - otf_start_disabled_iter_2 (invalid output)
FAIL: kprobes_onthefly - otf_start_enabled_iter_2 (invalid output)
FAIL: kprobes_onthefly - otf_start_disabled_iter_3 (invalid output)
FAIL: kprobes_onthefly - otf_start_enabled_iter_3 (invalid output)
FAIL: kprobes_onthefly - otf_start_disabled_iter_4 (invalid output)
FAIL: kprobes_onthefly - otf_start_enabled_iter_4 (invalid output)
FAIL: kprobes_onthefly - otf_start_disabled_iter_5 (invalid output)
FAIL: kprobes_onthefly - otf_start_enabled_iter_5 (invalid output)
FAIL: kprobes_onthefly - otf_timer_100ms (invalid output)
FAIL: kprobes_onthefly - otf_timer_50ms (invalid output)
FAIL: kprobes_onthefly - otf_timer_10ms (invalid output)

More logs avail. at  https://sourceware.org/bugzilla/show_bug.cgi?id=17270#c9

Please, fix.
Comment 1 David Smith 2015-06-18 17:51:58 UTC
Fixed in commit d023209. This was a test case problem, not really a systemtap problem. Originally the test case probed 'vfs.read' and 'vfs.read.return', which maps to 'kernel.function("vfs_read")' and 'kernel.function("vfs_read").return'.

On 3.10.0-229.4.2.el7.x86_64, you'll see the following:

====
# stap -l 'kernel.function("vfs_read").*'
kernel.function("vfs_read@fs/read_write.c:373").call
kernel.function("vfs_read@fs/read_write.c:373").callee("add_rchar@include/linux/sched.h:2860")
kernel.function("vfs_read@fs/read_write.c:373").callee("do_sync_read@fs/read_write.c:353")
kernel.function("vfs_read@fs/read_write.c:373").callee("fsnotify_access@include/linux/fsnotify.h:194")
kernel.function("vfs_read@fs/read_write.c:373").callee("inc_syscr@include/linux/sched.h:2870")
kernel.function("vfs_read@fs/read_write.c:373").callee("rw_verify_area@fs/read_write.c:319")
kernel.function("vfs_read@fs/read_write.c:373").exported
kernel.function("vfs_read@fs/read_write.c:373").return
====

But on 3.10.0-229.el7.ppc64, you'll see the following:

====
# stap -l 'kernel.function("vfs_read").*'
kernel.function("vfs_read@fs/read_write.c:373").call
kernel.function("vfs_read@fs/read_write.c:373").callee("add_rchar@include/linux/sched.h:2858")
kernel.function("vfs_read@fs/read_write.c:373").callee("do_sync_read@fs/read_write.c:353")
kernel.function("vfs_read@fs/read_write.c:373").callee("inc_syscr@include/linux/sched.h:2868")
kernel.function("vfs_read@fs/read_write.c:373").exported
kernel.function("vfs_read@fs/read_write.c:373").inline
kernel.function("vfs_read@fs/read_write.c:373").return
====

That inlined version of vfs_read caused the systemtap output to be different (because of the extra probe).

So, to fix this I changed the test case script to probe 'kernel.function("vfs_read").call' and 'kernel.function("vfs_read").return'. These should hopefully produce the same output on all kernels.