All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH lttng-tools] Fix: path of snapshots with a relay and default URI
@ 2017-08-29 15:13 Julien Desfossez
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Desfossez @ 2017-08-29 15:13 UTC (permalink / raw)
  To: jgalar; +Cc: lttng-dev

When recording a snapshot to a relay without custom URI (ex:
net://localhost vs net://localhost/custom), the snapshots end up being
stored in ~/lttng-traces/<hostname>/snapshot-XXX instead of being inside
the <session-name> folder like on local snapshots. We would expect the
path to be: ~/lttng-traces/<hostname>/<session-name>/snapshot-XXX

So there is a discrepancy between the local and remote behaviour. This
behaviour has been there since at least v2.6, maybe earlier.

Moreover, there is nothing that informs the user about the default
snapshot name, so it is not possible to know where a snapshot has been
stored.

The subdir variable when using a relay is the path on the relay (after
~/lttng-traces/). We then prepend the hostname and append the
domain-specific name (/kernel or /ust). A lot of counter-intuitive
manipulations, but this ends up being the correct path. A patch to
simplify this is on its way later.

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
---
 src/bin/lttng-sessiond/cmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
index a295059..c91d649 100644
--- a/src/bin/lttng-sessiond/cmd.c
+++ b/src/bin/lttng-sessiond/cmd.c
@@ -2635,6 +2635,12 @@ int cmd_create_session_uri(char *name, struct lttng_uri *uris,
 		}
 		session->output_traces = 1;
 	} else {
+		/*
+		 * For snapshots to a relay with the default session name,
+		 * we have to store the session name here since it becomes the
+		 * base of the path and we only append to this path afterwards.
+		 */
+		snprintf(session->consumer->subdir, PATH_MAX, "%s", name);
 		session->output_traces = 0;
 		DBG2("Session %s created with no output", session->name);
 	}
-- 
2.7.4

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH lttng-tools] Fix: path of snapshots with a relay and default URI
       [not found] <1504019582-21492-1-git-send-email-jdesfossez@efficios.com>
@ 2017-08-29 18:29 ` Julien Desfossez
  0 siblings, 0 replies; 2+ messages in thread
From: Julien Desfossez @ 2017-08-29 18:29 UTC (permalink / raw)
  To: jgalar; +Cc: lttng-dev

I found a way to store this information only in the case of snapshots
instead of for all session created, see v2.
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-29 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 15:13 [PATCH lttng-tools] Fix: path of snapshots with a relay and default URI Julien Desfossez
     [not found] <1504019582-21492-1-git-send-email-jdesfossez@efficios.com>
2017-08-29 18:29 ` Julien Desfossez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.