From: Jason Baron <jbaron@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
mathieu.desnoyers@polymtl.ca, hpa@zytor.com, tglx@linutronix.de,
andi@firstfloor.org, roland@redhat.com, rth@redhat.com,
mhiramat@redhat.com, fweisbec@gmail.com
Subject: Re: [PATCH 4/5] jump label: tracepoint support
Date: Mon, 22 Mar 2010 16:44:20 -0400 [thread overview]
Message-ID: <20100322204420.GE2278@redhat.com> (raw)
In-Reply-To: <1269276214.2957.7.camel@gandalf.stny.rr.com>
On Mon, Mar 22, 2010 at 12:43:34PM -0400, Steven Rostedt wrote:
> On Mon, 2010-03-22 at 12:07 -0400, Jason Baron wrote:
> > Make use of the jump label infrastructure for tracepoints.
> >
> > Signed-off-by: Jason Baron <jbaron@redhat.com>
> > ---
> > include/linux/tracepoint.h | 34 +++++++++++++++++++---------------
> > kernel/tracepoint.c | 8 ++++++++
> > 2 files changed, 27 insertions(+), 15 deletions(-)
> >
> > diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
> > index f59604e..c18b9c0 100644
> > --- a/include/linux/tracepoint.h
> > +++ b/include/linux/tracepoint.h
> > @@ -16,6 +16,7 @@
> >
> > #include <linux/types.h>
> > #include <linux/rcupdate.h>
> > +#include <linux/jump_label.h>
> >
> > struct module;
> > struct tracepoint;
> > @@ -63,20 +64,22 @@ struct tracepoint {
> > * not add unwanted padding between the beginning of the section and the
> > * structure. Force alignment to the same alignment as the section start.
> > */
> > -#define DECLARE_TRACE(name, proto, args) \
> > - extern struct tracepoint __tracepoint_##name; \
> > - static inline void trace_##name(proto) \
> > - { \
> > - if (unlikely(__tracepoint_##name.state)) \
> > - __DO_TRACE(&__tracepoint_##name, \
> > - TP_PROTO(proto), TP_ARGS(args)); \
> > - } \
> > - static inline int register_trace_##name(void (*probe)(proto)) \
> > - { \
> > - return tracepoint_probe_register(#name, (void *)probe); \
> > - } \
> > - static inline int unregister_trace_##name(void (*probe)(proto)) \
> > - { \
> > +#define DECLARE_TRACE(name, proto, args) \
> > + extern struct tracepoint __tracepoint_##name; \
> > + static inline void trace_##name(proto) \
> > + { \
> > + JUMP_LABEL(name, do_trace, __tracepoint_##name.state); \
> > + return; \
> > +do_trace: \
> > + __DO_TRACE(&__tracepoint_##name, \
> > + TP_PROTO(proto), TP_ARGS(args)); \
>
> Does this still work on all archs, and when jump labels are not
> supported?
yes. See the base patch. If the arch doesn't have jump label support we
do:
#define JUMP_LABEL(tag, label, cond) \
if (unlikely(cond)) \
goto label;
-Jason
next prev parent reply other threads:[~2010-03-22 20:45 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-22 16:07 [PATCH 0/5] jump label v5 Jason Baron
2010-03-22 16:07 ` [PATCH 1/5] jump label: notifier atomic call chain notrace Jason Baron
2010-03-22 17:55 ` Masami Hiramatsu
2010-03-22 16:07 ` [PATCH 2/5] jump label: base patch Jason Baron
2010-03-22 20:04 ` Steven Rostedt
2010-03-22 21:01 ` Avi Kivity
2010-03-26 21:30 ` Masami Hiramatsu
2010-03-22 16:07 ` [PATCH 3/5] jump label: x86 support Jason Baron
2010-03-22 16:40 ` Steven Rostedt
2010-03-22 20:40 ` Jason Baron
2010-03-22 16:07 ` [PATCH 4/5] jump label: tracepoint support Jason Baron
2010-03-22 16:43 ` Steven Rostedt
2010-03-22 20:44 ` Jason Baron [this message]
2010-03-22 16:07 ` [PATCH 5/5] jump label: add module support Jason Baron
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=20100322204420.GE2278@redhat.com \
--to=jbaron@redhat.com \
--cc=andi@firstfloor.org \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=roland@redhat.com \
--cc=rostedt@goodmis.org \
--cc=rth@redhat.com \
--cc=tglx@linutronix.de \
/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