From 2909ef28b1d385210d4fef551499debc914f30e4 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Mon, 22 Sep 2014 23:42:54 +0000 Subject: [PATCH] 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 Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt --- .../ftrace/test.d/kprobe/add_and_remove.tc | 11 +++++++++++ .../selftests/ftrace/test.d/kprobe/busy_check.tc | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc 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 @@ +#!/bin/sh +# description: Kprobe dynamic event - adding and removing + +[ -f kprobe_events ] || exit 1 + +echo 0 > events/enable || exit 1 +echo > kprobe_events || exit 1 +echo p:myevent do_fork > kprobe_events || exit 1 +grep myevent kprobe_events || exit 1 +[ -d events/kprobes/myevent ] || exit 1 +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 @@ +#!/bin/sh +# description: Kprobe dynamic event - busy event check + +[ -f kprobe_events ] || exit 1 + +echo 0 > events/enable || exit 1 +echo > kprobe_events || exit 1 +echo p:myevent do_fork > kprobe_events || exit 1 +[ -d events/kprobes/myevent ] || exit 1 +echo 1 > events/kprobes/myevent/enable || exit 1 +echo > kprobe_events && exit 1 # this must fail +echo 0 > events/kprobes/myevent/enable || exit 1 +echo > kprobe_events # this must succeed + -- 2.30.2