- assert(pos->cur_index < pos->packet_cycles_index->len);
- assert(pos->cur_index < pos->packet_real_index->len);
-
- /* For printing discarded event count */
- packet_index = &g_array_index(pos->packet_cycles_index,
- struct packet_index, pos->cur_index);
- file_stream->parent.prev_cycles_timestamp_end =
- packet_index->timestamp_end;
- file_stream->parent.prev_cycles_timestamp =
- packet_index->timestamp_begin;
-
- packet_index = &g_array_index(pos->packet_real_index,
- struct packet_index, pos->cur_index);
- file_stream->parent.prev_real_timestamp_end =
- packet_index->timestamp_end;
- file_stream->parent.prev_real_timestamp =
- packet_index->timestamp_begin;
-
- events_discarded_diff = packet_index->events_discarded;
- if (pos->cur_index > 0) {
- packet_index = &g_array_index(pos->packet_real_index,
- struct packet_index,
- pos->cur_index - 1);
- events_discarded_diff -= packet_index->events_discarded;
- /*
- * Deal with 32-bit wrap-around if the
- * tracer provided a 32-bit field.
- */
- if (packet_index->events_discarded_len == 32) {
- events_discarded_diff = (uint32_t) events_discarded_diff;
- }
+ assert(pos->cur_index < pos->packet_index->len);
+ if (index > 0) {
+ prev_index = &g_array_index(pos->packet_index,
+ struct packet_index, index - 1);