From 95a1109b9ea25871941d9fff87cd8c2b2cba61d3 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Tue, 18 Jun 2013 18:07:21 -0400 Subject: [PATCH] Fix UST channel/stream output assignation Signed-off-by: Julien Desfossez Signed-off-by: David Goulet --- src/common/consumer.c | 14 -------------- src/common/kernel-consumer/kernel-consumer.c | 11 +++++++++++ src/common/ust-consumer/ust-consumer.c | 10 ---------- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/common/consumer.c b/src/common/consumer.c index 57322ae08..0518f44ca 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -805,20 +805,6 @@ struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key, 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'; diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index 354a0424e..5b05d9f6b 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -487,6 +487,17 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, 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) { diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 46644a907..432f43a60 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -942,16 +942,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, 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: -- 2.34.1