Fix: Subdirectory handling for lttng and sessiond
authorDavid Goulet <dgoulet@efficios.com>
Thu, 16 Aug 2012 18:57:13 +0000 (14:57 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 16 Aug 2012 23:28:29 +0000 (19:28 -0400)
commit07424f161f4afbd07fd165e4ae492726e1de7769
treeb6de59f1a536a6c9bb67fad43eea83b35088fd05
parentf9cd0dcde5fb24b3872aea0ba248e1dcab602ff7
Fix: Subdirectory handling for lttng and sessiond

The subdirectory creation was not right for a number of scenarios. With
this commit, if the user defines a path (either local or remote), the
session name will NOT be added to the path.

To handle the timestamp creation of the directory, a hidden function was
added to the lttng-ctl (meaning not visible through lttng.h) which takes
the date and time as a string and append it to the URI subdirectory if
none was provided for a network destination. This function is declared
as extern in the lttng client so it could link to it through the
liblttng-ctl (_lttng_create_session_ext).

It allows the timestamp of a session to be created on the client side
and keep the lttng_create_session() behavior intact meaning if a path is
define by the user when using the API directly, the traces are written
in that path without an extra session name directory.

There is one case where the timestamp is generated on the daemon side.
When creating a session with a local filesystem destination and then
switching to a network consumer, at that time the timestamp is
generated.

The real problematic, and why this has been done this way, is because we
can't transfer the timestamp between the client and the session daemon.
The only possible way that could be achieve right now is by parsing the
subdirectory of the URI containing the session name and timestamp
appended. This could be error prone and bring false negative.

CC: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/Makefile.am
src/bin/lttng-sessiond/main.c
src/bin/lttng-sessiond/session.c
src/bin/lttng/commands/create.c
src/common/defaults.h
src/lib/lttng-ctl/lttng-ctl.c
tests/tools/Makefile.am
This page took 0.025466 seconds and 4 git commands to generate.