X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=484ea304e7398057da92ea872a814a0326d1f5b8;hp=596af588c5800c4bd6754bd9ec00de93b3381649;hb=26c9d55e1367d3aff6e501b5a1295edd1ccbc210;hpb=0cd3b1d4a59305a7efb608605d2e74c0ea347383 diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index 596af588c..484ea304e 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -169,8 +169,7 @@ int kernel_create_channel(struct ltt_kernel_session *session, cds_list_add(&lkc->list, &session->channel_list.head); session->channel_count++; - DBG("Kernel channel %s created (fd: %d and path: %s)", - lkc->channel->name, lkc->fd, lkc->pathname); + DBG("Kernel channel %s created (fd: %d)", lkc->channel->name, lkc->fd); return 0; @@ -196,7 +195,13 @@ int kernel_create_event(struct lttng_event *ev, ret = kernctl_create_event(channel->fd, event->event); if (ret < 0) { - if (errno != EEXIST) { + switch (errno) { + case EEXIST: + break; + case ENOSYS: + WARN("Event type not implemented"); + break; + default: PERROR("create event ioctl"); } ret = -errno; @@ -371,7 +376,7 @@ int kernel_open_metadata(struct ltt_kernel_session *session, char *path) session->metadata = lkm; - DBG("Kernel metadata opened (fd: %d and path: %s)", lkm->fd, lkm->pathname); + DBG("Kernel metadata opened (fd: %d)", lkm->fd); return 0; @@ -442,7 +447,7 @@ int kernel_metadata_flush_buffer(int fd) ret = kernctl_buffer_flush(fd); if (ret < 0) { - ERR("Fail to flush metadata buffers %d (ret: %d", fd, ret); + ERR("Fail to flush metadata buffers %d (ret: %d)", fd, ret); } return 0; @@ -499,11 +504,11 @@ error: */ int kernel_open_channel_stream(struct ltt_kernel_channel *channel) { - int ret; + int ret, count = 0; struct ltt_kernel_stream *lks; while ((ret = kernctl_create_stream(channel->fd)) >= 0) { - lks = trace_kernel_create_stream(); + lks = trace_kernel_create_stream(channel->channel->name, count); if (lks == NULL) { ret = close(ret); if (ret) { @@ -519,19 +524,15 @@ int kernel_open_channel_stream(struct ltt_kernel_channel *channel) PERROR("fcntl session fd"); } - ret = asprintf(&lks->pathname, "%s/%s_%d", - channel->pathname, channel->channel->name, channel->stream_count); - if (ret < 0) { - PERROR("asprintf kernel create stream"); - goto error; - } - /* Add stream to channe stream list */ cds_list_add(&lks->list, &channel->stream_list.head); channel->stream_count++; - DBG("Kernel stream %d created (fd: %d, state: %d, path: %s)", - channel->stream_count, lks->fd, lks->state, lks->pathname); + /* Increment counter which represent CPU number. */ + count++; + + DBG("Kernel stream %s created (fd: %d, state: %d)", lks->name, lks->fd, + lks->state); } return channel->stream_count;