documentation under
https://github.com/lttng/lttng-ust/tree/master/doc/examples/getcpu-override[`examples/getcpu-override`].
+`LTTNG_UST_LOADED`::
+ Set internally by `liblttng-ust`'s constructor. Can be used by
+ applications to detect if lttng-ust is loaded, even if liblttng-ust
+ is not directly linked by the application. This environment
+ variable stays set across fork and exec, so an application could
+ observe this environment variable being set if a parent process had
+ lttng-ust loaded when issuing fork, even if this application does
+ not have lttng-ust in its address space.
+
`LTTNG_UST_REGISTER_TIMEOUT`::
Waiting time for the _registration done_ session daemon command
before proceeding to execute the main program (milliseconds).
{
}
+static
+void init_ust_env(void)
+{
+ if (putenv("LTTNG_UST_LOADED=1"))
+ DBG("Error setting LTTNG_UST_LOADED environment variable");
+}
+
/*
* sessiond monitoring thread: monitor presence of global and per-user
* sessiond by polling the application common named pipe.
lttng_fixup_procname_tls();
lttng_fixup_ust_mutex_nest_tls();
+ init_ust_env();
+
/*
* We want precise control over the order in which we construct
* our sub-libraries vs starting to receive commands from