aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2008-11-13 00:09:35 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-13 03:49:22 -0500
commit1696b2b0f44a8d42f3e6b1ea90c21790871c04d9 (patch)
tree87f217120af535771b6249c50d9758c8765fd5f6 /kernel/trace/trace.c
parenta94c80e78bc9f4493ffc25a02d5d7bcd93c399d0 (diff)
ftrace: show buffer size in kilobytes
Impact: change the units of buffer_size_kb to kilobytes This patch changes the units of the buffer_size_kb file to kilobytes. Reading and writing to the file uses kilobytes as units. To help users to know what units are used, the output of the file now looks like: # cat /debug/tracing/buffer_size_kb 1408 Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index b42d42056fa4..d664aae2e10a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2905,7 +2905,7 @@ tracing_entries_read(struct file *filp, char __user *ubuf,
2905 char buf[64]; 2905 char buf[64];
2906 int r; 2906 int r;
2907 2907
2908 r = sprintf(buf, "%lu\n", tr->entries); 2908 r = sprintf(buf, "%lu\n", tr->entries >> 10);
2909 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); 2909 return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
2910} 2910}
2911 2911
@@ -2945,6 +2945,9 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
2945 atomic_inc(&max_tr.data[cpu]->disabled); 2945 atomic_inc(&max_tr.data[cpu]->disabled);
2946 } 2946 }
2947 2947
2948 /* value is in KB */
2949 val <<= 10;
2950
2948 if (val != global_trace.entries) { 2951 if (val != global_trace.entries) {
2949 ret = ring_buffer_resize(global_trace.buffer, val); 2952 ret = ring_buffer_resize(global_trace.buffer, val);
2950 if (ret < 0) { 2953 if (ret < 0) {