X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt-events.c;h=a5499f40de30f9f0c5818a24004243dba845fbdb;hb=abcca994d20c0b93025eb5a48d032e53cdc79d11;hp=96c90c4cc674eb967482d1963f50772e8912ae09;hpb=92e9481942e5beac764f08d7c25b37fd555b3f4b;p=lttng-modules.git 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); }