From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: 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>
Subject: [RFC][PATCH 0/2 v2] tracing: Add conditional to tracepoints
Date: Thu, 02 Dec 2010 23:03:58 -0500 [thread overview]
Message-ID: <20101203040358.955427199@goodmis.org> (raw)
This is an RFC that adds the TP_CONDITION() to the TRACE_EVENT()
code.
There are certain cases that a tracepoint only makes sense if
a specific condition is met. But because we do not want to dirty
the fast path (the non tracing case) with if statements that are
there only to avoid tracing, we just pass the condition variables
to the tracepoint, and let the user filter them out if needed.
A perfect example is the tracepoint sched_wakeup. It traces all
calls to try_to_wake_up() even if it fails to wake up. But if we add:
if (success)
trace_sched_wakeup(p);
We have that "if (success)" tested for every time we call try_to_wake_up().
Even when tracing is not (or never will be) enabled.
This patch set adds a variant TRACE_EVENT_CONDITIONAL()
(and DEFINE_EVENT_CONDITIONAL()) that has a "cond" argument.
This argument is encapsulated with "TP_CONDITIONAL()" which turns into:
if (!cond)
return;
What's new with this version?
This version adds this if statement to __DO_TRACE(). As it is
in a static inline function, the return still applies.
Also, since the shortcut is made before the callbacks, the test
is at the call site. This means that you can have a DECLARE_EVENT_CLASS()
where one of its DEFINE_EVENTS() is normal and the other is a
DEFINE_EVENT_CONDITION().
The following patches are in:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
branch: rfc/trace-conditional-v2
Steven Rostedt (2):
tracing: Add TRACE_EVENT_CONDITIONAL()
tracing: Only trace sched_wakeup if it actually work something up
----
include/linux/tracepoint.h | 29 +++++++++++++++++++++++------
include/trace/define_trace.h | 15 +++++++++++++++
include/trace/events/sched.h | 16 ++++++++--------
3 files changed, 46 insertions(+), 14 deletions(-)
next reply other threads:[~2010-12-03 4:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 4:03 Steven Rostedt [this message]
2010-12-03 4:03 ` [RFC][PATCH 1/2 v2] tracing: Add TRACE_EVENT_CONDITIONAL() Steven Rostedt
2010-12-03 4:54 ` Mathieu Desnoyers
2010-12-03 14:09 ` Steven Rostedt
2010-12-03 15:27 ` Mathieu Desnoyers
2010-12-03 15:38 ` Steven Rostedt
2010-12-03 15:46 ` Mathieu Desnoyers
2010-12-03 4:04 ` [RFC][PATCH 2/2 v2] tracing: Only trace sched_wakeup if it actually work something up Steven Rostedt
2010-12-08 12:12 ` Peter Zijlstra
2010-12-08 14:06 ` Steven Rostedt
2010-12-08 14:16 ` Peter Zijlstra
2010-12-03 14:47 ` [RFC][PATCH 0/2 v2] tracing: Add conditional to tracepoints Frederic Weisbecker
2010-12-03 14:53 ` Steven Rostedt
2010-12-03 14:59 ` Frederic Weisbecker
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=20101203040358.955427199@goodmis.org \
--to=rostedt@goodmis.org \
--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=mingo@elte.hu \
--cc=peterz@infradead.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