- /* Use the default consumer output which is the tracing session path. */
- ret = snprintf(lks->consumer->dst.trace_path, PATH_MAX, "%s/kernel", path);
- if (ret < 0) {
- PERROR("snprintf consumer trace path");
- goto error;
- }
+ if (path && strlen(path) > 0) {
+ /* Use the default consumer output which is the tracing session path. */
+ ret = snprintf(lks->consumer->dst.trace_path, PATH_MAX,
+ "%s" DEFAULT_KERNEL_TRACE_DIR, path);
+ if (ret < 0) {
+ PERROR("snprintf consumer trace path");
+ goto error;
+ }