*/
s64 pidunique = -1LL;
+/* The process pid is used to detect a non-traceable fork
+ * and allow the non-traceable fork to be ignored
+ * by destructor sequences in libust
+ */
+static pid_t processpid = 0;
+
static struct ustcomm_header _receive_header;
static struct ustcomm_header *receive_header = &_receive_header;
static char receive_buffer[USTCOMM_BUFFER_SIZE];
* pid, (before and after an exec).
*/
pidunique = make_pidunique();
+ processpid = getpid();
DBG("Tracectl constructor");
static void __attribute__((destructor)) keepalive()
{
+ if (processpid != getpid()) {
+ return;
+ }
+
if (trace_recording() && LOAD_SHARED(buffers_to_export)) {
int total = 0;
DBG("Keeping process alive for consumer daemon...");
/* FIXME: technically, the locks could have been taken before the fork */
DBG("ust: forking");
+ /* Get the pid of the new process */
+ processpid = getpid();
+
/* break lock if necessary */
ltt_unlock_traces();