Commit bdb5d0f9 authored by Chunyan Zhang's avatar Chunyan Zhang Committed by Steven Rostedt

tracing: Only benchmark the time tracepoints take if tracing is on

There's no need to record the time tracepoints take when tracing is off.
This is because:
1) We cannot see these records since ring_buffer record is off at that
moment.
2) If tracing is off and benchmark tracepoint is enabled, the time
tracepoint takes is fewer than the same situation when tracing is on,
since the tracepoints need to be wrote into ring_buffer, it would
take more time. If turn on tracing at this moment, the average and
standard deviation cannot exactly present the time that tracepoints
take to write data into ring_buffer.

Link: http://lkml.kernel.org/r/1445947933-27955-1-git-send-email-zhang.chunyan@linaro.orgSigned-off-by: default avatarChunyan Zhang <zhang.chunyan@linaro.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 46a2b61e
...@@ -43,7 +43,7 @@ static void trace_do_benchmark(void) ...@@ -43,7 +43,7 @@ static void trace_do_benchmark(void)
unsigned int std = 0; unsigned int std = 0;
/* Only run if the tracepoint is actually active */ /* Only run if the tracepoint is actually active */
if (!trace_benchmark_event_enabled()) if (!trace_benchmark_event_enabled() || !tracing_is_on())
return; return;
local_irq_disable(); local_irq_disable();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment