*
* Linux Trace Toolkit Control
*
- * Small program that controls LTT through libltt.
- *
- * Copyright 2005 -
- * Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Small program that controls LTTng through liblttctl.
*
* Copyright 2008 FUJITSU
* Zhao Lei <zhaolei@cn.fujitsu.com>
* Gui Jianfeng <guijianfeng@cn.fujitsu.com>
+ * Copyright 2009-2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef HAVE_CONFIG_H
printf(" Set channels root path, For -w option."
" (ex. /mnt/debugfs/ltt)\n");
printf("\n");
+ printf(" Environment variables:\n");
+ printf(" LTT_DAEMON\n");
+ printf(" Complete path to the lttd binary (needs to be\n");
+ printf(" specified if different than package build prefix).\n");
+ printf("\n");
}
/*
}
/*
- * 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
*/
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);
}