From: Mathieu Desnoyers Date: Mon, 27 Jun 2011 16:07:49 +0000 (-0400) Subject: Merge LTTng commit 360f38ea4fee91e2403c03cb43841ef6769aaac7 X-Git-Tag: v1.9.1~329 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4b4de73e56cad17f87de69bd9386389ed69c0a12;p=lttng-ust.git Merge LTTng commit 360f38ea4fee91e2403c03cb43841ef6769aaac7 Signed-off-by: Mathieu Desnoyers --- diff --git a/libust/ltt-events.c b/libust/ltt-events.c index 42d486c1..3457699f 100644 --- a/libust/ltt-events.c +++ b/libust/ltt-events.c @@ -34,8 +34,6 @@ int _ltt_event_metadata_statedump(struct ltt_session *session, static int _ltt_session_metadata_statedump(struct ltt_session *session); - -static void synchronize_trace(void) { synchronize_sched(); @@ -108,12 +106,9 @@ int ltt_session_enable(struct ltt_session *session) ACCESS_ONCE(session->active) = 1; ACCESS_ONCE(session->been_active) = 1; - synchronize_trace(); /* Wait for in-flight events to complete */ ret = _ltt_session_metadata_statedump(session); - if (ret) { + if (ret) ACCESS_ONCE(session->active) = 0; - synchronize_trace(); /* Wait for in-flight events to complete */ - } end: mutex_unlock(&sessions_mutex); return ret; @@ -129,7 +124,6 @@ int ltt_session_disable(struct ltt_session *session) goto end; } ACCESS_ONCE(session->active) = 0; - synchronize_trace(); /* Wait for in-flight events to complete */ end: mutex_unlock(&sessions_mutex); return ret; diff --git a/libust/ltt-events.h b/libust/ltt-events.h index 787868a9..9b972ab0 100644 --- a/libust/ltt-events.h +++ b/libust/ltt-events.h @@ -273,6 +273,7 @@ int ltt_event_disable(struct ltt_event *event); void ltt_transport_register(struct ltt_transport *transport); void ltt_transport_unregister(struct ltt_transport *transport); +void synchronize_trace(void); int ltt_debugfs_abi_init(void); void ltt_debugfs_abi_exit(void);