channel->refcount = 1;
}
- switch (output) {
- case LTTNG_EVENT_SPLICE:
- channel->output = CONSUMER_CHANNEL_SPLICE;
- break;
- case LTTNG_EVENT_MMAP:
- channel->output = CONSUMER_CHANNEL_MMAP;
- break;
- default:
- ERR("Allocate channel output unknown %d", output);
- free(channel);
- channel = NULL;
- goto end;
- }
-
strncpy(channel->pathname, pathname, sizeof(channel->pathname));
channel->pathname[sizeof(channel->pathname) - 1] = '\0';
goto end_nosignal;
}
new_channel->nb_init_stream_left = msg.u.channel.nb_init_streams;
+ switch (msg.u.channel.output) {
+ case LTTNG_EVENT_SPLICE:
+ new_channel->output = CONSUMER_CHANNEL_SPLICE;
+ break;
+ case LTTNG_EVENT_MMAP:
+ new_channel->output = CONSUMER_CHANNEL_MMAP;
+ break;
+ default:
+ ERR("Channel output unknown %d", msg.u.channel.output);
+ goto end_nosignal;
+ }
/* Translate and save channel type. */
switch (msg.u.channel.type) {
attr.chan_id = msg.u.ask_channel.chan_id;
memcpy(attr.uuid, msg.u.ask_channel.uuid, sizeof(attr.uuid));
- /* Translate the event output type to UST. */
- switch (channel->output) {
- case LTTNG_EVENT_SPLICE:
- /* Splice not supported so fallback on mmap(). */
- case LTTNG_EVENT_MMAP:
- default:
- attr.output = CONSUMER_CHANNEL_MMAP;
- break;
- };
-
/* Translate and save channel type. */
switch (msg.u.ask_channel.type) {
case LTTNG_UST_CHAN_PER_CPU: