aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ring_buffer.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 2606cee433da..d4d3580a894a 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -2383,7 +2383,6 @@ rb_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts)
2383 * the box. Return the padding, and we will release 2383 * the box. Return the padding, and we will release
2384 * the current locks, and try again. 2384 * the current locks, and try again.
2385 */ 2385 */
2386 rb_advance_reader(cpu_buffer);
2387 return event; 2386 return event;
2388 2387
2389 case RINGBUF_TYPE_TIME_EXTEND: 2388 case RINGBUF_TYPE_TIME_EXTEND:
@@ -2519,6 +2518,8 @@ ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts)
2519 if (dolock) 2518 if (dolock)
2520 spin_lock(&cpu_buffer->reader_lock); 2519 spin_lock(&cpu_buffer->reader_lock);
2521 event = rb_buffer_peek(buffer, cpu, ts); 2520 event = rb_buffer_peek(buffer, cpu, ts);
2521 if (event && event->type_len == RINGBUF_TYPE_PADDING)
2522 rb_advance_reader(cpu_buffer);
2522 if (dolock) 2523 if (dolock)
2523 spin_unlock(&cpu_buffer->reader_lock); 2524 spin_unlock(&cpu_buffer->reader_lock);
2524 local_irq_restore(flags); 2525 local_irq_restore(flags);
@@ -2590,12 +2591,9 @@ ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts)
2590 spin_lock(&cpu_buffer->reader_lock); 2591 spin_lock(&cpu_buffer->reader_lock);
2591 2592
2592 event = rb_buffer_peek(buffer, cpu, ts); 2593 event = rb_buffer_peek(buffer, cpu, ts);
2593 if (!event) 2594 if (event)
2594 goto out_unlock; 2595 rb_advance_reader(cpu_buffer);
2595
2596 rb_advance_reader(cpu_buffer);
2597 2596
2598 out_unlock:
2599 if (dolock) 2597 if (dolock)
2600 spin_unlock(&cpu_buffer->reader_lock); 2598 spin_unlock(&cpu_buffer->reader_lock);
2601 local_irq_restore(flags); 2599 local_irq_restore(flags);