Fix UST channel/stream output assignation
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index f24b5fa3e2587039a57e4fca3eef192bc80ed6c3..432f43a60c92d78aff436370e717ca382231d466 100644 (file)
@@ -115,13 +115,14 @@ static struct lttng_consumer_channel *allocate_channel(uint64_t session_id,
                const char *pathname, const char *name, uid_t uid, gid_t gid,
                int relayd_id, uint64_t key, enum lttng_event_output output,
                uint64_t tracefile_size, uint64_t tracefile_count,
-               unsigned int monitor)
+               uint64_t session_id_per_pid, unsigned int monitor)
 {
        assert(pathname);
        assert(name);
 
-       return consumer_allocate_channel(key, session_id, pathname, name, uid, gid,
-                       relayd_id, output, tracefile_size, tracefile_count, monitor);
+       return consumer_allocate_channel(key, session_id, pathname, name, uid,
+                       gid, relayd_id, output, tracefile_size,
+                       tracefile_count, session_id_per_pid, monitor);
 }
 
 /*
@@ -926,6 +927,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                                (enum lttng_event_output) msg.u.ask_channel.output,
                                msg.u.ask_channel.tracefile_size,
                                msg.u.ask_channel.tracefile_count,
+                               msg.u.ask_channel.session_id_per_pid,
                                msg.u.ask_channel.monitor);
                if (!channel) {
                        goto end_channel_error;
@@ -940,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:
@@ -1511,10 +1503,13 @@ int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
        }
 
        request.session_id = channel->session_id;
+       request.session_id_per_pid = channel->session_id_per_pid;
        request.uid = channel->uid;
        request.key = channel->key;
-       DBG("Sending metadata request to sessiond, session %" PRIu64,
-                       channel->session_id);
+       DBG("Sending metadata request to sessiond, session id %" PRIu64
+                       ", per-pid %" PRIu64,
+                       channel->session_id,
+                       channel->session_id_per_pid);
 
        ret = lttcomm_send_unix_sock(ctx->consumer_metadata_socket, &request,
                        sizeof(request));
This page took 0.023602 seconds and 4 git commands to generate.