Commit 95609791 authored by Borislav Petkov's avatar Borislav Petkov Committed by Steven Rostedt

ring-buffer: Wrap open-coded WARN_ONCE

Wrap open-coded WARN_ONCE functionality into the equivalent macro.
Signed-off-by: default avatarBorislav Petkov <bp@alien8.de>
LKML-Reference: <20100502060354.GA5281@liondog.tnic>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 4dbf6bc2
...@@ -2000,17 +2000,13 @@ rb_add_time_stamp(struct ring_buffer_per_cpu *cpu_buffer, ...@@ -2000,17 +2000,13 @@ rb_add_time_stamp(struct ring_buffer_per_cpu *cpu_buffer,
u64 *ts, u64 *delta) u64 *ts, u64 *delta)
{ {
struct ring_buffer_event *event; struct ring_buffer_event *event;
static int once;
int ret; int ret;
if (unlikely(*delta > (1ULL << 59) && !once++)) { WARN_ONCE(*delta > (1ULL << 59),
printk(KERN_WARNING "Delta way too big! %llu" KERN_WARNING "Delta way too big! %llu ts=%llu write stamp = %llu\n",
" ts=%llu write stamp = %llu\n", (unsigned long long)*delta,
(unsigned long long)*delta, (unsigned long long)*ts,
(unsigned long long)*ts, (unsigned long long)cpu_buffer->write_stamp);
(unsigned long long)cpu_buffer->write_stamp);
WARN_ON(1);
}
/* /*
* The delta is too big, we to add a * The delta is too big, we to add a
......
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