UST consumer: implement missing ust-specific callbacks + fixes.
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 5 Nov 2011 17:45:35 +0000 (13:45 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 5 Nov 2011 17:45:35 +0000 (13:45 -0400)
Also fix consumer handling of poll fd: a mask should be used.
Also fix UST stream output passed to the consumer (the fix is a hack
currently, left a FIXME).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng-share.h
include/lttng/lttng-consumer.h
include/lttng/lttng-kconsumer.h
include/lttng/lttng-ustconsumer.h
liblttng-consumer/lttng-consumer.c
liblttng-kconsumer/lttng-kconsumer.c
liblttng-ustconsumer/lttng-ustconsumer.c
lttng-consumerd/lttng-consumerd.c
lttng-sessiond/trace-ust.c
lttng-sessiond/ust-consumer.c

index cac819d63467377fbe9bf39f8449595e474249b9..708a1f009cf3727d54c42ccf2da62557de1d7db2 100644 (file)
@@ -56,7 +56,7 @@
 /* Must be a power of 2 */
 #define DEFAULT_UST_CHANNEL_SUBBUF_NUM      4
 /* See lttng-ust.h enum lttng_ust_output */
-#define DEFAULT_UST_CHANNEL_OUTPUT          LTTNG_UST_MMAP
+#define DEFAULT_UST_CHANNEL_OUTPUT          LTTNG_EVENT_MMAP
 
 /*
  * Default timeout value for the sem_timedwait() call. Blocking forever is not
index 1a6afc22aedd2e8a89d3ed852b43a0b472d62689..256293b811001f18fe6c3fc865749eed16d7b689 100644 (file)
@@ -126,7 +126,8 @@ struct lttng_consumer_stream {
  */
 struct lttng_consumer_local_data {
        /* function to call when data is available on a buffer */
-       int (*on_buffer_ready)(struct lttng_consumer_stream *stream);
+       int (*on_buffer_ready)(struct lttng_consumer_stream *stream,
+                       struct lttng_consumer_local_data *ctx);
        /*
         * function to call when we receive a new channel, it receives a
         * newly allocated channel, depending on the return code of this
@@ -277,7 +278,8 @@ int consumer_add_channel(struct lttng_consumer_channel *channel);
 
 extern struct lttng_consumer_local_data *lttng_consumer_create(
                enum lttng_consumer_type type,
-               int (*buffer_ready)(struct lttng_consumer_stream *stream),
+               int (*buffer_ready)(struct lttng_consumer_stream *stream,
+                       struct lttng_consumer_local_data *ctx),
                int (*recv_channel)(struct lttng_consumer_channel *channel),
                int (*recv_stream)(struct lttng_consumer_stream *stream),
                int (*update_stream)(int sessiond_key, uint32_t state));
@@ -299,4 +301,8 @@ extern void *lttng_consumer_thread_receive_fds(void *data);
 extern int lttng_consumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                int sock, struct pollfd *consumer_sockpoll);
 
+int lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx);
+int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream);
+
 #endif /* _LTTNG_CONSUMER_H */
index 764a3ef433b69fefd654c6fa6b40fd6f7201795f..4753b5c59ea04c018db667ff65e5aba270eddc3c 100644 (file)
@@ -61,4 +61,9 @@ int lttng_kconsumer_get_produced_snapshot(
 int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
                int sock, struct pollfd *consumer_sockpoll);
 
+
+int lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx);
+int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
+
 #endif /* _LTTNG_KCONSUMER_H */
index eacff654f65901a55408b350e75dbd383dc6e645..90d6588b90e7a75a5da244b4f13f9f8bd5b3438b 100644 (file)
@@ -66,6 +66,10 @@ extern void lttng_ustconsumer_del_channel(struct lttng_consumer_channel *chan);
 extern int lttng_ustconsumer_allocate_stream(struct lttng_consumer_stream *stream);
 extern void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream);
 
+int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx);
+int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream);
+
 #else /* HAVE_LIBLTTNG_UST_CTL */
 
 static inline
@@ -129,6 +133,19 @@ void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
 {
 }
 
