diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2014-09-22 19:42:54 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-09-23 09:32:27 -0400 |
commit | 2909ef28b1d385210d4fef551499debc914f30e4 (patch) | |
tree | 63f36b751009a4a1da765a96d289defca3160320 /tools/testing | |
parent | 03e166450fca3867a8e940d13d650f11aa03ee90 (diff) |
ftracetest: Add kprobe basic testcases
Add basic testcases for kprobe dynamic events.
This also shows that the ftracetest accepts sub-directory
for new testcases.
Link: http://lkml.kernel.org/p/20140922234254.23415.46964.stgit@kbuild-f20.novalocal
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc | 11 | ||||
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc b/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc new file mode 100644 index 000000000000..5ddfb476eceb --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/bin/sh | ||
2 | # description: Kprobe dynamic event - adding and removing | ||
3 | |||
4 | [ -f kprobe_events ] || exit 1 | ||
5 | |||
6 | echo 0 > events/enable || exit 1 | ||
7 | echo > kprobe_events || exit 1 | ||
8 | echo p:myevent do_fork > kprobe_events || exit 1 | ||
9 | grep myevent kprobe_events || exit 1 | ||
10 | [ -d events/kprobes/myevent ] || exit 1 | ||
11 | echo > kprobe_events | ||
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..588fde97e93f --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc | |||
@@ -0,0 +1,14 @@ | |||
1 | #!/bin/sh | ||
2 | # description: Kprobe dynamic event - busy event check | ||
3 | |||
4 | [ -f kprobe_events ] || exit 1 | ||
5 | |||
6 | echo 0 > events/enable || exit 1 | ||
7 | echo > kprobe_events || exit 1 | ||
8 | echo p:myevent do_fork > kprobe_events || exit 1 | ||
9 | [ -d events/kprobes/myevent ] || exit 1 | ||
10 | echo 1 > events/kprobes/myevent/enable || exit 1 | ||
11 | echo > kprobe_events && exit 1 # this must fail | ||
12 | echo 0 > events/kprobes/myevent/enable || exit 1 | ||
13 | echo > kprobe_events # this must succeed | ||
14 | |||