Discarded event time range is between last packet event and timestamp_end
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 30 Jan 2012 21:10:08 +0000 (16:10 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 30 Jan 2012 21:10:08 +0000 (16:10 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf-text/ctf-text.c
formats/ctf/ctf.c
include/babeltrace/ctf-ir/metadata.h

index a7e7ef6fc117ecde10d9c660c5ba44fc4513997a..f8507e6256093eba7c67fa7083fb1624b03b637e 100644 (file)
@@ -264,7 +264,7 @@ int ctf_text_write_event(struct stream_pos *ppos,
                        stream->events_discarded);
                ctf_text_print_timestamp(stderr, pos, stream, stream->prev_timestamp);
                fprintf(stderr, "] and [");
-               ctf_text_print_timestamp(stderr, pos, stream, stream->timestamp);
+               ctf_text_print_timestamp(stderr, pos, stream, stream->prev_timestamp_end);
                fprintf(stderr, "]. You should consider increasing the buffer size.\n");
                fflush(stderr);
                stream->events_discarded = 0;
index c343f18366acb0ed22517957fb1e4608e2683a99..0e425bbb0b4d2abacc4a9d5c0297ebfb7278ab0e 100644 (file)
@@ -396,10 +396,12 @@ void ctf_move_pos_slow(struct ctf_stream_pos *pos, size_t offset, int whence)
                {
                        uint32_t events_discarded_diff;
 
-                       /* Print lost event count */
+                       /* For printing discarded event count */
                        index = &g_array_index(pos->packet_index,
                                        struct packet_index, pos->cur_index);
                        events_discarded_diff = index->events_discarded;
+                       file_stream->parent.prev_timestamp_end =
+                                               index->timestamp_end;
                        if (pos->cur_index > 0) {
                                index = &g_array_index(pos->packet_index,
                                                struct packet_index,
@@ -419,6 +421,7 @@ void ctf_move_pos_slow(struct ctf_stream_pos *pos, size_t offset, int whence)
                        assert(offset == 0);    /* only seek supported for now */
                        pos->cur_index = 0;
                        file_stream->parent.prev_timestamp = 0;
+                       file_stream->parent.prev_timestamp_end = 0;
                        break;
                default:
                        assert(0);
index ce5f8b9e477d7053d77aad852c02dc392d0f4b44..94de920cc060a4aef9ddd65ea1d08909d867df0b 100644 (file)
@@ -36,7 +36,6 @@ struct ctf_event;
 struct ctf_stream {
        struct ctf_stream_class *stream_class;
        uint64_t timestamp;                     /* Current timestamp, in ns */
-       uint64_t prev_timestamp;
        uint64_t event_id;                      /* Current event ID */
        int has_timestamp;
        uint64_t stream_id;
@@ -51,6 +50,8 @@ struct ctf_stream {
 
        /* Event discarded information */
        uint32_t events_discarded;
+       uint64_t prev_timestamp;        /* Last event */
+       uint64_t prev_timestamp_end;    /* End-of-packet timestamp */
        
 };
 
This page took 0.026778 seconds and 4 git commands to generate.