From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung.kim@lge.com>,
Namhyung Kim <namhyung@kernel.org>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 2/3] ftracetest: Clear trace buffer after running kprobe testcases
Date: Thu, 6 Nov 2014 11:04:29 +0900 [thread overview]
Message-ID: <1415239470-28705-2-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1415239470-28705-1-git-send-email-namhyung@kernel.org>
The kprobe testcases create, use and delete dynamic events during the
test but didn't clear the trace buffer so it'll leave the result after
it finishes.
# ./ftracetest
...
# cat trace
# tracer: nop
#
# entries-in-buffer/entries-written: 2/2 #P:12
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
ftracetest-26474 [009] d..1 79417.143782: Unknown type 1099
ftracetest-26498 [009] d..1 79417.208034: Unknown type 1101
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc | 1 +
tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc | 1 +
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc | 1 +
tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc | 1 +
4 files changed, 4 insertions(+)
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
index 1b8b665ab2b3..a5a426211129 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc
@@ -9,3 +9,4 @@ echo p:myevent do_fork > kprobe_events
grep myevent kprobe_events
test -d events/kprobes/myevent
echo > kprobe_events
+clear_trace
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
index b55c84003587..d8c7bb6581fe 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
@@ -11,3 +11,4 @@ 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
+clear_trace
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
index a603d3f8db7b..c45ee2761354 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
@@ -12,5 +12,6 @@ echo 1 > events/kprobes/testprobe/enable
( echo "forked")
echo 0 > events/kprobes/testprobe/enable
echo "-:testprobe" >> kprobe_events
+clear_trace
test -d events/kprobes/testprobe && exit 1 || exit 0
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
index 283c29e7f7c4..31717985acc7 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
@@ -12,4 +12,5 @@ echo 1 > events/kprobes/testprobe2/enable
( echo "forked")
echo 0 > events/kprobes/testprobe2/enable
echo '-:testprobe2' >> kprobe_events
+clear_trace
test -d events/kprobes/testprobe2 && exit 1 || exit 0
--
2.1.2
next prev parent reply other threads:[~2014-11-06 2:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-06 2:04 [PATCH 1/3] ftracetest: Use logfile name supported by busybox's mktemp Namhyung Kim
2014-11-06 2:04 ` Namhyung Kim [this message]
2014-11-06 3:12 ` [PATCH 2/3] ftracetest: Clear trace buffer after running kprobe testcases Masami Hiramatsu
2014-11-06 2:04 ` [PATCH 3/3] ftracetest: Add basic event tracing test cases Namhyung Kim
2014-11-06 4:40 ` Masami Hiramatsu
2014-11-06 3:12 ` [PATCH 1/3] ftracetest: Use logfile name supported by busybox's mktemp Masami Hiramatsu
2014-11-06 13:41 ` Steven Rostedt
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=1415239470-28705-2-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=namhyung.kim@lge.com \
--cc=rostedt@goodmis.org \
/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