Fix session trace output message
[lttng-tools.git] / lttng / commands / create.c
index 4a64d8a76f87bec5f0aea945602765d7b16d90b1..9fe82514097e9117ce662e4b6c2fa559fa1f4322 100644 (file)
@@ -3,8 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation; only version 2
+ * of the License.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,9 +26,9 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "cmd.h"
-#include "conf.h"
-#include "utils.h"
+#include "../cmd.h"
+#include "../conf.h"
+#include "../utils.h"
 
 static char *opt_output_path;
 static char *opt_session_name;
@@ -64,7 +64,7 @@ static void usage(FILE *ofp)
  */
 static int create_session()
 {
-       int ret;
+       int ret, have_name = 0;
        char name[NAME_MAX];
        char *session_name, *traces_path = NULL, *alloc_path = NULL;
        time_t rawtime;
@@ -79,6 +79,7 @@ static int create_session()
                DBG("Auto session name set to %s", session_name);
        } else {
                session_name = opt_session_name;
+               have_name = 1;
        }
 
        /* Auto output path */
@@ -112,7 +113,11 @@ static int create_session()
        }
 
        MSG("Session %s created.", session_name);
-       MSG("Traces will be written in %s ", traces_path);
+       if (have_name) {
+               MSG("Traces will be written in %s/%s-<date>-<time>" , traces_path, session_name);
+       } else {
+               MSG("Traces will be written in %s/%s", traces_path, session_name);
+       }
 
        ret = CMD_SUCCESS;
 
This page took 0.024475 seconds and 4 git commands to generate.