lttng-live: populate trace name
[babeltrace.git] / plugins / ctf / lttng-live / viewer-connection.c
index 9f8823a3d6d7a9560a6895039b690c3c1d52ec11..81f043facbb566208a0aec62ab686f31de3679fd 100644 (file)
@@ -20,6 +20,9 @@
  * SOFTWARE.
  */
 
+#define BT_LOG_TAG "PLUGIN-CTF-LTTNG-LIVE-SRC-VIEWER"
+#include "logging.h"
+
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -39,8 +42,6 @@
 #include <babeltrace/common-internal.h>
 #include <babeltrace/graph/graph.h>
 
-#define BT_LOG_TAG "PLUGIN-CTF-LTTNG-LIVE-VIEWER"
-
 #include "lttng-live-internal.h"
 #include "viewer-connection.h"
 #include "lttng-viewer-abi.h"
@@ -670,12 +671,17 @@ int lttng_live_query_session_ids(struct lttng_live_component *lttng_live)
                lsession.session_name[LTTNG_VIEWER_NAME_MAX - 1] = '\0';
                session_id = be64toh(lsession.id);
 
+               BT_LOGD("Adding session %" PRIu64 " hostname: %s session_name: %s",
+                       session_id, lsession.hostname, lsession.session_name);
+
                if ((strncmp(lsession.session_name,
                        viewer_connection->session_name->str,
                        MAXNAMLEN) == 0) && (strncmp(lsession.hostname,
                                viewer_connection->target_hostname->str,
                                MAXNAMLEN) == 0)) {
-                       if (lttng_live_add_session(lttng_live, session_id)) {
+                       if (lttng_live_add_session(lttng_live, session_id,
+                                       lsession.hostname,
+                                       lsession.session_name)) {
                                goto error;
                        }
                }
@@ -770,7 +776,8 @@ int receive_streams(struct lttng_live_session *session,
                                        stream_id, stream.path_name,
                                        stream.channel_name);
                        if (lttng_live_metadata_create_stream(session,
-                                       ctf_trace_id, stream_id)) {
+                                       ctf_trace_id, stream_id,
+                                       stream.path_name)) {
                                BT_LOGE("Error creating metadata stream");
 
                                goto error;
@@ -1411,9 +1418,9 @@ end:
 
 error:
        if (bt_graph_is_canceled(lttng_live->graph)) {
-               status = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_AGAIN;
+               status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
        } else {
-               status = BT_CTF_NOTIF_ITER_MEDIUM_STATUS_ERROR;
+               status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_ERROR;
        }
        return status;
 }
This page took 0.028578 seconds and 4 git commands to generate.