lttng-live: print discarded event and packet lost warnings on stderr
[babeltrace.git] / formats / lttng-live / lttng-live-comm.c
index c19cc6460b5b06ee07ed46e6e5b5f54adf17d80a..77bf34ac377156a39fb60aa276873a2659655f24 100644 (file)
@@ -1033,6 +1033,13 @@ retry:
        switch (be32toh(rp->status)) {
        case LTTNG_VIEWER_INDEX_INACTIVE:
                printf_verbose("get_next_index: inactive\n");
+
+               if (index->ts_cycles.timestamp_end ==
+                               be64toh(rp->timestamp_end)) {
+                       /* Already seen this timestamp. */
+                       (void) poll(NULL, 0, ACTIVE_POLL_DELAY);
+               }
+
                memset(index, 0, sizeof(struct packet_index));
                index->ts_cycles.timestamp_end = be64toh(rp->timestamp_end);
                *stream_id = be64toh(rp->stream_id);
@@ -1290,6 +1297,16 @@ retry:
                ctf_update_current_packet_index(&file_stream->parent,
                                prev_index, cur_index);
 
+               /*
+                * We need to check if we are in trace read or called
+                * from packet indexing.  In this last case, the
+                * collection is not there, so we cannot print the
+                * timestamps.
+                */
+               if ((&file_stream->parent)->stream_class->trace->parent.collection) {
+                       ctf_print_discarded_lost(stderr, &file_stream->parent);
+               }
+
                file_stream->parent.cycles_timestamp =
                                cur_index->ts_cycles.timestamp_begin;
                file_stream->parent.real_timestamp =
This page took 0.023117 seconds and 4 git commands to generate.