Messages in this thread | ![/](/images/icornerl.gif) | | Date | Wed, 23 Sep 2009 12:57:58 +0200 | Subject | Re: [patch] introduce TRACE_EVENT_ABI (was Re: TRACE_EVENT_ABI ?) | From | Frédéric Weisbecker <> |
| |
2009/9/23, Arjan van de Ven <arjan@infradead.org>: > From e2c647ae2d3ddc25b804f0419956caf40d89c606 Mon Sep 17 00:00:00 2001 > From: Steven Rostedt <rostedt@goodmis.org> > Date: Mon, 21 Sep 2009 20:14:53 +0200 > Subject: [PATCH] trace: introduce TRACE_EVENT_ABI > > Some trace events are suitable to form a stable userspace ABI; > this patch introduces infrastructure to mark them as such, > and marks the first few tracepoints this way > > Signed-off-by: Steven Rostedt <rostedt@goodmis.org> > Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> > --- > include/linux/tracepoint.h | 4 ++++ > include/trace/events/power.h | 6 +++--- > include/trace/events/sched.h | 4 ++-- > 3 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h > index 63a3f7a..4cb454f 100644 > --- a/include/linux/tracepoint.h > +++ b/include/linux/tracepoint.h > @@ -280,6 +280,10 @@ static inline void tracepoint_synchronize_unregister(void) > * TRACE_EVENT_FN to perform any (un)registration work. > */ > > +#define TRACE_EVENT_ABI(name, proto, args, tstruct, assign, print) \ > + TRACE_EVENT(name, PARAMS(proto), PARAMS(args), \ > + PARAMS(tstruct), PARAMS(assign), PARAMS(print)) > +
You may probably need to undefine it from trace/define_trace.h once every cpp magic have been done (ie: once trace/ftrace.h have been included.)
Because some files include several tracepoint/trace event headers, then linux/tracepoint.h gets included several times and eventually TRACE_EVENT_ABI() would be redefined (and then crash).
That's why we have:
#ifdef CONFIG_EVENT_TRACING #include <trace/ftrace.h> #endif
#undef TRACE_EVENT #undef TRACE_EVENT_FN #undef TRACE_HEADER_MULTI_READ
in define_trace.h: to allow such re-inclusion of tracepoint.h and avoid redefinitions of TRACE_EVENT and TRACE_EVENT_FN.
So you just need to add:
#undef TRACE_EVENT #undef TRACE_EVENT_FN +#undef TRACE_EVENT_ABI #undef TRACE_HEADER_MULTI_READ
The problem is visible if you build napi that has such multiple tracepoint headers included in a single C file.
Thanks.
| ![\](/images/icornerr.gif) |