Fix: get the stream_id when generating live beacons
[lttng-tools.git] / src / bin / lttng-relayd / main.c
index 93b08fcaa4a32cddfb4deef66682e8a1b8ae6135..3a6bebaf7d6d3dc1ab5f7cf4fe76522d6f5c56fd 100644 (file)
@@ -251,7 +251,10 @@ int set_option(int opt, const char *arg, const char *optname)
                if (arg) {
                        lttng_opt_verbose = config_parse_value(arg);
                } else {
-                       lttng_opt_verbose += 1;
+                       /* Only 3 level of verbosity (-vvv). */
+                       if (lttng_opt_verbose < 3) {
+                               lttng_opt_verbose += 1;
+                       }
                }
                break;
        default:
@@ -1202,6 +1205,7 @@ int relay_add_stream(struct lttcomm_relayd_hdr *recv_hdr,
        stream->session_id = session->id;
        stream->index_fd = -1;
        stream->read_index_fd = -1;
+       stream->ctf_stream_id = -1ULL;
        lttng_ht_node_init_u64(&stream->node, stream->stream_handle);
        pthread_mutex_init(&stream->lock, NULL);
 
@@ -1960,6 +1964,9 @@ int relay_recv_index(struct lttcomm_relayd_hdr *recv_hdr,
        }
 
        copy_index_control_data(index, &index_info);
+       if (stream->ctf_stream_id == -1ULL) {
+               stream->ctf_stream_id = be64toh(index_info.stream_id);
+       }
 
        if (index_created) {
                /*
This page took 0.025457 seconds and 4 git commands to generate.