From 495dece518e24e6c8563c588be77b5e23e060a02 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 9 Dec 2019 10:41:43 -0500 Subject: [PATCH] Fix: sessiond: ust-app: per-pid buffers: Create empty ust/ directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When no applications are running, the toplevel ust/ directory is not created in a chunk on rotation. Make sure this top level directory is created. Signed-off-by: Mathieu Desnoyers Change-Id: Ia272f3182df298302e02b3e096785cb51687b8c9 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/ust-app.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 856de63a3..58308dec8 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -6486,6 +6486,17 @@ enum lttng_error_code ust_app_create_channel_subdirectories( { struct ust_app *app; + /* + * Create the toplevel ust/ directory in case no apps are running. + */ + chunk_status = lttng_trace_chunk_create_subdirectory( + usess->current_trace_chunk, + DEFAULT_UST_TRACE_DIR); + if (chunk_status != LTTNG_TRACE_CHUNK_STATUS_OK) { + ret = LTTNG_ERR_CREATE_DIR_FAIL; + goto error; + } + cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, pid_n.node) { struct ust_app_session *ua_sess; -- 2.34.1