[lttng-dev] Userspace tracing, TP declaration via C++

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Sep 17 09:01:47 EDT 2012


* RADERMACHER Ansgar 206501 (Ansgar.RADERMACHER at cea.fr) wrote:
> Hello,
> 
> I'd like to use LTTng in the context of C++ projects. Unless I missed something, the trace provider iitself is always a "c" file, in the examples called tp.c (I use the 2.0.5. of the LTTng tools, linux kernel 3.1.10 and gcc/g++ 4.6.2).
> 
> If I use a C++ file instead, e.g. by renaming the tp.c to tp.cpp, the compilation fails, since the two enumerations alloc and sync are defined within the scope of the lttng_ust_lib_ring_buffer_config structure and thus their literals are not found (there are additional problems, if I try to define these two enumerations on top level).
> 
> Using a c file instead of a C++ is a bit problemaitc, since I am currently integrating LTTng into the Papyrus code generation and I do not like mixing the C and C++ code generation (although possible).
> 
> Is there a know work-around or upcoming solution to declare a tracepoint and compile it with g++ ?

Not at this point. The probe needs to be compiled with gcc.

Please file a feature request on bugs.lttng.org.

Thanks,

Mathieu

> 
> Best regards
> 
> Ansgar
> 

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


-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list