X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-events.c;h=0faff8498df3d61eb972415a4b1c1336ccce20a4;hb=b8590f409425c30491f1c25e16ea5f156b0e605b;hp=4b891cd5ecda22e8778f5a4592f19c9e2574172f;hpb=b3b8072b02b4f1917a0254577c48301e8f44c210;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 4b891cd5..0faff849 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -31,6 +31,7 @@ #include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "wrapper/random.h" #include "wrapper/tracepoint.h" +#include "lttng-kernel-version.h" #include "lttng-events.h" #include "lttng-tracer.h" #include "lttng-abi-old.h" @@ -60,9 +61,15 @@ void _lttng_metadata_channel_hangup(struct lttng_metadata_stream *stream); void synchronize_trace(void) { synchronize_sched(); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) +#ifdef CONFIG_PREEMPT_RT_FULL + synchronize_rcu(); +#endif +#else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ #ifdef CONFIG_PREEMPT_RT synchronize_rcu(); #endif +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)) */ } struct lttng_session *lttng_session_create(void) @@ -285,6 +292,7 @@ struct lttng_channel *lttng_channel_create(struct lttng_session *session, goto nomem; chan->session = session; chan->id = session->free_chan_id++; + chan->ops = &transport->ops; /* * Note: the channel creation op already writes into the packet * headers. Therefore the "chan" information used as input @@ -296,7 +304,6 @@ struct lttng_channel *lttng_channel_create(struct lttng_session *session, if (!chan->chan) goto create_error; chan->enabled = 1; - chan->ops = &transport->ops; chan->transport = transport; chan->channel_type = channel_type; list_add(&chan->list, &session->chan); @@ -553,6 +560,8 @@ void _lttng_event_destroy(struct lttng_event *event) * sessions_mutex), so we can do racy operations such as looking for * remaining space left in packet and write, since mutual exclusion * protects us from concurrent writes. + * Returns the number of bytes written in the channel, 0 if no data + * was written and a negative value on error. */ int lttng_metadata_output_channel(struct lttng_metadata_stream *stream, struct channel *chan)