Implement getcpu override
[lttng-ust.git] / liblttng-ust / lttng-ust-comm.c
index 3df2adc6f96e0b0b16189efe6497509ea845e3da..cc5188f6112cb744ddd45297973cef532201d9a6 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #define _LGPL_SOURCE
+#define _GNU_SOURCE
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/mman.h>
@@ -52,6 +53,8 @@
 #include "compat.h"
 #include "../libringbuffer/tlsfixup.h"
 #include "lttng-ust-baddr.h"
+#include "clock.h"
+#include "../libringbuffer/getcpu.h"
 
 /*
  * Has lttng ust comm constructor been called ?
@@ -335,6 +338,16 @@ void lttng_fixup_ust_mutex_nest_tls(void)
        asm volatile ("" : : "m" (URCU_TLS(ust_mutex_nest)));
 }
 
+/*
+ * Fixup urcu bp TLS.
+ */
+static
+void lttng_fixup_urcu_bp_tls(void)
+{
+       rcu_read_lock();
+       rcu_read_unlock();
+}
+
 int lttng_get_notify_socket(void *owner)
 {
        struct sock_info *info = owner;
@@ -1419,6 +1432,7 @@ void __attribute__((constructor)) lttng_ust_init(void)
         * to be the dynamic linker mutex) and ust_lock, taken within
         * the ust lock.
         */
+       lttng_fixup_urcu_bp_tls();
        lttng_fixup_ringbuffer_tls();
        lttng_fixup_vtid_tls();
        lttng_fixup_nest_count_tls();
@@ -1433,6 +1447,8 @@ void __attribute__((constructor)) lttng_ust_init(void)
         */
        init_usterr();
        init_tracepoint();
+       lttng_ust_clock_init();
+       lttng_ust_getcpu_init();
        lttng_ust_baddr_statedump_init();
        lttng_ring_buffer_metadata_client_init();
        lttng_ring_buffer_client_overwrite_init();
This page took 0.023725 seconds and 4 git commands to generate.