Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1647662
| From | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/7] selftests/ftrace: Reduce trace buffer checking overhead |
| Date | 2017-05-23 08:10 +0200 |
| Message-ID | <tKbb4-7G0-13@gated-at.bofh.it> (permalink) |
| References | <tKbb3-7G0-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Current event/toplevel-enable.tc checking the trace
buffer by dumping all events while recording events.
However, this makes system very busy.
To reduce this overhead comes from reading trace buffer
and recording trace buffer, use head instead of cat
and stop tracing while reading.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
.../ftrace/test.d/event/toplevel-enable.tc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
index 0bb5df3..15e2d3f 100644
--- a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
@@ -28,7 +28,9 @@ echo '*:*' > set_event
yield
-count=`cat trace | grep -v ^# | wc -l`
+echo 0 > tracing_on
+
+count=`head -n 128 trace | grep -v ^# | wc -l`
if [ $count -eq 0 ]; then
fail "none of events are recorded"
fi
@@ -36,10 +38,12 @@ fi
do_reset
echo 1 > events/enable
+echo 1 > tracing_on
yield
-count=`cat trace | grep -v ^# | wc -l`
+echo 0 > tracing_on
+count=`head -n 128 trace | grep -v ^# | wc -l`
if [ $count -eq 0 ]; then
fail "none of events are recorded"
fi
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] selftests/ftrace: Some improvements of ftracetest Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:10 +0200 [PATCH 5/7] selftests/ftrace: Add instance indication in test log Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:10 +0200 [PATCH 3/7] ftrace/kprobes: selftests: Check kretprobe maxactive is supported Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:10 +0200 [PATCH 4/7] selftests/ftrace: Reset ftrace filter on older kernel Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:10 +0200 [PATCH 2/7] selftests/ftrace: Reduce trace buffer checking overhead Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:10 +0200 [PATCH 1/7] selftests/ftrace: Skip full-glob-matching filter test on older kernel Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:10 +0200 [PATCH 7/7] selftests/ftrace: Return unsupported if it detects older kernel Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:20 +0200 [PATCH 6/7] selftests/ftrace: Use top-level available_filter_function Masami Hiramatsu <mhiramat@kernel.org> - 2017-05-23 08:20 +0200
csiph-web