+static inline
+int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx)
+{
+       return -ENOSYS;
+}
+
+static inline
+int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
+{
+       return -ENOSYS;
+}
+
 #endif /* HAVE_LIBLTTNG_UST_CTL */
 
 #endif /* _LTTNG_USTCONSUMER_H */
index 2fcb39a27290ea2d1f9a060948df6252698deaf8..7644eac2cefccb7d223c8310c81f7289864f4461 100644 (file)
@@ -546,7 +546,8 @@ void lttng_consumer_sync_trace_file(
  */
 struct lttng_consumer_local_data *lttng_consumer_create(
                enum lttng_consumer_type type,
-               int (*buffer_ready)(struct lttng_consumer_stream *stream),
+               int (*buffer_ready)(struct lttng_consumer_stream *stream,
+                       struct lttng_consumer_local_data *ctx),
                int (*recv_channel)(struct lttng_consumer_channel *channel),
                int (*recv_stream)(struct lttng_consumer_stream *stream),
                int (*update_stream)(int stream_key, uint32_t state))
@@ -806,7 +807,7 @@ void *lttng_consumer_thread_poll_fds(void *data)
                        goto end;
                }
 
-               /* No FDs and consumer_quit, kconsumer_cleanup the thread */
+               /* No FDs and consumer_quit, consumer_cleanup the thread */
                if (nb_fd == 0 && consumer_quit == 1) {
                        goto end;
                }
@@ -817,42 +818,38 @@ void *lttng_consumer_thread_poll_fds(void *data)
                 * array. We want to prioritize array update over
                 * low-priority reads.
                 */
