From 0fe6e33925a00277b7a2a4088d82a4206d770186 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 27 Feb 2019 12:16:29 -0500 Subject: [PATCH] Remove unneeded creation of the UST domain sub-directory MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ust_app_start_trace() always attempts to create its domain sub-directory after the channel directory has been created. This is redundant and can be safely removed. To provide an example, a "domain sub-directory" is: /home/jgalar/lttng-traces/allo-20190227-115205/ust A "channel sub-directory" is, in per-uid buffering mode: /home/jgalar/lttng-traces/allo-20190227-115205/ust/uid/1000/64-bit or, in per-pid buffering mode: /home/jgalar/lttng-traces/cloe_fafard-20190227-115609/ust/pid/hello-ust-20186-20190227-115700 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/ust-app.c | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 4bee50496..6b9afe3ab 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -4399,36 +4399,6 @@ int ust_app_start_trace(struct ltt_ust_session *usess, struct ust_app *app) goto skip_setup; } - /* Create directories if consumer is LOCAL and has a path defined. */ - if (usess->consumer->type == CONSUMER_DST_LOCAL && - usess->consumer->dst.session_root_path[0] != '\0') { - char tmp_path[LTTNG_PATH_MAX]; - - ret = snprintf(tmp_path, sizeof(tmp_path), "%s/%s%s", - usess->consumer->dst.session_root_path, - usess->consumer->chunk_path, - usess->consumer->domain_subdir); - if (ret >= sizeof(tmp_path)) { - ERR("Local destination path exceeds the maximal allowed length of %zu bytes (needs %i bytes) with path = \"%s%s%s\"", - sizeof(tmp_path), ret, - usess->consumer->dst.session_root_path, - usess->consumer->chunk_path, - usess->consumer->domain_subdir); - goto error_unlock; - } - - DBG("Creating directory path for local tracing: \"%s\"", - tmp_path); - ret = run_as_mkdir_recursive(tmp_path, S_IRWXU | S_IRWXG, - ua_sess->euid, ua_sess->egid); - if (ret < 0) { - if (errno != EEXIST) { - ERR("Trace directory creation error"); - goto error_unlock; - } - } - } - /* * Create the metadata for the application. This returns gracefully if a * metadata was already set for the session. -- 2.34.1