Commit 9086c7b9 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

ring-buffer: have benchmark test handle discarded events

With the addition of commit:

  c7b09308
  ring-buffer: prevent adding write in discarded area

The ring buffer may now add discarded events when a write passes
the end of a buffer page. Before, a discarded event was only added
when the tracer deliberately created one. The ring buffer benchmark
test does not handle discarded events when it reads the buffer and
fails when it encounters one.

Also fix the increment for large data entries (luckily, the test did
not add any yet).

[ Impact: fix false failure of ring buffer self test ]
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent c7b09308
...@@ -102,8 +102,10 @@ static enum event_status read_page(int cpu) ...@@ -102,8 +102,10 @@ static enum event_status read_page(int cpu)
event = (void *)&rpage->data[i]; event = (void *)&rpage->data[i];
switch (event->type_len) { switch (event->type_len) {
case RINGBUF_TYPE_PADDING: case RINGBUF_TYPE_PADDING:
/* We don't expect any padding */ /* failed writes may be discarded events */
KILL_TEST(); if (!event->time_delta)
KILL_TEST();
inc = event->array[0] + 4;
break; break;
case RINGBUF_TYPE_TIME_EXTEND: case RINGBUF_TYPE_TIME_EXTEND:
inc = 8; inc = 8;
...@@ -119,7 +121,7 @@ static enum event_status read_page(int cpu) ...@@ -119,7 +121,7 @@ static enum event_status read_page(int cpu)
KILL_TEST(); KILL_TEST();
break; break;
} }
inc = event->array[0]; inc = event->array[0] + 4;
break; break;
default: default:
entry = ring_buffer_event_data(event); entry = ring_buffer_event_data(event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment