[lttng-dev] SystemTap integration and C++ tracepoints

Thibault, Daniel Daniel.Thibault at drdc-rddc.gc.ca
Wed Jun 5 17:36:25 EDT 2013


   Inspired by Jérémie's https://gist.github.com/jgalar/5706595, I tinkered with lttng-ust/doc/examples/easy-ust to make the sample application use a small C++ object (and turning itself into sample.cpp).  It links and works fine except if LTTNG_UST_HAVE_SDT_INTEGRATION is #defined, in which case I get a "template with C linkage" error on line 71 of sdt.h, followed by a slew of "template specialization with C linkage" errors.
 
   What is odd is that even if I #undef LTTNG_UST_HAVE_SDT_INTEGRATION in sample.cpp just before the #include "sample_component_provider.h", it somehow gets turned back on by the time lttng/tracepoint.h checks it.  If I modify tracepoint.h to comment out the #ifdef in order to leave only its else branch, sample.cpp compiles just fine.

   Two questions, then:
1) how come #undef LTTNG_UST_HAVE_SDT_INTEGRATION doesn't work?
2) can LTTng be used to trace a C++ application when SystemTap is installed?

   I can supply a small tarball of the source code and makefile (just drop those in lttng-ust/doc/examples/easy-ust and "make cppdynamic" to see the problem occur).

Daniel U. Thibault
Protection des systèmes et contremesures (PSC) | Systems Protection & Countermeasures (SPC)
Cyber sécurité pour les missions essentielles (CME) | Mission Critical Cyber Security (MCCS)
R & D pour la défense Canada - Valcartier (RDDC Valcartier) | Defence R&D Canada - Valcartier (DRDC Valcartier)
2459 route de la Bravoure
Québec QC  G3J 1X5
CANADA
Vox : (418) 844-4000 x4245
Fax : (418) 844-4538
NAC : 918V QSDJ <http://www.travelgis.com/map.asp?addr=918V%20QSDJ>
Gouvernement du Canada | Government of Canada
<http://www.valcartier.drdc-rddc.gc.ca/>



More information about the lttng-dev mailing list