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:37:50 +0000 (10:37 -0400)
commit05523fbf3fa3af6247a048c32d219b07bd65fd1a
tree2d6957a60aa56ac67f536dd5cc7736dbefd87c21
parentc49ee9040ada6984c880756614e8a6f7fd645bd6
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.024608 seconds and 4 git commands to generate.