diff --git a/src/PerfCounters.cc b/src/PerfCounters.cc index dc414f15f79..3aca0b8155a 100644 --- a/src/PerfCounters.cc +++ b/src/PerfCounters.cc @@ -828,7 +828,6 @@ size_t PerfCounters::PTState::flush() { mmap_header->data_size - start_offset); memcpy(packet.data(), const_cast(header), first_chunk_size); memcpy(packet.data() + first_chunk_size, const_cast(data_buf), header->size - first_chunk_size); - mmap_header->data_tail += header->size; switch (header->type) { case PERF_RECORD_LOST: @@ -857,6 +856,8 @@ size_t PerfCounters::PTState::flush() { FATAL() << "Unknown record " << header->type; break; } + + mmap_header->data_tail += header->size; } return ret; }