Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/ftrace: Make uprobe test more robust against binary name

Make add_remove_uprobe test case more robust against various real
binary name.
Current add_remove_uprobe.tc test expects the real binary of /bin/sh
is '*/bin/*sh', but it does not work on busybox environment.
Instead of using fixed pattern, use readlink to identify real binary
name.

Link: https://lore.kernel.org/r/173625187633.1383744.2840679071525852811.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masami Hiramatsu (Google) and committed by
Shuah Khan
89ae6438 159ca65c

+3 -1
+3 -1
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
··· 6 6 echo 0 > events/enable 7 7 echo > dynamic_events 8 8 9 + REALBIN=`readlink -f /bin/sh` 10 + 9 11 echo 'cat /proc/$$/maps' | /bin/sh | \ 10 - grep "r-xp .*/bin/.*sh$" | \ 12 + grep "r-xp .*${REALBIN}$" | \ 11 13 awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events 12 14 13 15 grep -q myevent uprobe_events