Unregister tracepoint probes when not needed
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Mar 2013 00:41:24 +0000 (19:41 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Mar 2013 00:41:24 +0000 (19:41 -0500)
commitac6b4ac62c8cd22eede4b0fd49706e8f838bf208
tree39905c469e3fb5a760d9595f11ce18ad0b4238d2
parent13b21cd60df2abab292653cead980ef27dbfab08
Unregister tracepoint probes when not needed

Ensure tracepoint probes are only connected when we meet these
conditions:

at least one enabler enables event && session active && channel enabled

We introduce a "tstate" flag in addition to "active/enabled".

Active and enabled fields are used to atomically enable/disable session
and channel, whereas the tstate flag is a "transient state" enable
state. It is used to update all events following a state change
transition. The actual effect of the state transition is committed
atomically with store to active/enabled flag.

Upon enable, we do:

tstate = 1
update all events
enable = 1;

Upon disable, we do the opposite:

enable = 0;
tstate = 0;
update all events

The purpose of this scheme is to allow atomic enable/disable of events
while allowing per-event probe registration to be performed
non-atomically.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
liblttng-ust/lttng-events.c
liblttng-ust/lttng-ust-abi.c
This page took 0.024771 seconds and 4 git commands to generate.