Fix lttng view using lttng list sessions
authorDavid Goulet <dgoulet@efficios.com>
Fri, 17 Aug 2012 18:02:56 +0000 (14:02 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 17 Aug 2012 18:06:29 +0000 (14:06 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/main.c

index 495465b6f76ada3b870f3074ec4ee7106a4764b8..8cd9d4c57ee62ecc58e6bf70a48da4d26e47cbe5 100644 (file)
@@ -2513,13 +2513,17 @@ static void list_lttng_sessions(struct lttng_session *sessions, uid_t uid,
                        continue;
                }
 
                        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);
                        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");
                }
                if (ret < 0) {
                        PERROR("snprintf session path");
This page took 0.028307 seconds and 4 git commands to generate.