X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-events.c;h=b7e44221958d1230be181178dc3e90f5ce1990fa;hb=35097f3627cd567d794ce4752327a50fb2f15791;hp=4b891cd5ecda22e8778f5a4592f19c9e2574172f;hpb=b3b8072b02b4f1917a0254577c48301e8f44c210;p=lttng-modules.git diff --git a/lttng-events.c b/lttng-events.c index 4b891cd5..b7e44221 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -285,6 +285,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 +297,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 +553,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)