From d3058129325f5208b2a41a0ac0ca6686250667d2 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Thu, 14 Nov 2024 10:03:46 +0100 Subject: [PATCH] libsysprof-capture: Set initial counter id to pid This avoids collisions when using Sysprof collector in multiprocess apps that share the same controlfd, such as WebKit. --- src/libsysprof-capture/sysprof-collector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsysprof-capture/sysprof-collector.c b/src/libsysprof-capture/sysprof-collector.c index d7f0f120..417eb1e9 100644 --- a/src/libsysprof-capture/sysprof-collector.c +++ b/src/libsysprof-capture/sysprof-collector.c @@ -424,7 +424,7 @@ sysprof_collector_get (void) #else self->tid = self->pid; #endif - self->next_counter_id = 1; + self->next_counter_id = (self->pid << 16); pthread_mutex_lock (&control_fd_lock);