summaryrefslogtreecommitdiffstats
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 09:49:22 +0100
commit1696b2b0f44a8d42f3e6b1ea90c21790871c04d9 (patch)
tree87f217120af535771b6249c50d9758c8765fd5f6 /kernel/trace/trace.c
parenta94c80e78bc9f4493ffc25a02d5d7bcd93c399d0 (diff)
downloadop-kernel-dev-1696b2b0f44a8d42f3e6b1ea90c21790871c04d9.zip
op-kernel-dev-1696b2b0f44a8d42f3e6b1ea90c21790871c04d9.tar.gz
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 b42d420..d664aae 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2905,7 +2905,7 @@ tracing_entries_read(struct file *filp, char __user *ubuf,
char buf[64];
int r;
- r = sprintf(buf, "%lu\n", tr->entries);
+ r = sprintf(buf, "%lu\n", tr->entries >> 10);
return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
}
@@ -2945,6 +2945,9 @@ tracing_entries_write(struct file *filp, const char __user *ubuf,
atomic_inc(&max_tr.data[cpu]->disabled);
}
+ /* value is in KB */
+ val <<= 10;
+
if (val != global_trace.entries) {
ret = ring_buffer_resize(global_trace.buffer, val);
if (ret < 0) {
OpenPOWER on IntegriCloud