From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Shuah Khan <shuah.kh@samsung.com>,
Tom Zanussi <tom.zanussi@linux.intel.com>,
Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>,
Oleg Nesterov <oleg@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Namhyung Kim <namhyung@kernel.org>,
Ingo Molnar <mingo@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [RFC PATCH v2 3/4] ftracetest: Add kprobe basic testcases
Date: Tue, 26 Aug 2014 11:15:32 +0000 [thread overview]
Message-ID: <20140826111532.5711.54595.stgit@kbuild-fedora.novalocal> (raw)
In-Reply-To: <20140826111511.5711.28493.stgit@kbuild-fedora.novalocal>
Add basic testcases for kprobe dynamic events.
This also shows that the ftracetest accepts sub-directory
for new testcases.
Changes in v2:
- Change shell to sh instead of bash.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---
.../testing/ftrace/test.d/kprobe/add_and_remove.tc | 11 +++++++++++
tools/testing/ftrace/test.d/kprobe/busy_check.tc | 14 ++++++++++++++
2 files changed, 25 insertions(+)
create mode 100644 tools/testing/ftrace/test.d/kprobe/add_and_remove.tc
create mode 100644 tools/testing/ftrace/test.d/kprobe/busy_check.tc
diff --git a/tools/testing/ftrace/test.d/kprobe/add_and_remove.tc b/tools/testing/ftrace/test.d/kprobe/add_and_remove.tc
new file mode 100644
index 0000000..5ddfb47
--- /dev/null
+++ b/tools/testing/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/ftrace/test.d/kprobe/busy_check.tc b/tools/testing/ftrace/test.d/kprobe/busy_check.tc
new file mode 100644
index 0000000..588fde97
--- /dev/null
+++ b/tools/testing/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
+
next prev parent reply other threads:[~2014-08-26 11:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 11:15 [RFC PATCH v2 0/4] ftrace: Add a ftrace test collection Masami Hiramatsu
2014-08-26 11:15 ` [RFC PATCH v2 1/4] ftracetest: Initial commit for ftracetest Masami Hiramatsu
2014-08-27 15:54 ` Luis Henriques
2014-08-28 8:40 ` Masami Hiramatsu
2014-08-28 10:37 ` Luis Henriques
2014-08-26 11:15 ` [RFC PATCH v2 2/4] ftracetest: Add ftrace basic testcases Masami Hiramatsu
2014-08-26 11:15 ` Masami Hiramatsu [this message]
2014-08-26 11:15 ` [RFC PATCH v2 4/4] ftracetest: Add XFAIL/XPASS/UNSUPPORTED as result code Masami Hiramatsu
2014-08-29 1:05 ` Shuah Khan
2014-09-01 3:17 ` Masami Hiramatsu
2014-09-01 11:23 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140826111532.5711.54595.stgit@kbuild-fedora.novalocal \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=oleg@redhat.com \
--cc=rostedt@goodmis.org \
--cc=shuah.kh@samsung.com \
--cc=tom.zanussi@linux.intel.com \
--cc=yoshihiro.yunomae.ez@hitachi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).