X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Ffs-sink%2Ffs-sink-trace.c;h=60f668ea3df5929e26eaa41134e2bfb2363febeb;hp=e9097848c8ab0b624b87a49e8acdd2d77a912c3e;hb=72d458a311ee9b8c2cc84d8ade5754e5ea517fcb;hpb=c20049fd0678f462f621c80f9e91c1ba16e6b656 diff --git a/src/plugins/ctf/fs-sink/fs-sink-trace.c b/src/plugins/ctf/fs-sink/fs-sink-trace.c index e9097848..60f668ea 100644 --- a/src/plugins/ctf/fs-sink/fs-sink-trace.c +++ b/src/plugins/ctf/fs-sink/fs-sink-trace.c @@ -393,11 +393,7 @@ GString *make_trace_path_rel(const struct fs_sink_trace *trace) GString *path = NULL; const char *trace_name; - if (trace->fs_sink->assume_single_trace) { - /* Use output directory directly */ - path = g_string_new(""); - goto end; - } + BT_ASSERT(!trace->fs_sink->assume_single_trace); /* First, try to build a path using environment fields written by LTTng. */ path = make_lttng_trace_path_rel(trace); @@ -431,25 +427,33 @@ GString *make_trace_path(const struct fs_sink_trace *trace, const char *output_b GString *full_path = NULL; GString *unique_full_path = NULL; - rel_path = make_trace_path_rel(trace); - if (!rel_path) { - goto end; - } + if (trace->fs_sink->assume_single_trace) { + /* Use output directory directly */ + unique_full_path = g_string_new(output_base_directory); + if (!unique_full_path) { + goto end; + } + } else { + rel_path = make_trace_path_rel(trace); + if (!rel_path) { + goto end; + } - rel_path_san = sanitize_trace_path(rel_path->str); - if (!rel_path_san) { - goto end; - } + rel_path_san = sanitize_trace_path(rel_path->str); + if (!rel_path_san) { + goto end; + } - full_path = g_string_new(NULL); - if (!full_path) { - goto end; - } + full_path = g_string_new(NULL); + if (!full_path) { + goto end; + } - g_string_printf(full_path, "%s" G_DIR_SEPARATOR_S "%s", - output_base_directory, rel_path_san->str); + g_string_printf(full_path, "%s" G_DIR_SEPARATOR_S "%s", + output_base_directory, rel_path_san->str); - unique_full_path = make_unique_trace_path(full_path->str); + unique_full_path = make_unique_trace_path(full_path->str); + } end: if (rel_path) {