Fix: Wrong data port when listing session
authorDavid Goulet <dgoulet@efficios.com>
Fri, 9 Nov 2012 16:36:51 +0000 (11:36 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 9 Nov 2012 16:36:52 +0000 (11:36 -0500)
Fixes #377

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/cmd.c

index e4e03e88cd3905a0e1321eed49199cc0ab5368e1..386b99ae216504e86cf9225f300816791e4f4234 100644 (file)
@@ -101,11 +101,22 @@ static int build_network_session_path(char *dst, size_t size,
                goto error;
        }
 
+       /*
+        * Do we have a UST url set. If yes, this means we have both kernel and UST
+        * to print.
+        */
        if (strlen(tmp_uurl) > 0) {
                ret = snprintf(dst, size, "[K]: %s [data: %d] -- [U]: %s [data: %d]",
                                tmp_urls, kdata_port, tmp_uurl, udata_port);
        } else {
-               ret = snprintf(dst, size, "%s [data: %d]", tmp_urls, kdata_port);
+               int dport;
+               if (kuri) {
+                       dport = kdata_port;
+               } else {
+                       /* No kernel URI, use the UST port. */
+                       dport = udata_port;
+               }
+               ret = snprintf(dst, size, "%s [data: %d]", tmp_urls, dport);
        }
 
 error:
This page took 0.03779 seconds and 4 git commands to generate.