X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=e5d8b5707dea19b10810a89ecae52191b189fc15;hp=087846df1c45f086298c51baf7996fbc53583a7f;hb=a4b92340642035d1eafeb1eead0ad01f64d2007d;hpb=eb4a2943f0cf59f2f33627c4fa6ed79300119328 diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 087846df1..e5d8b5707 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2177,6 +2177,20 @@ 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 && + strlen(usess->consumer->dst.trace_path) > 0) { + ret = run_as_mkdir_recursive(usess->consumer->dst.trace_path, + S_IRWXU | S_IRWXG, usess->uid, usess->gid); + if (ret < 0) { + if (ret != -EEXIST) { + ERR("Trace directory creation error"); + ret = -1; + goto error_rcu_unlock; + } + } + } + /* Indicate that the session has been started once */ ua_sess->started = 1;