Re: [RFC PATCH] ftrace trace event: introduce assignment macros

From: Mathieu Desnoyers
Date: Thu Dec 09 2010 - 15:00:50 EST


* Frederic Weisbecker (fweisbec@xxxxxxxxx) wrote:
> On Thu, Dec 09, 2010 at 11:22:11AM -0500, Mathieu Desnoyers wrote:
> > This patch proposes encapsulation of the raw assignments within TP_fast_assign()
> > by introducing tp_assign() and tp_memcpy() macros. This will allow us to:
> >
> > - generically filter from input fields,
> > - redefine the field write primitives.
> >
> > The current macros map directly to the old code. I changed the documentation in
> > tracepoint.txt to reflect these new primitives, but all TRACE_EVENT() users
> > should gradually update their code to use these macro wrappers rather than raw
> > "=" assignments or mempcy() calls.
> >
[...]
> > ---
> > include/linux/tracepoint.h | 12 ++++++------
> > include/trace/ftrace.h | 6 ++++++
> > 2 files changed, 12 insertions(+), 6 deletions(-)
> >
> > Index: linux-2.6-lttng.git/include/trace/ftrace.h
> > ===================================================================
> > --- linux-2.6-lttng.git.orig/include/trace/ftrace.h
> > +++ linux-2.6-lttng.git/include/trace/ftrace.h
> > @@ -1,4 +1,10 @@
> > /*
> > + * Macros mapping tp_assign() and tp_memcpy() to "=" and memcpy.
> > + */
> > +#define tp_assign(dest, src) __entry->dest = src
> > +#define tp_memcpy(dest, src, len) memcpy(__entry->dest, src, len)
>
> Looks good.

Great! Can I resend it without "RFC" with your Acked-by ?

If there is wide-spread agreement on this change, I might soon start rolling out
patches that migrate TRACE_EVENT users to these new primitives.

Thanks,

Mathieu

--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/