X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-consumer.c;h=f9a29e49ecd2625f8e6503a8a66a812d1bb72957;hp=5207bfa74f740200d10dcaa50a6c5d6c98710069;hb=348a81dcf7b6944b10a813d93dcaf86fdb5194f6;hpb=2abe796968937298012c0ec668f7fc88305683f2 diff --git a/src/bin/lttng-sessiond/ust-consumer.c b/src/bin/lttng-sessiond/ust-consumer.c index 5207bfa74..f9a29e49e 100644 --- a/src/bin/lttng-sessiond/ust-consumer.c +++ b/src/bin/lttng-sessiond/ust-consumer.c @@ -62,19 +62,19 @@ static char *setup_channel_trace_path(struct consumer_output *consumer, } /* Get correct path name destination */ - if (consumer->type == CONSUMER_DST_LOCAL) { - /* Set application path to the destination path */ - ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s", - consumer->domain_subdir, ua_sess->path); - DBG3("Userspace local consumer trace path relative to current trace chunk: \"%s\"", - pathname); - } else { + if (consumer->type == CONSUMER_DST_NET && + consumer->relay_major_version == 2 && + consumer->relay_minor_version < 11) { ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s/%s%s", consumer->dst.net.base_dir, - consumer->chunk_path, - consumer->domain_subdir, + consumer->chunk_path, consumer->domain_subdir, ua_sess->path); + } else { + ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s", + consumer->domain_subdir, ua_sess->path); } + DBG3("Userspace consumer trace path relative to current trace chunk: \"%s\"", + pathname); if (ret < 0) { PERROR("Failed to format channel path"); goto error; @@ -85,7 +85,6 @@ static char *setup_channel_trace_path(struct consumer_output *consumer, } return pathname; - error: free(pathname); return NULL;