aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSlava Pestov <slavapestov@google.com>2011-07-15 17:23:58 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-10-31 16:45:27 -0400
commit884bfe89a462fcc85c8abd96171519cf2fe70929 (patch)
treebe61b3c6ee4d75198af22f5cdadc3b289b207bda /kernel/trace/trace.c
parentf43c738bfa8608424610e4fc1aef4d4644e2ce11 (diff)
ring-buffer: Add a 'dropped events' counter
The existing 'overrun' counter is incremented when the ring buffer wraps around, with overflow on (the default). We wanted a way to count requests lost from the buffer filling up with overflow off, too. I decided to add a new counter instead of retro-fitting the existing one because it seems like a different statistic to count conceptually, and also because of how the code was structured. Link: http://lkml.kernel.org/r/1310765038-26399-1-git-send-email-slavapestov@google.com Signed-off-by: Slava Pestov <slavapestov@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f6928edacd6d..36c213fbfce7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4385,6 +4385,9 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
4385 usec_rem = do_div(t, USEC_PER_SEC); 4385 usec_rem = do_div(t, USEC_PER_SEC);
4386 trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem); 4386 trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem);
4387 4387
4388 cnt = ring_buffer_dropped_events_cpu(tr->buffer, cpu);
4389 trace_seq_printf(s, "dropped events: %ld\n", cnt);
4390
4388 count = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len); 4391 count = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len);
4389 4392
4390 kfree(s); 4393 kfree(s);