X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=60b55d25a56e9832a261941ecf34007d6bd752d7;hp=c329650c9b4de709f3e810229d4d19b7ab23a905;hb=af706bb7e9bda5d6b95414165681abe422f1541e;hpb=16f6f82061de8b2a778e7c2a082d07c79ed8a790 diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index c329650c9..60b55d25a 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -4876,6 +4876,7 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, int ret = 0; struct lttng_ht_iter iter; struct ust_app *app; + char pathname[PATH_MAX]; assert(usess); assert(output); @@ -4903,10 +4904,19 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, goto error; } + /* Add the UST default trace dir to path. */ + memset(pathname, 0, sizeof(pathname)); + ret = snprintf(pathname, sizeof(pathname), DEFAULT_UST_TRACE_DIR "/%s", + ua_sess->path); + if (ret < 0) { + PERROR("snprintf snapshot path"); + goto error; + } + cds_lfht_for_each_entry(ua_sess->channels->ht, &chan_iter.iter, ua_chan, node.node) { ret = consumer_snapshot_channel(socket, ua_chan->key, output, 0, - ua_sess->euid, ua_sess->egid, ua_sess->path, wait); + ua_sess->euid, ua_sess->egid, pathname, wait); if (ret < 0) { goto error; } @@ -4915,7 +4925,7 @@ int ust_app_snapshot_record(struct ltt_ust_session *usess, registry = get_session_registry(ua_sess); assert(registry); ret = consumer_snapshot_channel(socket, registry->metadata_key, output, - 1, ua_sess->euid, ua_sess->egid, ua_sess->path, wait); + 1, ua_sess->euid, ua_sess->egid, pathname, wait); if (ret < 0) { goto error; }