docs: Add cases in which tracepoints in ctors/dtors may not work
authorKienan Stewart <kstewart@efficios.com>
Fri, 9 Feb 2024 19:48:29 +0000 (14:48 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Apr 2024 20:04:50 +0000 (16:04 -0400)
Change-Id: I52666810322e26b3841ea1bca6f588b6c3e6f3f8
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/man/lttng-ust.3.txt

index 23d31cacaeb681c119e6df75441d636165fa6775..12f2d65d3e8ca09b37c3591e550d0119173dd287 100644 (file)
@@ -688,6 +688,27 @@ NOTE: Neither `lttng_ust_tracepoint_enabled()` nor
 `lttng_ust_do_tracepoint()` have a `STAP_PROBEV()` call, so if you need
 it, you should emit this call yourself.
 
+Tracing in C/C++ constructors and destructors
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+As of LTTng-UST{nbsp}2.13, tracepoint definitions are implemented using
+compound literals. In the following cases, those compound literals are
+allocated on the heap:
+
+* g++{nbsp}<=={nbsp}4.8 is used as the compiler or,
+* `LTTNG_UST_ALLOCATE_COMPOUND_LITERAL_ON_HEAP` is defined in the C pre-processor flags
+and the application is compiled with a C++ compiler
+
+When the compound literals are heap-allocated, there are some cases in which
+both C-style and C++ constructors and destructors will not be traced.
+
+1. C-style constructors and destructors in statically linked archives
+2. C-style constructors and destructors in the application itself
+3. Some C++-style constructors and destructors in the application and statically linked archives
+
+In the 3rd case above, which C++-style constructors and destructors will not be traced depends
+on the initialization order within each translation unit and across the entire program when
+all translation units are linked together.
 
 [[build-static]]
 Statically linking the tracepoint provider
This page took 0.024735 seconds and 4 git commands to generate.