mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Theodore Tso <tytso@mit.edu>,
	Arjan van de Ven <arjan@infradead.org>,
	Mathieu Desnoyers <compudj@krystal.dyndns.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH 3/4] tracing: Add TRACE_EVENT_CONDITIONAL()
Date: Wed,  8 Dec 2010 15:56:24 +0900 (JST)	[thread overview]
Message-ID: <20101208155703.173C.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20101204023141.552849493@goodmis.org>

> From: Steven Rostedt <srostedt@redhat.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@efficios.com>
> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
> Cc: Arjan van de Ven <arjan@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

I love this patch. thanks, Steven :)




  reply	other threads:[~2010-12-08  6:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-04  2:17 [PATCH 0/4] [GIT PULL] tracing: Harry Potter and the Deathly Macros Steven Rostedt
2010-12-04  2:17 ` [PATCH 1/4] ftrace: Speed up recordmcount Steven Rostedt
2010-12-04  2:17 ` [PATCH 2/4] tracing/events: Show real number in array fields Steven Rostedt
2010-12-04  2:17 ` [PATCH 3/4] tracing: Add TRACE_EVENT_CONDITIONAL() Steven Rostedt
2010-12-08  6:56   ` KOSAKI Motohiro [this message]
2010-12-08 14:03     ` Steven Rostedt
2010-12-09  6:10       ` KOSAKI Motohiro
2010-12-04  2:17 ` [PATCH 4/4] tracing: Only trace sched_wakeup if it actually work something up Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101208155703.173C.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=compudj@krystal.dyndns.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome