提交 1d0864db 编写于 作者: M Masami Hiramatsu 提交者: Shuah Khan

selftests/ftrace: Reduce trace buffer checking overhead

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: NMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
上级 27af344b
...@@ -28,7 +28,9 @@ echo '*:*' > set_event ...@@ -28,7 +28,9 @@ echo '*:*' > set_event
yield 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 if [ $count -eq 0 ]; then
fail "none of events are recorded" fail "none of events are recorded"
fi fi
...@@ -36,10 +38,12 @@ fi ...@@ -36,10 +38,12 @@ fi
do_reset do_reset
echo 1 > events/enable echo 1 > events/enable
echo 1 > tracing_on
yield 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 if [ $count -eq 0 ]; then
fail "none of events are recorded" fail "none of events are recorded"
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册