Skip to content

Commit a838b2e

Browse files
Steven Rostedtrostedt
authored andcommitted
ring-buffer: Make benchmark handle missed events
With the addition of the "missed events" flags that is stored in the commit field of the ring buffer page, the ring_buffer_benchmark was not updated to handle this. If events are missed, then the missed events flag is set in the ring buffer page, the benchmark will count that flag as part of the size of the page and will hit the BUG() when it tries to read beyond the page. The solution is simply to have the ring buffer benchmark mask off the extra bits. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 72c9ddf commit a838b2e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎kernel/trace/ring_buffer_benchmark.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ static enum event_status read_page(int cpu)
113113
ret = ring_buffer_read_page(buffer, &bpage, PAGE_SIZE, cpu, 1);
114114
if (ret >= 0) {
115115
rpage = bpage;
116-
commit = local_read(&rpage->commit);
116+
/* The commit may have missed event flags set, clear them */
117+
commit = local_read(&rpage->commit) & 0xfffff;
117118
for (i = 0; i < commit && !kill_test; i += inc) {
118119

119120
if (i >= (PAGE_SIZE - offsetof(struct rb_page, data))) {

0 commit comments

Comments
 (0)