mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
ring-buffer: disable all cpu buffers when one finds a problem
Currently the way RB_WARN_ON works, is to disable either the current CPU buffer or all CPU buffers, depending on whether a ring_buffer or ring_buffer_per_cpu struct was passed into the macro. Most users of the RB_WARN_ON pass in the CPU buffer, so only the one CPU buffer gets disabled but the rest are still active. This may confuse users even though a warning is sent to the console. This patch changes the macro to disable the entire buffer even if the CPU buffer is passed in. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
a1863c212b
commit
077c5407cd
1 changed files with 13 additions and 8 deletions
|
@ -467,11 +467,16 @@ struct ring_buffer_iter {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* buffer may be either ring_buffer or ring_buffer_per_cpu */
|
/* buffer may be either ring_buffer or ring_buffer_per_cpu */
|
||||||
#define RB_WARN_ON(buffer, cond) \
|
#define RB_WARN_ON(b, cond) \
|
||||||
({ \
|
({ \
|
||||||
int _____ret = unlikely(cond); \
|
int _____ret = unlikely(cond); \
|
||||||
if (_____ret) { \
|
if (_____ret) { \
|
||||||
atomic_inc(&buffer->record_disabled); \
|
if (__same_type(*(b), struct ring_buffer_per_cpu)) { \
|
||||||
|
struct ring_buffer_per_cpu *__b = \
|
||||||
|
(void *)b; \
|
||||||
|
atomic_inc(&__b->buffer->record_disabled); \
|
||||||
|
} else \
|
||||||
|
atomic_inc(&b->record_disabled); \
|
||||||
WARN_ON(1); \
|
WARN_ON(1); \
|
||||||
} \
|
} \
|
||||||
_____ret; \
|
_____ret; \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue