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)
commit90c4caed9e31fb3d7779b19f2841b59d1928b00a
tree20d6b263cf0ed33171925159f1bcaa2634da95ed
parent83e512c0cacce282fdcc85548164f355328c42b1
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.024859 seconds and 4 git commands to generate.