From: David Goulet Date: Fri, 17 Aug 2012 18:02:56 +0000 (-0400) Subject: Fix lttng view using lttng list sessions X-Git-Tag: v2.1.0-rc1~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6f6367686cc6454484e5259497b04ce8d7d2e213;p=lttng-tools.git Fix lttng view using lttng list sessions Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 495465b6f..8cd9d4c57 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -2513,13 +2513,17 @@ static void list_lttng_sessions(struct lttng_session *sessions, uid_t uid, continue; } - if (session->consumer->type == CONSUMER_DST_LOCAL && - (!session->kernel_session && !session->ust_session)) { - ret = snprintf(sessions[i].path, sizeof(session[i].path), "%s", - session->consumer->dst.trace_path); - } else { + struct ltt_kernel_session *ksess = session->kernel_session; + struct ltt_ust_session *usess = session->ust_session; + + if (session->consumer->type == CONSUMER_DST_NET || + (ksess && ksess->consumer->type == CONSUMER_DST_NET) || + (usess && usess->consumer->type == CONSUMER_DST_NET)) { ret = build_network_session_path(sessions[i].path, sizeof(session[i].path), session); + } else { + ret = snprintf(sessions[i].path, sizeof(session[i].path), "%s", + session->consumer->dst.trace_path); } if (ret < 0) { PERROR("snprintf session path");