lttng-live: print discarded event and packet lost warnings on stderr
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 28 Sep 2017 14:00:32 +0000 (10:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Oct 2017 15:52:18 +0000 (11:52 -0400)
Reported-by: Liguang Li <liguang.lee6@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ctf.c
formats/lttng-live/lttng-live-comm.c
include/babeltrace/ctf/types.h

index bc96212149c47260ca5af36b73fa4458c0ffe27e..0cdce8ef48ea365d323eeb23007448a2eeaad352 100644 (file)
@@ -426,7 +426,6 @@ void print_uuid(FILE *fp, unsigned char *uuid)
  * consumer had time to extract them. We keep track of those gaps with the
  * packet sequence number in each packet.
  */
-static
 void ctf_print_discarded_lost(FILE *fp, struct ctf_stream_definition *stream)
 {
        if ((!stream->events_discarded && !stream->packets_lost) ||
index a1c95bbc31238504e82186e522aae14d0244749c..77bf34ac377156a39fb60aa276873a2659655f24 100644 (file)
@@ -1297,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 =
index cc8acbf5ef173e3b3e413a21b6d528b9149d5720..574f97b3657aa9b83ba4610f8afdde7efcda50a2 100644 (file)
@@ -249,5 +249,6 @@ void ctf_print_timestamp(FILE *fp, struct ctf_stream_definition *stream,
                        uint64_t timestamp);
 int ctf_append_trace_metadata(struct bt_trace_descriptor *tdp,
                        FILE *metadata_fp);
+void ctf_print_discarded_lost(FILE *fp, struct ctf_stream_definition *stream);
 
 #endif /* _BABELTRACE_CTF_TYPES_H */
This page took 0.035514 seconds and 4 git commands to generate.