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:36:43 +0000 (10:36 -0400)
commitc082d14bd6b59a5c08a5732693cd31229151fbdd
tree89a3bc480730aa39b0ceca755b8f6cf4f968067d
parent5751955a0189ddba441d6849e5ad3c96ec9ee337
Fix: perform volatile load of tracepoint state

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>
include/lttng/tracepoint.h
liblttng-ust/tracepoint.c
This page took 0.024467 seconds and 4 git commands to generate.