diff options
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index c8d2a66e1d1f..f83a42a79ee8 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -467,14 +467,19 @@ struct ring_buffer_iter { | |||
467 | }; | 467 | }; |
468 | 468 | ||
469 | /* buffer may be either ring_buffer or ring_buffer_per_cpu */ | 469 | /* buffer may be either ring_buffer or ring_buffer_per_cpu */ |
470 | #define RB_WARN_ON(buffer, cond) \ | 470 | #define RB_WARN_ON(b, cond) \ |
471 | ({ \ | 471 | ({ \ |
472 | int _____ret = unlikely(cond); \ | 472 | int _____ret = unlikely(cond); \ |
473 | if (_____ret) { \ | 473 | if (_____ret) { \ |
474 | atomic_inc(&buffer->record_disabled); \ | 474 | if (__same_type(*(b), struct ring_buffer_per_cpu)) { \ |
475 | WARN_ON(1); \ | 475 | struct ring_buffer_per_cpu *__b = \ |
476 | } \ | 476 | (void *)b; \ |
477 | _____ret; \ | 477 | atomic_inc(&__b->buffer->record_disabled); \ |
478 | } else \ | ||
479 | atomic_inc(&b->record_disabled); \ | ||
480 | WARN_ON(1); \ | ||
481 | } \ | ||
482 | _____ret; \ | ||
478 | }) | 483 | }) |
479 | 484 | ||
480 | /* Up this if you want to test the TIME_EXTENTS and normalization */ | 485 | /* Up this if you want to test the TIME_EXTENTS and normalization */ |