diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index c3946a6df34e..c61ee85c50bb 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -2336,7 +2336,8 @@ static int tracing_resize_ring_buffer(unsigned long size) | |||
2336 | 2336 | ||
2337 | /* | 2337 | /* |
2338 | * If kernel or user changes the size of the ring buffer | 2338 | * If kernel or user changes the size of the ring buffer |
2339 | * it get completed. | 2339 | * we use the size that was given, and we can forget about |
2340 | * expanding it later. | ||
2340 | */ | 2341 | */ |
2341 | ring_buffer_expanded = 1; | 2342 | ring_buffer_expanded = 1; |
2342 | 2343 | ||
@@ -2351,8 +2352,20 @@ static int tracing_resize_ring_buffer(unsigned long size) | |||
2351 | r = ring_buffer_resize(global_trace.buffer, | 2352 | r = ring_buffer_resize(global_trace.buffer, |
2352 | global_trace.entries); | 2353 | global_trace.entries); |
2353 | if (r < 0) { | 2354 | if (r < 0) { |
2354 | /* AARGH! We are left with different | 2355 | /* |
2355 | * size max buffer!!!! */ | 2356 | * AARGH! We are left with different |
2357 | * size max buffer!!!! | ||
2358 | * The max buffer is our "snapshot" buffer. | ||
2359 | * When a tracer needs a snapshot (one of the | ||
2360 | * latency tracers), it swaps the max buffer | ||
2361 | * with the saved snap shot. We succeeded to | ||
2362 | * update the size of the main buffer, but failed to | ||
2363 | * update the size of the max buffer. But when we tried | ||
2364 | * to reset the main buffer to the original size, we | ||
2365 | * failed there too. This is very unlikely to | ||
2366 | * happen, but if it does, warn and kill all | ||
2367 | * tracing. | ||
2368 | */ | ||
2356 | WARN_ON(1); | 2369 | WARN_ON(1); |
2357 | tracing_disabled = 1; | 2370 | tracing_disabled = 1; |
2358 | } | 2371 | } |