goto nomem;
chan->session = session;
init_waitqueue_head(&chan->notify_wait);
+ chan->id = session->free_chan_id++;
+ /*
+ * Note: the channel creation op already writes into the packet
+ * headers. Therefore the "chan" information used as input
+ * should be already accessible.
+ */
chan->chan = transport->ops.channel_create("[lttng]", chan, buf_addr,
subbuf_size, num_subbuf, switch_timer_interval,
read_timer_interval);
if (!chan->chan)
goto create_error;
- chan->id = session->free_chan_id++;
chan->ops = &transport->ops;
list_add(&chan->list, &session->chan);
mutex_unlock(&sessions_mutex);
*/
waitret = wait_event_interruptible_timeout(*chan->ops->get_reader_wait_queue(chan),
({
- ret = chan->ops->event_reserve(&ctx);
+ ret = chan->ops->event_reserve(&ctx, 0);
ret != -ENOBUFS || !ret;
}),
msecs_to_jiffies(LTTNG_METADATA_TIMEOUT_MSEC));
" name = %s;\n"
" id = %u;\n"
" stream_id = %u;\n"
- " event.fields := struct {\n",
+ " fields := struct {\n",
event->desc->name,
event->id,
event->chan->id);
}
list_for_each_entry(event, &session->events, list) {
- ret = _ltt_event_metadata_statedump(session, chan, event);
+ ret = _ltt_event_metadata_statedump(session, event->chan, event);
if (ret)
goto end;
}