tracing: Fix trace_buf_size boot option
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 24 Jun 2009 09:33:15 +0000 (17:33 +0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 24 Jun 2009 09:41:12 +0000 (11:41 +0200)
We should be able to specify [KMG] when setting trace_buf_size
boot option, as documented in kernel-parameters.txt

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4A41F2DB.4020102@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Documentation/kernel-parameters.txt
kernel/trace/trace.c

index 92e1ab8178a8693856c599dcc80c0e4f77a78390..d3f41db3ed498b8ff8cfb6f44c5c4e20ceebd525 100644 (file)
@@ -2475,7 +2475,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
        tp720=          [HW,PS2]
 
-       trace_buf_size=nn[KMG] [ftrace] will set tracing buffer size.
+       trace_buf_size=nn[KMG]
+                       [FTRACE] will set tracing buffer size.
 
        trix=           [HW,OSS] MediaTrix AudioTrix Pro
                        Format:
index 3bb31006b5ccab70da5662e9f81ca96474a2a3f2..3aa0a0dfdfa818ccada26954797f6e933b592222 100644 (file)
@@ -284,13 +284,12 @@ void trace_wake_up(void)
 static int __init set_buf_size(char *str)
 {
        unsigned long buf_size;
-       int ret;
 
        if (!str)
                return 0;
-       ret = strict_strtoul(str, 0, &buf_size);
+       buf_size = memparse(str, &str);
        /* nr_entries can not be zero */
-       if (ret < 0 || buf_size == 0)
+       if (buf_size == 0)
                return 0;
        trace_buf_size = buf_size;
        return 1;