Add valgrind support for consumer
[lttng-tools.git] / src / common / hashtable / rculfhash.c
index b430a3dec76e681ebf561f33bb9fcc767c713037..e42c9201ceac0e47b2baa7131eb0ca012af6ddf2 100644 (file)
 #include <stdio.h>
 #include <pthread.h>
 
+#include <common/defaults.h>
 #include "rculfhash.h"
 #include "rculfhash-internal.h"
 #include "urcu-flavor.h"
@@ -631,7 +632,11 @@ int ht_get_split_count_index(unsigned long hash)
        int cpu;
 
        assert(split_count_mask >= 0);
-       cpu = sched_getcpu();
+       if (getenv(DEFAULT_CONSUMER_DEBUG_VALGRIND_ENV)) {
+               cpu = 0;
+       } else {
+               cpu = sched_getcpu();
+       }
        if (caa_unlikely(cpu < 0))
                return hash & split_count_mask;
        else
This page took 0.024087 seconds and 4 git commands to generate.