diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0c1dc1850858..35ee63ae4122 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2357,6 +2357,26 @@ static int tracing_resize_ring_buffer(unsigned long size) | |||
2357 | return ret; | 2357 | return ret; |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | /** | ||
2361 | * tracing_update_buffers - used by tracing facility to expand ring buffers | ||
2362 | * | ||
2363 | * To save on memory when the tracing is never used on a system with it | ||
2364 | * configured in. The ring buffers are set to a minimum size. But once | ||
2365 | * a user starts to use the tracing facility, then they need to grow | ||
2366 | * to their default size. | ||
2367 | * | ||
2368 | * This function is to be called when a tracer is about to be used. | ||
2369 | */ | ||
2370 | int tracing_update_buffers(void) | ||
2371 | { | ||
2372 | int ret = 0; | ||
2373 | |||
2374 | if (!ring_buffer_expanded) | ||
2375 | ret = tracing_resize_ring_buffer(trace_buf_size); | ||
2376 | |||
2377 | return ret; | ||
2378 | } | ||
2379 | |||
2360 | struct trace_option_dentry; | 2380 | struct trace_option_dentry; |
2361 | 2381 | ||
2362 | static struct trace_option_dentry * | 2382 | static struct trace_option_dentry * |