diff options
-rw-r--r-- | kernel/trace/trace.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 04ab8243a13d..62a63b2b33dd 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2948,10 +2948,18 @@ tracing_entries_read(struct file *filp, char __user *ubuf, | |||
2948 | size_t cnt, loff_t *ppos) | 2948 | size_t cnt, loff_t *ppos) |
2949 | { | 2949 | { |
2950 | struct trace_array *tr = filp->private_data; | 2950 | struct trace_array *tr = filp->private_data; |
2951 | char buf[64]; | 2951 | char buf[96]; |
2952 | int r; | 2952 | int r; |
2953 | 2953 | ||
2954 | r = sprintf(buf, "%lu\n", tr->entries >> 10); | 2954 | mutex_lock(&trace_types_lock); |
2955 | if (!ring_buffer_expanded) | ||
2956 | r = sprintf(buf, "%lu (expanded: %lu)\n", | ||
2957 | tr->entries >> 10, | ||
2958 | trace_buf_size >> 10); | ||
2959 | else | ||
2960 | r = sprintf(buf, "%lu\n", tr->entries >> 10); | ||
2961 | mutex_unlock(&trace_types_lock); | ||
2962 | |||
2955 | return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); | 2963 | return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); |
2956 | } | 2964 | } |
2957 | 2965 | ||