X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fctf.c;h=0e425bbb0b4d2abacc4a9d5c0297ebfb7278ab0e;hb=3217ac37d3dc40c6e1f87949b23f107fef471fc4;hp=d4004d856b731555be744afc6481d8afe9f9d84c;hpb=41e82e008e6a49f5f9f9d3e7100dacd65676464b;p=babeltrace.git diff --git a/formats/ctf/ctf.c b/formats/ctf/ctf.c index d4004d85..0e425bbb 100644 --- a/formats/ctf/ctf.c +++ b/formats/ctf/ctf.c @@ -121,6 +121,7 @@ void ctf_update_timestamp(struct ctf_stream *stream, updateval = stream->timestamp; updateval &= ~((1ULL << integer_declaration->len) - 1); updateval += newval; + stream->prev_timestamp = stream->timestamp; stream->timestamp = updateval; } @@ -395,32 +396,32 @@ 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, pos->cur_index - 1); events_discarded_diff -= index->events_discarded; } - if (events_discarded_diff != 0) { - fflush(stdout); - fprintf(stderr, "[warning] %d events discarded by tracer. You should try using larger buffers.\n", - events_discarded_diff); - fflush(stderr); - } + file_stream->parent.events_discarded = events_discarded_diff; if (pos->offset == EOF) return; /* The reader will expect us to skip padding */ assert(pos->offset + offset == pos->content_size); ++pos->cur_index; + file_stream->parent.prev_timestamp = file_stream->parent.timestamp; break; } case SEEK_SET: 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);