summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-12 07:33:37 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-12 07:33:37 -0400
commit90eac7eee2f4257644dcfb9d22348fded7c24afd (patch)
treeea472521485299a830095ea341f263cfb0425f1e /tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
parent6bbcb1d3a2e0a31593e3b7d9bfd112fa7f447141 (diff)
parent89c5497d1f933af56dac617f0fd86150942a7fb6 (diff)
Merge tag 'ftracetest-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull ftrace test code from Steven Rostedt: "This patch series starts a new selftests section in the tools/testing/selftest directory called "ftrace" that holds tests aimed at testing ftrace and subsystems that use ftrace (like kprobes). So far only a few tests were written (by Masami Hiramatsu), but more will be added in the near future (3.19)" * tag 'ftracetest-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobes: Add selftest scripts testing kprobe-tracer as startup test ftracetest: Add POSIX.3 standard and XFAIL result codes ftracetest: Add kprobe basic testcases ftracetest: Add ftrace basic testcases ftracetest: Initial commit for ftracetest
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc')
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
new file mode 100644
index 000000000000..b55c84003587
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
@@ -0,0 +1,13 @@
+#!/bin/sh
+# description: Kprobe dynamic event - busy event check
+
+[ -f kprobe_events ] || exit_unsupported
+
+echo 0 > events/enable
+echo > kprobe_events
+echo p:myevent do_fork > kprobe_events
+test -d events/kprobes/myevent
+echo 1 > events/kprobes/myevent/enable
+echo > kprobe_events && exit 1 # this must fail
+echo 0 > events/kprobes/myevent/enable
+echo > kprobe_events # this must succeed