diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-01-29 17:45:49 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-01-30 11:01:53 -0500 |
commit | ad964704ba9326d027fc10fd0099b7c880e50172 (patch) | |
tree | e08884c0f383e5b954233c323df67a3d726b6537 /kernel/trace/trace.c | |
parent | 03274a3ffb449632970fdd35da72ea41cf8474da (diff) | |
download | op-kernel-dev-ad964704ba9326d027fc10fd0099b7c880e50172.zip op-kernel-dev-ad964704ba9326d027fc10fd0099b7c880e50172.tar.gz |
ring-buffer: Add stats field for amount read from trace ring buffer
Add a stat about the number of events read from the ring buffer:
# cat /debug/tracing/per_cpu/cpu0/stats
entries: 39869
overrun: 870512
commit overrun: 0
bytes: 1449912
oldest event ts: 6561.368690
now ts: 6565.246426
dropped events: 0
read events: 112 <-- Added
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index d399592..90a1c71 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4430,6 +4430,9 @@ tracing_stats_read(struct file *filp, char __user *ubuf, cnt = ring_buffer_dropped_events_cpu(tr->buffer, cpu); trace_seq_printf(s, "dropped events: %ld\n", cnt); + cnt = ring_buffer_read_events_cpu(tr->buffer, cpu); + trace_seq_printf(s, "read events: %ld\n", cnt); + count = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len); kfree(s); |