]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: keep ring buffer to minimum size till used
authorSteven Rostedt <srostedt@redhat.com>
Wed, 11 Mar 2009 17:42:01 +0000 (13:42 -0400)
committerSteven Rostedt <srostedt@redhat.com>
Thu, 12 Mar 2009 02:15:22 +0000 (22:15 -0400)
commit5cbcef1fad1aa3aa8ea500ed62abc51b6c754b82
treeca318ef3da72aac3f809583967185c0b34998c94
parent7ba4f596960d6ffdd28d5f5d89444f75ae9b4141
tracing: keep ring buffer to minimum size till used

Impact: less memory impact on systems not using tracer

When the kernel boots up that has tracing configured, it allocates
the default size of the ring buffer. This currently happens to be
1.4Megs per possible CPU. This is quite a bit of wasted memory if
the system is never using the tracer.

The current solution is to keep the ring buffers to a minimum size
until the user uses them. Once a tracer is piped into the current_tracer
the ring buffer will be expanded to the default size. If the user
changes the size of the ring buffer, it will take the size given
by the user immediately.

If the user adds a "ftrace=" to the kernel command line, then the ring
buffers will be set to the default size on initialization.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
kernel/trace/trace.c