Commit 98f8faea authored by Masami Hiramatsu (Google)'s avatar Masami Hiramatsu (Google) Committed by Shuah Khan

selftests/uprobes: Add a basic uprobe testcase

Add a basic uprobe testcase which checks whether add/remove/trace
operations works on /bin/sh.
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 2c082b62
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - add/remove/test uprobe events
# requires: uprobe_events
echo 0 > events/enable
echo > dynamic_events
echo 'cat /proc/$$/maps' | /bin/sh | \
grep "r-xp .*/bin/.*sh$" | \
awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events
grep -q myevent uprobe_events
test -d events/uprobes/myevent
echo 1 > events/uprobes/myevent/enable
echo 'ls' | /bin/sh > /dev/null
echo 0 > events/uprobes/myevent/enable
grep -q myevent trace
echo "-:myevent" >> uprobe_events
! grep -q myevent uprobe_events
echo > uprobe_events
clear_trace
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment