Skip to content

Commit

Permalink
tracing: Fix trace_buf_size boot option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Jun 24, 2009
1 parent d82d624 commit 9d612be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9d612be

Please sign in to comment.