X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-consumer.c;h=44913cb8fcb763b40b49bc2dc6466d9bd6cef721;hb=aefea3b7b1a1e7255becc0de1b0eac73d6798bed;hp=b7e0d359261dbdec4a686a893dbb3a0416ea04ac;hpb=173af62f4804133d4a7f45e34b6f72126f3eca5f;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-consumer.c b/src/bin/lttng-sessiond/ust-consumer.c index b7e0d3592..44913cb8f 100644 --- a/src/bin/lttng-sessiond/ust-consumer.c +++ b/src/bin/lttng-sessiond/ust-consumer.c @@ -52,7 +52,8 @@ static int send_channel(int sock, struct ust_app_channel *uchan) uchan->obj->shm_fd, uchan->attr.subbuf_size, uchan->obj->memory_map_size, - uchan->name); + uchan->name, + uchan->streams.count); ret = consumer_send_channel(sock, &msg); if (ret < 0) { @@ -136,8 +137,8 @@ static int send_channel_streams(int sock, /* Get the right path name destination */ if (consumer->type == CONSUMER_DST_LOCAL) { /* Set application path to the destination path */ - ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s", - consumer->dst.trace_path, usess->path); + ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s/%s", + consumer->dst.trace_path, consumer->subdir, usess->path); if (ret < 0) { PERROR("snprintf stream path"); goto error; @@ -208,7 +209,8 @@ static int send_metadata(int sock, struct ust_app_session *usess, usess->metadata->obj->shm_fd, usess->metadata->attr.subbuf_size, usess->metadata->obj->memory_map_size, - "metadata"); + "metadata", + 1); ret = consumer_send_channel(sock, &msg); if (ret < 0) { @@ -225,8 +227,8 @@ static int send_metadata(int sock, struct ust_app_session *usess, /* Get correct path name destination */ if (consumer->type == CONSUMER_DST_LOCAL) { /* Set application path to the destination path */ - ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s", - consumer->dst.trace_path, usess->path); + ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s/%s", + consumer->dst.trace_path, consumer->subdir, usess->path); if (ret < 0) { PERROR("snprintf stream path"); goto error; @@ -289,8 +291,12 @@ int ust_consumer_send_session(struct ust_app_session *usess, struct ust_app_channel *ua_chan; assert(usess); - assert(consumer); - assert(sock); + + if (consumer == NULL || sock == NULL) { + /* There is no consumer so just ignoring the command. */ + DBG("UST consumer does not exist. Not sending streams"); + return 0; + } DBG("Sending metadata stream fd to consumer on %d", sock->fd);