Fix lttctl flight recorder wait for daemon (temp fix)
[ltt-control.git] / lttctl / lttctl.c
index afa55b67cc85bede5a51b44692d32a05c542d78c..e77b7f38d6833f8abc2cc8dd0fba8b19b9a9c146 100644 (file)
@@ -763,10 +763,8 @@ static int lttctl_daemon(int overwrite)
                }
 
                /* -d option */
-               if (!overwrite) {
-                       argv[argc] = "-d";
-                       argc++;
-               }
+               argv[argc] = "-d";
+               argc++;
 
                /* overwrite option */
                if (overwrite) {
@@ -799,6 +797,16 @@ static int lttctl_daemon(int overwrite)
        if (WEXITSTATUS(status))
                fprintf(stderr, "lttd process running failed\n");
 
+       /*
+        * FIXME
+        * This is a temporary hack to ensure that the lttd daemon grabs
+        * handles on the debugfs buffer files before we destroy the trace
+        * session. Properly handling this will imply separating the "flush"
+        * from the "destroy" operation at kernel-level in LTTng.
+        */
+       if (overwrite)
+               sleep(2);
+
        return WEXITSTATUS(status);
 }
 
This page took 0.022401 seconds and 4 git commands to generate.