X-Git-Url: https://git.lttng.org/?p=ltt-control.git;a=blobdiff_plain;f=lttctl%2Flttctl.c;h=e77b7f38d6833f8abc2cc8dd0fba8b19b9a9c146;hp=afa55b67cc85bede5a51b44692d32a05c542d78c;hb=635683d75350f395da23354a7524dfd0a1363d48;hpb=0d45cf3dcfdab3f2eaad91d1a384d83fc6219868 diff --git a/lttctl/lttctl.c b/lttctl/lttctl.c index afa55b6..e77b7f3 100644 --- a/lttctl/lttctl.c +++ b/lttctl/lttctl.c @@ -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); }