diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 01176788c387..b41907000bc6 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -4056,6 +4056,8 @@ tracing_stats_read(struct file *filp, char __user *ubuf, | |||
4056 | struct trace_array *tr = &global_trace; | 4056 | struct trace_array *tr = &global_trace; |
4057 | struct trace_seq *s; | 4057 | struct trace_seq *s; |
4058 | unsigned long cnt; | 4058 | unsigned long cnt; |
4059 | unsigned long long t; | ||
4060 | unsigned long usec_rem; | ||
4059 | 4061 | ||
4060 | s = kmalloc(sizeof(*s), GFP_KERNEL); | 4062 | s = kmalloc(sizeof(*s), GFP_KERNEL); |
4061 | if (!s) | 4063 | if (!s) |
@@ -4072,6 +4074,17 @@ tracing_stats_read(struct file *filp, char __user *ubuf, | |||
4072 | cnt = ring_buffer_commit_overrun_cpu(tr->buffer, cpu); | 4074 | cnt = ring_buffer_commit_overrun_cpu(tr->buffer, cpu); |
4073 | trace_seq_printf(s, "commit overrun: %ld\n", cnt); | 4075 | trace_seq_printf(s, "commit overrun: %ld\n", cnt); |
4074 | 4076 | ||
4077 | cnt = ring_buffer_bytes_cpu(tr->buffer, cpu); | ||
4078 | trace_seq_printf(s, "bytes: %ld\n", cnt); | ||
4079 | |||
4080 | t = ns2usecs(ring_buffer_oldest_event_ts(tr->buffer, cpu)); | ||
4081 | usec_rem = do_div(t, USEC_PER_SEC); | ||
4082 | trace_seq_printf(s, "oldest event ts: %5llu.%06lu\n", t, usec_rem); | ||
4083 | |||
4084 | t = ns2usecs(ring_buffer_time_stamp(tr->buffer, cpu)); | ||
4085 | usec_rem = do_div(t, USEC_PER_SEC); | ||
4086 | trace_seq_printf(s, "now ts: %5llu.%06lu\n", t, usec_rem); | ||
4087 | |||
4075 | count = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len); | 4088 | count = simple_read_from_buffer(ubuf, count, ppos, s->buffer, s->len); |
4076 | 4089 | ||
4077 | kfree(s); | 4090 | kfree(s); |