From: Mathieu Desnoyers Date: Tue, 23 Nov 2010 23:21:50 +0000 (-0500) Subject: update ltt-events X-Git-Tag: v2.0-pre1~219 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=abcca994d20c0b93025eb5a48d032e53cdc79d11;p=lttng-modules.git update ltt-events Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-events.c b/ltt-events.c index 96c90c4c..a5499f40 100644 --- a/ltt-events.c +++ b/ltt-events.c @@ -13,6 +13,14 @@ static LIST_HEAD(sessions); static DEFINE_MUTEX(sessions_mutex); static struct kmem_cache *event_cache; +static void synchronize_trace(void) +{ + synchronize_sched(); +#ifdef CONFIG_PREEMPT_RT + synchronize_rcu(); +#endif +} + struct ltt_session *ltt_session_create(char *name) { struct ltt_session *session; @@ -41,6 +49,8 @@ int ltt_session_destroy(struct ltt_session *session) struct ltt_event *event, *tmpevent; mutex_lock(&sessions_mutex); + session->active = 0; + synchronize_trace(); /* Wait for in-flight events to complete */ list_for_each_entry_safe(event, tmpevent, &session->events, list) _ltt_event_destroy(event); list_for_each_entry_safe(chan, tmpchan, &session->chan, list) @@ -86,6 +96,7 @@ active: */ int _ltt_channel_destroy(struct ltt_channel *chan) { + /* TODO: destroy rb channel */ list_del(&chan->list); kfree(chan); }