X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Flttng-live%2Flttng-live-comm.c;fp=formats%2Flttng-live%2Flttng-live-comm.c;h=2b793e5f357ba30079b884a01d9df4a5a08295a7;hp=77bf34ac377156a39fb60aa276873a2659655f24;hb=c0bed13943846ef9b60b22b88401741e918281ce;hpb=e08b9e07b43b305ee9f31690b5c27e5ae24f0078 diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c index 77bf34ac..2b793e5f 100644 --- a/formats/lttng-live/lttng-live-comm.c +++ b/formats/lttng-live/lttng-live-comm.c @@ -1276,14 +1276,30 @@ retry: } if (cur_index->content_size == 0) { + /* Beacon packet index */ if (file_stream->parent.stream_class) { file_stream->parent.cycles_timestamp = cur_index->ts_cycles.timestamp_end; file_stream->parent.real_timestamp = ctf_get_real_timestamp( &file_stream->parent, cur_index->ts_cycles.timestamp_end); + + /* + * Duplicate the data from the previous index, because + * the one we just received is only a beacon with no + * relevant information except the timestamp_end. We + * don't need to keep this timestamp_end because we already + * updated the file_stream timestamps, so we only need + * to keep the last real index data as prev_index. That + * way, we keep the original prev timestamps and + * discarded events counter. This is the same behaviour + * as if we were reading a local trace, we would not + * have fake indexes between real indexes. + */ + memcpy(cur_index, prev_index, sizeof(struct packet_index)); } } else { + /* Real packet index */ if (file_stream->parent.stream_class) { /* Convert the timestamps and append to the real_index. */ cur_index->ts_real.timestamp_begin = ctf_get_real_timestamp(