aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf
diff options
context:
space:
mode:
authorSteven Rostedt <[email protected]>2010-12-02 16:46:18 -0500
committerSteven Rostedt <[email protected]>2010-12-03 10:45:34 -0500
commit287050d390264402e11bea8b811859e42e8faa29 (patch)
treeb24814f1c985545f68ea9de87f7819b9230db0aa /tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf
parent042957801626465492b9428860de39a3cb2a8219 (diff)
tracing: Add TRACE_EVENT_CONDITIONAL()
There are instances in the kernel that we only want to trace a tracepoint when a certain condition is set. But we do not want to test for that condition in the core kernel. If we test for that condition before calling the tracepoin, then we will be performing that test even when tracing is not enabled. This is 99.99% of the time. We currently can just filter out on that condition, but that happens after we write to the trace buffer. We just wasted time writing to the ring buffer for an event we never cared about. This patch adds: TRACE_EVENT_CONDITION() and DEFINE_EVENT_CONDITION() These have a new TP_CONDITION() argument that comes right after the TP_ARGS(). This condition can use the parameters of TP_ARGS() in the TRACE_EVENT() to determine if the tracepoint should be traced or not. The TP_CONDITION() will be placed in a if (cond) trace; For example, for the tracepoint sched_wakeup, it is useless to trace a wakeup event where the caller never actually wakes anything up (where success == 0). So adding: TP_CONDITION(success), which uses the "success" parameter of the wakeup tracepoint will have it only trace when we have successfully woken up a task. Acked-by: Mathieu Desnoyers <[email protected]> Acked-by: Frederic Weisbecker <[email protected]> Cc: Arjan van de Ven <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
Diffstat (limited to 'tools/perf/scripts/perl/Perf-Trace-Util/lib/Perf')
0 files changed, 0 insertions, 0 deletions