OSDN Git Service

tracing/rcu: Add trace_##name##__rcuidle() static tracepoint for inside rcu_idle_exit...
authorSteven Rostedt <srostedt@redhat.com>
Tue, 7 Feb 2012 14:32:43 +0000 (09:32 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 13 Feb 2012 13:23:21 +0000 (08:23 -0500)
commit2fbb90db1b8fcc78f43830f1a009f3af243c5f42
treea190e127ab6bd352d95a4a0964f0f1e8858cb2f4
parentf069686e4bdc60a637d210ea3eea25fcdb82df88
tracing/rcu: Add trace_##name##__rcuidle() static tracepoint for inside rcu_idle_exit() sections

Added is a new static inline function that lets *any* tracepoint be used
inside a rcu_idle_exit() section. And this also solves the problem where
the same tracepoint may be used inside a rcu_idle_exit() section as well
as outside of one.

I added a new tracepoint function with a "_rcuidle" extension. All
tracepoints can be used with either the normal "trace_foobar()"
function, or the "trace_foobar_rcuidle()" function when inside a
rcu_idle_exit() section.

All tracepoints defined by TRACE_EVENT() or any of the derivatives
will have a "_rcuidle()" function also defined. When a tracepoint is
used within an rcu_idle_exit() section, the "_rcuidle()" version must
be used. This denotes that the tracepoint is within rcu_idle_exit()
and it allows the rcu read locks within the tracepoint to still
be valid, as this version takes us out of rcu_idle_exit().

Another nice aspect about this patch is that "static inline"s are not
compiled into text when not used. So only the tracepoints that actually
use the _rcuidle() version will have them defined in the actual text
that is booted.

Link: http://lkml.kernel.org/r/1328563113.2200.39.camel@gandalf.stny.rr.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/linux/tracepoint.h