-               if (pollfd[nb_fd].revents == POLLIN) {
+               if (pollfd[nb_fd].revents & POLLIN) {
                        DBG("consumer_poll_pipe wake up");
                        tmp2 = read(ctx->consumer_poll_pipe[0], &tmp, 1);
                        if (tmp2 < 0) {
-                               perror("read kconsumer poll");
+                               perror("read consumer poll");
                        }
                        continue;
                }
 
                /* Take care of high priority channels first. */
                for (i = 0; i < nb_fd; i++) {
-                       switch(pollfd[i].revents) {
-                       case POLLERR:
+                       if (pollfd[i].revents & POLLPRI) {
+                               DBG("Urgent read on fd %d", pollfd[i].fd);
+                               high_prio = 1;
+                               ret = ctx->on_buffer_ready(local_stream[i], ctx);
+                               /* it's ok to have an unavailable sub-buffer */
+                               if (ret == EAGAIN) {
+                                       ret = 0;
+                               }
+                       } else if (pollfd[i].revents & POLLERR) {
                                ERR("Error returned in polling fd %d.", pollfd[i].fd);
                                consumer_del_stream(local_stream[i]);
                                num_hup++;
-                               break;
-                       case POLLHUP:
-                               DBG("Polling fd %d tells it has hung up.", pollfd[i].fd);
+                       } else if (pollfd[i].revents & POLLNVAL) {
+                               ERR("Polling fd %d tells fd is not open.", pollfd[i].fd);
                                consumer_del_stream(local_stream[i]);
                                num_hup++;
-                               break;
-                       case POLLNVAL:
-                               ERR("Polling fd %d tells fd is not open.", pollfd[i].fd);
+                       } else if ((pollfd[i].revents & POLLHUP &&
+                                       !(pollfd[i].revents & POLLIN))) {
+                               DBG("Polling fd %d tells it has hung up.", pollfd[i].fd);
                                consumer_del_stream(local_stream[i]);
                                num_hup++;
-                               break;
-                       case POLLPRI:
-                               DBG("Urgent read on fd %d", pollfd[i].fd);
-                               high_prio = 1;
-                               ret = ctx->on_buffer_ready(local_stream[i]);
-                               /* it's ok to have an unavailable sub-buffer */
-                               if (ret == EAGAIN) {
-                                       ret = 0;
-                               }
-                               break;
                        }
                }
 
@@ -868,9 +865,9 @@ void *lttng_consumer_thread_poll_fds(void *data)
                /* Take care of low priority channels. */
                if (high_prio == 0) {
                        for (i = 0; i < nb_fd; i++) {
-                               if (pollfd[i].revents == POLLIN) {
+                               if (pollfd[i].revents & POLLIN) {
                                        DBG("Normal read on fd %d", pollfd[i].fd);
-                                       ret = ctx->on_buffer_ready(local_stream[i]);
+                                       ret = ctx->on_buffer_ready(local_stream[i], ctx);
                                        /* it's ok to have an unavailable subbuffer */
                                        if (ret == EAGAIN) {
                                                ret = 0;
@@ -1003,3 +1000,32 @@ end:
        }
        return NULL;
 }
+
+int lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx)
+{
+       switch (consumer_data.type) {
+       case LTTNG_CONSUMER_KERNEL:
+               return lttng_kconsumer_read_subbuffer(stream, ctx);
+       case LTTNG_CONSUMER_UST:
+               return lttng_ustconsumer_read_subbuffer(stream, ctx);
+       default:
+               ERR("Unknown consumer_data type");
+               assert(0);
+               return -ENOSYS;
+       }
+}
+
+int lttng_consumer_on_recv_stream(struct lttng_consumer_stream *stream)
+{
+       switch (consumer_data.type) {
+       case LTTNG_CONSUMER_KERNEL:
+               return lttng_kconsumer_on_recv_stream(stream);
+       case LTTNG_CONSUMER_UST:
+               return lttng_ustconsumer_on_recv_stream(stream);
+       default:
+               ERR("Unknown consumer_data type");
+               assert(0);
+               return -ENOSYS;
+       }
+}
index 778dd1631520d61c6c8eab2ae7a525d8c9a5660e..e9861f20fb6b2e11103dacfc8bf36c7e0b77c527 100644 (file)
@@ -300,3 +300,141 @@ end:
 end_nosignal:
        return 0;
 }
+
+/*
+ * Consume data on a file descriptor and write it on a trace file.
+ */
+int lttng_kconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx)
+{
+       unsigned long len;
+       int err;
+       long ret = 0;
+       int infd = stream->wait_fd;
+
+       DBG("In read_subbuffer (infd : %d)", infd);
+       /* Get the next subbuffer */
+       err = kernctl_get_next_subbuf(infd);
+       if (err != 0) {
+               ret = errno;
+               /*
+                * This is a debug message even for single-threaded consumer,
+                * because poll() have more relaxed criterions than get subbuf,
+                * so get_subbuf may fail for short race windows where poll()
+                * would issue wakeups.
+                */
+               DBG("Reserving sub buffer failed (everything is normal, "
+                               "it is due to concurrency)");
+               goto end;
+       }
+
+       switch (stream->output) {
+               case LTTNG_EVENT_SPLICE:
+                       /* read the whole subbuffer */
+                       err = kernctl_get_padded_subbuf_size(infd, &len);
+                       if (err != 0) {
+                               ret = errno;
+                               perror("Getting sub-buffer len failed.");
+                               goto end;
+                       }
+
+                       /* splice the subbuffer to the tracefile */
+                       ret = lttng_consumer_on_read_subbuffer_splice(ctx, stream, len);
+                       if (ret < 0) {
+                               /*
+                                * display the error but continue processing to try
+                                * to release the subbuffer
+                                */
+                               ERR("Error splicing to tracefile");
+                       }
+                       break;
+               case LTTNG_EVENT_MMAP:
+                       /* read the used subbuffer size */
+                       err = kernctl_get_padded_subbuf_size(infd, &len);
+                       if (err != 0) {
+                               ret = errno;
+                               perror("Getting sub-buffer len failed.");
+                               goto end;
+                       }
+                       /* write the subbuffer to the tracefile */
+                       ret = lttng_consumer_on_read_subbuffer_mmap(ctx, stream, len);
+                       if (ret < 0) {
+                               /*
+                                * display the error but continue processing to try
+                                * to release the subbuffer
+                                */
+                               ERR("Error writing to tracefile");
+                       }
+                       break;
+               default:
+                       ERR("Unknown output method");
+                       ret = -1;
+       }
+
+       err = kernctl_put_next_subbuf(infd);
+       if (err != 0) {
+               ret = errno;
+               if (errno == EFAULT) {
+                       perror("Error in unreserving sub buffer\n");
+               } else if (errno == EIO) {
+                       /* Should never happen with newer LTTng versions */
+                       perror("Reader has been pushed by the writer, last sub-buffer corrupted.");
+               }
+               goto end;
+       }
+
+end:
+       return ret;
+}
+
+int lttng_kconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
+{
+       int ret;
+
+       /* Opening the tracefile in write mode */
+       if (stream->path_name != NULL) {
+               ret = open(stream->path_name,
+                               O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU|S_IRWXG|S_IRWXO);
+               if (ret < 0) {
+                       ERR("Opening %s", stream->path_name);
+                       perror("open");
+                       goto error;
+               }
+               stream->out_fd = ret;
+       }
+
+       if (stream->output == LTTNG_EVENT_MMAP) {
+               /* get the len of the mmap region */
+               unsigned long mmap_len;
+
+               ret = kernctl_get_mmap_len(stream->wait_fd, &mmap_len);
+               if (ret != 0) {
+                       ret = errno;
+                       perror("kernctl_get_mmap_len");
+                       goto error_close_fd;
+               }
+               stream->mmap_len = (size_t) mmap_len;
+
+               stream->mmap_base = mmap(NULL, stream->mmap_len,
+                               PROT_READ, MAP_PRIVATE, stream->wait_fd, 0);
+               if (stream->mmap_base == MAP_FAILED) {
+                       perror("Error mmaping");
+                       ret = -1;
+                       goto error_close_fd;
+               }
+       }
+
+       /* we return 0 to let the library handle the FD internally */
+       return 0;
+
+error_close_fd:
+       {
+               int err;
+
+               err = close(stream->out_fd);
+               assert(!err);
+       }
+error:
+       return ret;
+}
+
index db0ba05bd6a160c691b77eff6fe8808a2032dd45..29f735249417709191f344974decbb1f3676fdb3 100644 (file)
@@ -208,6 +208,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 
                DBG("consumer_add_stream %s (%d,%d)", msg.u.stream.path_name,
                        fds[0], fds[1]);
+               assert(msg.u.stream.output == LTTNG_EVENT_MMAP);
                new_stream = consumer_allocate_stream(msg.u.stream.channel_key,
                                msg.u.stream.stream_key,
                                fds[0], fds[1],
@@ -317,3 +318,98 @@ void lttng_ustconsumer_del_stream(struct lttng_consumer_stream *stream)
 {
        ustctl_close_stream_read(stream->chan->handle, stream->buf);
 }
+
+
+int lttng_ustconsumer_read_subbuffer(struct lttng_consumer_stream *stream,
+               struct lttng_consumer_local_data *ctx)
+{
+       unsigned long len;
+       int err;
+       long ret = 0;
+       struct lttng_ust_shm_handle *handle;
+       struct lttng_ust_lib_ring_buffer *buf;
+       char dummy;
+       ssize_t readlen;
+
+       DBG("In read_subbuffer (wait_fd: %d, stream key: %d)",
+               stream->wait_fd, stream->key);
+
+       /* We can consume the 1 byte written into the wait_fd by UST */
+       do {
+               readlen = read(stream->wait_fd, &dummy, 1);
+       } while (readlen == -1 && errno == -EINTR);
+       if (readlen == -1) {
+               ret = readlen;
+               goto end;
+       }
+
+       buf = stream->buf;
+       handle = stream->chan->handle;
+       /* Get the next subbuffer */
+       err = ustctl_get_next_subbuf(handle, buf);
+       if (err != 0) {
+               ret = errno;
+               /*
+                * This is a debug message even for single-threaded consumer,
+                * because poll() have more relaxed criterions than get subbuf,
+                * so get_subbuf may fail for short race windows where poll()
+                * would issue wakeups.
+                */
+               DBG("Reserving sub buffer failed (everything is normal, "
+                               "it is due to concurrency)");
+               goto end;
+       }
+       assert(stream->output == LTTNG_EVENT_MMAP);
+       /* read the used subbuffer size */
+       err = ustctl_get_padded_subbuf_size(handle, buf, &len);
+       if (err != 0) {
+               ret = errno;
+               perror("Getting sub-buffer len failed.");
+               goto end;
+       }
+       /* write the subbuffer to the tracefile */
+       ret = lttng_consumer_on_read_subbuffer_mmap(ctx, stream, len);
+       if (ret < 0) {
+               /*
+                * display the error but continue processing to try
+                * to release the subbuffer
+                */
+               ERR("Error writing to tracefile");
+       }
+       err = ustctl_put_next_subbuf(handle, buf);
+       if (err != 0) {
+               ret = errno;
+               if (errno == EFAULT) {
+                       perror("Error in unreserving sub buffer\n");
+               } else if (errno == EIO) {
+                       /* Should never happen with newer LTTng versions */
+                       perror("Reader has been pushed by the writer, last sub-buffer corrupted.");
+               }
+               goto end;
+       }
+end:
+       return ret;
+}
+
+int lttng_ustconsumer_on_recv_stream(struct lttng_consumer_stream *stream)
+{
+       int ret;
+
+       /* Opening the tracefile in write mode */
+       if (stream->path_name != NULL) {
+               ret = open(stream->path_name,
+                               O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU|S_IRWXG|S_IRWXO);
+               if (ret < 0) {
+                       ERR("Opening %s", stream->path_name);
+                       perror("open");
+                       goto error;
+               }
+               stream->out_fd = ret;
+       }
+
+       /* we return 0 to let the library handle the FD internally */
+       return 0;
+
+error:
+       return ret;
+}
index c85914e7f9b1c8a0db37ea88b8b6cee970010f95..9bc86b0b3c12886e7198cea8eff402c379a1a74d 100644 (file)
@@ -219,142 +219,6 @@ static void parse_args(int argc, char **argv)
        }
 }
 
-/*
- * Consume data on a file descriptor and write it on a trace file.
- */
-static int read_subbuffer(struct lttng_consumer_stream *stream)
-{
-       unsigned long len;
-       int err;
-       long ret = 0;
-       int infd = stream->wait_fd;
-
-       DBG("In read_subbuffer (infd : %d)", infd);
-       /* Get the next subbuffer */
-       err = kernctl_get_next_subbuf(infd);
-       if (err != 0) {
-               ret = errno;
-               /*
-                * This is a debug message even for single-threaded consumer,
-                * because poll() have more relaxed criterions than get subbuf,
-                * so get_subbuf may fail for short race windows where poll()
-                * would issue wakeups.
-                */
-               DBG("Reserving sub buffer failed (everything is normal, "
-                               "it is due to concurrency)");
-               goto end;
-       }
-
-       switch (stream->output) {
-               case LTTNG_EVENT_SPLICE:
-                       /* read the whole subbuffer */
-                       err = kernctl_get_padded_subbuf_size(infd, &len);
-                       if (err != 0) {
-                               ret = errno;
-                               perror("Getting sub-buffer len failed.");
-                               goto end;
-                       }
-
-                       /* splice the subbuffer to the tracefile */
-                       ret = lttng_consumer_on_read_subbuffer_splice(ctx, stream, len);
-                       if (ret < 0) {
-                               /*
-                                * display the error but continue processing to try
-                                * to release the subbuffer
-                                */
-                               ERR("Error splicing to tracefile");
-                       }
-                       break;
-               case LTTNG_EVENT_MMAP:
-                       /* read the used subbuffer size */
-                       err = kernctl_get_padded_subbuf_size(infd, &len);
-                       if (err != 0) {
-                               ret = errno;
-                               perror("Getting sub-buffer len failed.");
-                               goto end;
-                       }
-                       /* write the subbuffer to the tracefile */
-                       ret = lttng_consumer_on_read_subbuffer_mmap(ctx, stream, len);
-                       if (ret < 0) {
-                               /*
-                                * display the error but continue processing to try
-                                * to release the subbuffer
-                                */
-                               ERR("Error writing to tracefile");
-                       }
-                       break;
-               default:
-                       ERR("Unknown output method");
-                       ret = -1;
-       }
-
-       err = kernctl_put_next_subbuf(infd);
-       if (err != 0) {
-               ret = errno;
-               if (errno == EFAULT) {
-                       perror("Error in unreserving sub buffer\n");
-               } else if (errno == EIO) {
-                       /* Should never happen with newer LTTng versions */
-                       perror("Reader has been pushed by the writer, last sub-buffer corrupted.");
-               }
-               goto end;
-       }
-
-end:
-       return ret;
-}
-
-static int on_recv_stream(struct lttng_consumer_stream *stream)
-{
-       int ret;
-
-       /* Opening the tracefile in write mode */
-       if (stream->path_name != NULL) {
-               ret = open(stream->path_name,
-                               O_WRONLY|O_CREAT|O_TRUNC, S_IRWXU|S_IRWXG|S_IRWXO);
-               if (ret < 0) {
-                       ERR("Opening %s", stream->path_name);
-                       perror("open");
-                       goto error;
-               }
-               stream->out_fd = ret;
-       }
-
-       if (stream->output == LTTNG_EVENT_MMAP) {
-               /* get the len of the mmap region */
-               unsigned long mmap_len;
-
-               ret = kernctl_get_mmap_len(stream->wait_fd, &mmap_len);
-               if (ret != 0) {
-                       ret = errno;
-                       perror("kernctl_get_mmap_len");
-                       goto error_close_fd;
-               }
-               stream->mmap_len = (size_t) mmap_len;
-
-               stream->mmap_base = mmap(NULL, stream->mmap_len,
-                               PROT_READ, MAP_PRIVATE, stream->wait_fd, 0);
-               if (stream->mmap_base == MAP_FAILED) {
-                       perror("Error mmaping");
-                       ret = -1;
-                       goto error_close_fd;
-               }
-       }
-
-       /* we return 0 to let the library handle the FD internally */
-       return 0;
-
-error_close_fd:
-       {
-               int err;
-
-               err = close(stream->out_fd);
-               assert(!err);
-       }
-error:
-       return ret;
-}
-
 /*
  * main
  */
@@ -384,7 +248,8 @@ int main(int argc, char **argv)
                                USTCONSUMERD_CMD_SOCK_PATH);
        }
        /* create the consumer instance with and assign the callbacks */
