From 0d45cf3dcfdab3f2eaad91d1a384d83fc6219868 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 2 Apr 2010 20:21:42 -0400 Subject: [PATCH] lttctl: wait for lttd to complete in overwrite mode Signed-off-by: Mathieu Desnoyers --- configure.in | 2 +- lttctl/lttctl.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 67b4584..0970b7e 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.81-26032010) +AM_INIT_AUTOMAKE(ltt-control,0.82-02042010) AM_CONFIG_HEADER(config.h) AM_PROG_LIBTOOL diff --git a/lttctl/lttctl.c b/lttctl/lttctl.c index 3011a96..afa55b6 100644 --- a/lttctl/lttctl.c +++ b/lttctl/lttctl.c @@ -696,10 +696,13 @@ setup_trace_fail: } /* - * Start a lttd daemon to write trace datas + * Start a lttd daemon to write trace data * Dump overwrite channels on overwrite!=0 * Dump normal(non-overwrite) channels on overwrite=0 * + * When called for overwrite mode, wait for lttd to return, so we are sure that + * trace session teardown is not executed before lttd can grab the buffer data. + * * ret: 0 on success * !0 on fail */ @@ -760,8 +763,10 @@ static int lttctl_daemon(int overwrite) } /* -d option */ - argv[argc] = "-d"; - argc++; + if (!overwrite) { + argv[argc] = "-d"; + argc++; + } /* overwrite option */ if (overwrite) { -- 2.34.1