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

RADERMACHER Ansgar 206501 Ansgar.RADERMACHER at cea.fr
Mon Sep 17 08:37:43 EDT 2012


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++ ?

Best regards

Ansgar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20120917/d0d2aa14/attachment.html>


More information about the lttng-dev mailing list