summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2018-08-30 23:20:28 +0900
committerShuah Khan (Samsung OSG) <shuah@kernel.org>2018-10-24 14:49:35 -0600
commit32f6e5da83c7f06db7e4efbdacdbc59c16fd6ecb (patch)
treea1293aefb5b767161b1fa5682f0e686e3d7ecd1b /tools
parentb0898e84851c96248c376897c96f3fde3ff7e3b5 (diff)
downloadlinux-32f6e5da83c7f06db7e4efbdacdbc59c16fd6ecb.tar.gz
linux-32f6e5da83c7f06db7e4efbdacdbc59c16fd6ecb.tar.bz2
linux-32f6e5da83c7f06db7e4efbdacdbc59c16fd6ecb.zip
selftests/ftrace: Add kprobe profile testcase
Add a testcase for testing kprobe_profile interface which provides per-kprobe event hit/misshit counts. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/profile.tc15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/profile.tc b/tools/testing/selftests/ftrace/test.d/kprobe/profile.tc
new file mode 100644
index 000000000000..0384b525cdee
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/profile.tc
@@ -0,0 +1,15 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: Kprobe dynamic event - adding and removing
+
+[ -f kprobe_events ] || exit_unsupported # this is configurable
+
+! grep -q 'myevent' kprobe_profile
+echo p:myevent _do_fork > kprobe_events
+grep -q 'myevent[[:space:]]*0[[:space:]]*0$' kprobe_profile
+echo 1 > events/kprobes/myevent/enable
+( echo "forked" )
+grep -q 'myevent[[:space:]]*[[:digit:]]*[[:space:]]*0$' kprobe_profile
+echo 0 > events/kprobes/myevent/enable
+echo > kprobe_events
+! grep -q 'myevent' kprobe_profile