diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 71ed0616d83b..953dd9568dd7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -1490,10 +1490,12 @@ static int __init set_buf_size(char *str) if (!str) return 0; buf_size = memparse(str, &str); - /* nr_entries can not be zero */ - if (buf_size == 0) - return 0; - trace_buf_size = buf_size; + /* + * nr_entries can not be zero and the startup + * tests require some buffer space. Therefore + * ensure we have at least 4096 bytes of buffer. + */ + trace_buf_size = max(4096UL, buf_size); return 1; } __setup("trace_buf_size=", set_buf_size);