Fix UST channel/stream output assignation
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 18 Jun 2013 22:07:21 +0000 (18:07 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 28 Jun 2013 15:32:03 +0000 (11:32 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c
src/common/kernel-consumer/kernel-consumer.c
src/common/ust-consumer/ust-consumer.c

index 57322ae08dbb41685f17bcadb3b59ccc378c2431..0518f44ca902e8b55054d93a28a17314b89a740f 100644 (file)
@@ -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';
 
index 354a0424e3d27993f87b90d24352c5cad21f19c2..5b05d9f6b6d4e9d9b0c588700def21dc5fa06cfe 100644 (file)
@@ -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) {
index 46644a907a9b7bd5e659def07bcae21c2295ed7d..432f43a60c92d78aff436370e717ca382231d466 100644 (file)
@@ -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:
This page took 0.038128 seconds and 4 git commands to generate.