From 635683d75350f395da23354a7524dfd0a1363d48 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 5 Apr 2010 14:36:13 -0400 Subject: [PATCH] Fix lttctl flight recorder wait for daemon (temp fix) Signed-off-by: Mathieu Desnoyers --- configure.in | 2 +- lttctl/lttctl.c | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 0970b7e..5246ff0 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ AC_PREREQ(2.57) AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) #AC_WITH_LTDL # not needed ? -AM_INIT_AUTOMAKE(ltt-control,0.82-02042010) +AM_INIT_AUTOMAKE(ltt-control,0.83-05042010) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL 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); } -- 2.34.1