History

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 ]

Steven Rostedt committed 17 years ago

Commit f0d2c681 parent d6ce96d2 files · +51 −3Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/ring_buffer.h+2−0
@@ -153,6 +153,8 @@ unsigned long ring_buffer_entries(struct ring_buffer *buffer); · 152 unmodified lines
153unsigned long ring_buffer_overruns(struct ring_buffer *buffer);153unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
154unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);154unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
155unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu);155unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu);
156unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu);
157unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu);
156 158
157u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu);159u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu);
158void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer,160void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer,