[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101208155703.173C.A69D9226@jp.fujitsu.com>
Date: Wed, 8 Dec 2010 15:56:24 +0900 (JST)
From: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: kosaki.motohiro@...fujitsu.com, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Theodore Tso <tytso@....edu>,
Arjan van de Ven <arjan@...radead.org>,
Mathieu Desnoyers <compudj@...stal.dyndns.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Subject: Re: [PATCH 3/4] tracing: Add TRACE_EVENT_CONDITIONAL()
> From: Steven Rostedt <srostedt@...hat.com>
>
> 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 <mathieu.desnoyers@...icios.com>
> Acked-by: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Arjan van de Ven <arjan@...radead.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Signed-off-by: Steven Rostedt <rostedt@...dmis.org>
I love this patch. thanks, Steven :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists