[lttng-dev] Using tracepoint call inside a macro

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Fri May 15 12:03:51 EDT 2015


----- Original Message -----
> Hi all,
> 
> I wonder if it is possible to define a macro containing a tracepoint
> (which is also a macro) call.
> 
> As a very simple example, using :
> 
> #define TRACE(subsystem, tracepoint, params...) tracepoint(subsystem,
> tracepoint, params)
> 
> TRACE(provider, tp1, arg);
> 
> is not compiling (tracepoint macro seems not to be expanded), whereas
> direct call
> 
> tracepoint(provider, tp1, arg);
> 
> is compiling.
> 
> Any idea ?

Try renaming your TRACE() argument "tracepoint" to something else,
e.g. "_tracepoint", so it does not clash with the "tracepoint" macro
name.

Thanks,

Mathieu

> 
> BR
> Franck
> 
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list