ring-buffer: add counters for commit overrun and nmi dropped entries
authorSteven Rostedt <srostedt@redhat.com>
Wed, 29 Apr 2009 17:43:37 +0000 (13:43 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 5 May 2009 17:51:02 +0000 (13:51 -0400)
commitf0d2c681ac0a85142fc8abe65fc33fcad35cb9b7
treeeafd2b655fc7ad0695fc5dbc343bcc1eb17e2e32
parentd6ce96dabe2c4409fd009ec14250a1fdbab4b133
ring-buffer: add counters for commit overrun and nmi dropped entries

The WARN_ON in the ring buffer when a commit is preempted and the
buffer is filled by preceding writes can happen in normal operations.
The WARN_ON makes it look like a bug, not to mention, because
it does not stop tracing and calls printk which can also recurse, this
is prone to deadlock (the WARN_ON is not in a position to recurse).

This patch removes the WARN_ON and replaces it with a counter that
can be retrieved by a tracer. This counter is called commit_overrun.

While at it, I added a nmi_dropped counter to count any time an NMI entry
is dropped because the NMI could not take the spinlock.

[ Impact: prevent deadlock by printing normal case warning ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/linux/ring_buffer.h
kernel/trace/ring_buffer.c