X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=lttng-events.c;h=400c5ecab71cc1111df83280f8588195a983963a;hb=7fd92151444abb6e64e6d8e4eb3ff4cf9828b074;hp=9c8cde8f976adbf38fbccfb360675dc8a73bca59;hpb=d669b02d35cf4da9be01588a6bbc4f42ba86cc39;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 9c8cde8f..400c5eca 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -52,6 +52,8 @@ #include #include #include +#include +#include #define METADATA_CACHE_DEFAULT_SIZE 4096 @@ -237,6 +239,12 @@ int lttng_session_enable(struct lttng_session *session) /* We need to sync enablers with session before activation. */ lttng_session_sync_enablers(session); + /* Clear each stream's quiescent state. */ + list_for_each_entry(chan, &session->chan, list) { + if (chan->channel_type != METADATA_CHANNEL) + lib_ring_buffer_clear_quiescent_channel(chan->chan); + } + ACCESS_ONCE(session->active) = 1; ACCESS_ONCE(session->been_active) = 1; ret = _lttng_session_metadata_statedump(session); @@ -255,6 +263,7 @@ end: int lttng_session_disable(struct lttng_session *session) { int ret = 0; + struct lttng_channel *chan; mutex_lock(&sessions_mutex); if (!session->active) { @@ -266,6 +275,12 @@ int lttng_session_disable(struct lttng_session *session) /* Set transient enabler state to "disabled" */ session->tstate = 0; lttng_session_sync_enablers(session); + + /* Set each stream's quiescent state. */ + list_for_each_entry(chan, &session->chan, list) { + if (chan->channel_type != METADATA_CHANNEL) + lib_ring_buffer_set_quiescent_channel(chan->chan); + } end: mutex_unlock(&sessions_mutex); return ret;