Fix: perform volatile load of tracepoint state
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 22 Jun 2015 14:30:02 +0000 (10:30 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 22 Jun 2015 14:38:28 +0000 (10:38 -0400)
Because tracepoint state is updated by lttng-ust threads, and read by
application threads, we need to perform a volatile load of that state.

Not having the volatile load can cause the compiler to optimize away the
reload of that state, keeping a local copy instead. For instance, a main
program consisting of a loop could keep the tracepoint state on its
stack or in registers without ever reloading it from memory.

Perform a volatile load (CMM_LOAD_SHARED()) of the tracepoint state.
Add the matching volatile store (CMM_STORE_SHARED()) in tracepoint.c for
the state update.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

No differences found
This page took 0.025766 seconds and 4 git commands to generate.