From: Mathieu Desnoyers Date: Thu, 23 Jun 2011 20:57:39 +0000 (-0400) Subject: Add wait quiescent ioctl X-Git-Tag: v2.0-pre1~47 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=360f38ea4fee91e2403c03cb43841ef6769aaac7;p=lttng-modules.git Add wait quiescent ioctl Signed-off-by: Mathieu Desnoyers --- diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index aa8dc0f4..c6d9f602 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -196,6 +196,8 @@ long lttng_abi_add_context(struct file *file, * Returns the LTTng kernel tracer version * LTTNG_KERNEL_TRACEPOINT_LIST * Returns a file descriptor listing available tracepoints + * LTTNG_KERNEL_WAIT_QUIESCENT + * Returns after all previously running probes have completed * * The returned session will be deleted when its file descriptor is closed. */ diff --git a/ltt-debugfs-abi.h b/ltt-debugfs-abi.h index 8dc0fde9..e3a7160b 100644 --- a/ltt-debugfs-abi.h +++ b/ltt-debugfs-abi.h @@ -94,6 +94,7 @@ struct lttng_kernel_context { #define LTTNG_KERNEL_TRACER_VERSION \ _IOR(0xF6, 0x41, struct lttng_kernel_tracer_version) #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x42) +#define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x43) /* Session FD ioctl */ #define LTTNG_KERNEL_METADATA \ diff --git a/ltt-events.c b/ltt-events.c index 42d486c1..3457699f 100644 --- a/ltt-events.c +++ b/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/ltt-events.h b/ltt-events.h index f3536cec..4cb4919f 100644 --- a/ltt-events.h +++ b/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);