Fix: perform volatile load of tracepoint state
[lttng-ust.git] / liblttng-ust / tracepoint.c
index a4a79ba59b3f8298b30a2889bf6e7e30ef04aad2..5fd1126aa42d3b03c5709994aaad61c4ddaa11ae 100644 (file)
@@ -30,6 +30,7 @@
 #include <urcu/hlist.h>
 #include <urcu/uatomic.h>
 #include <urcu/compiler.h>
+#include <urcu/system.h>
 
 #include <lttng/tracepoint.h>
 #include <lttng/ust-abi.h>     /* for LTTNG_UST_SYM_NAME_LEN */
@@ -347,7 +348,7 @@ static void set_tracepoint(struct tracepoint_entry **entry,
         * is used.
         */
        rcu_assign_pointer(elem->probes, (*entry)->probes);
-       elem->state = active;
+       CMM_STORE_SHARED(elem->state, active);
 }
 
 /*
@@ -358,7 +359,7 @@ static void set_tracepoint(struct tracepoint_entry **entry,
  */
 static void disable_tracepoint(struct lttng_ust_tracepoint *elem)
 {
-       elem->state = 0;
+       CMM_STORE_SHARED(elem->state, 0);
        rcu_assign_pointer(elem->probes, NULL);
 }
 
This page took 0.02316 seconds and 4 git commands to generate.