-       ctx = lttng_consumer_create(opt_type, read_subbuffer, NULL, on_recv_stream, NULL);
+       ctx = lttng_consumer_create(opt_type, lttng_consumer_read_subbuffer,
+               NULL, lttng_consumer_on_recv_stream, NULL);
        if (ctx == NULL) {
                goto error;
        }
index e912c53c7e0face7ca1720752f45dc36b709e777..3e1055a8ba8e990556ebd41b1a1f7748a6ff08d9 100644 (file)
@@ -250,7 +250,7 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path)
        lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
        lum->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
        lum->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
-       lum->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
+       lum->attr.output = LTTNG_UST_MMAP;
 
        lum->handle = -1;
        /* Set metadata trace path */
index b83fcc435f8aaf9ced379aa3fd512572b5aa502f..ca008d4adf65d0165d3eaca6f06f149361081594 100644 (file)
@@ -75,7 +75,11 @@ static int send_channel_streams(int sock,
                lum.u.stream.channel_key = uchan->obj->shm_fd;
                lum.u.stream.stream_key = stream->obj->shm_fd;
                lum.u.stream.state = LTTNG_CONSUMER_ACTIVE_STREAM;
-               lum.u.stream.output = uchan->attr.output;
+               /*
+                * FIXME Hack alert! we force MMAP for now. Mixup
+                * between EVENT and UST enums elsewhere.
+                */
+               lum.u.stream.output = DEFAULT_UST_CHANNEL_OUTPUT;
                lum.u.stream.mmap_len = stream->obj->memory_map_size;
                strncpy(lum.u.stream.path_name, stream->pathname, PATH_MAX - 1);
                lum.u.stream.path_name[PATH_MAX - 1] = '\0';
This page took 0.036292 seconds and 4 git commands to generate.