X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=60b55d25a56e9832a261941ecf34007d6bd752d7;hb=af706bb7e9bda5d6b95414165681abe422f1541e;hp=2d7a81f1a1dc130afd12aad38758f664542b7ec3;hpb=d9bf3ca437aa801c9364ca06b1083f83c6f8ef30;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 2d7a81f1a..60b55d25a 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -377,10 +377,12 @@ void delete_ust_app_channel(int sock, struct ust_app_channel *ua_chan, delete_ust_app_event(sock, ua_event); } - /* Wipe and free registry from session registry. */ - registry = get_session_registry(ua_chan->session); - if (registry) { - ust_registry_channel_del_free(registry, ua_chan->key); + if (ua_chan->session->buffer_type == LTTNG_BUFFER_PER_PID) { + /* Wipe and free registry from session registry. */ + registry = get_session_registry(ua_chan->session); + if (registry) { + ust_registry_channel_del_free(registry, ua_chan->key); + } } if (ua_chan->obj != NULL) { @@ -4874,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); @@ -4901,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; } @@ -4913,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; }