Skip to contentSkip to conversation

libtracefs: Add missed_events to record

PATCH New Steven Rostedt 1 participant 1 message Aug 4, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Add missed_events to record

From: "Steven Rostedt (Google)" <[email protected]>

When iterating over the events in the ring buffer, make sure to set the "missed_events" value of the record. This is very important for the callers to know that events were dropped.

Fixes 3add2d75192e0 ("libtracefs: Iterate over raw events in sorted order")
---
 src/tracefs-events.c | 1 +
 1 file changed, 1 insertion(+)
src/tracefs-events.c +1 -0
index 61a1c122e74e..d870241e127f 100644
@@ -46,6 +46,7 @@ static int read_kbuf_record(struct cpu_iterate *cpu)
 	cpu->record.ts = ts;
 	cpu->record.size = kbuffer_event_size(cpu->kbuf);
 	cpu->record.record_size = kbuffer_curr_size(cpu->kbuf);
+	cpu->record.missed_events = kbuffer_missed_events(cpu->kbuf);
 	cpu->record.cpu = cpu->cpu;
 	cpu->record.data = ptr;
 	cpu->record.ref_count = 1;
Signature · 1 line
2.35.1