diff options
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 0287f9f52f5a..05a9f83b8819 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -2233,12 +2233,12 @@ ring_buffer_lock_reserve(struct ring_buffer *buffer, unsigned long length) | |||
2233 | if (ring_buffer_flags != RB_BUFFERS_ON) | 2233 | if (ring_buffer_flags != RB_BUFFERS_ON) |
2234 | return NULL; | 2234 | return NULL; |
2235 | 2235 | ||
2236 | if (atomic_read(&buffer->record_disabled)) | ||
2237 | return NULL; | ||
2238 | |||
2239 | /* If we are tracing schedule, we don't want to recurse */ | 2236 | /* If we are tracing schedule, we don't want to recurse */ |
2240 | resched = ftrace_preempt_disable(); | 2237 | resched = ftrace_preempt_disable(); |
2241 | 2238 | ||
2239 | if (atomic_read(&buffer->record_disabled)) | ||
2240 | goto out_nocheck; | ||
2241 | |||
2242 | if (trace_recursive_lock()) | 2242 | if (trace_recursive_lock()) |
2243 | goto out_nocheck; | 2243 | goto out_nocheck; |
2244 | 2244 | ||
@@ -2470,11 +2470,11 @@ int ring_buffer_write(struct ring_buffer *buffer, | |||
2470 | if (ring_buffer_flags != RB_BUFFERS_ON) | 2470 | if (ring_buffer_flags != RB_BUFFERS_ON) |
2471 | return -EBUSY; | 2471 | return -EBUSY; |
2472 | 2472 | ||
2473 | if (atomic_read(&buffer->record_disabled)) | ||
2474 | return -EBUSY; | ||
2475 | |||
2476 | resched = ftrace_preempt_disable(); | 2473 | resched = ftrace_preempt_disable(); |
2477 | 2474 | ||
2475 | if (atomic_read(&buffer->record_disabled)) | ||
2476 | goto out; | ||
2477 | |||
2478 | cpu = raw_smp_processor_id(); | 2478 | cpu = raw_smp_processor_id(); |
2479 | 2479 | ||
2480 | if (!cpumask_test_cpu(cpu, buffer->cpumask)) | 2480 | if (!cpumask_test_cpu(cpu, buffer->cpumask)) |
@@ -2542,7 +2542,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_record_disable); | |||
2542 | * @buffer: The ring buffer to enable writes | 2542 | * @buffer: The ring buffer to enable writes |
2543 | * | 2543 | * |
2544 | * Note, multiple disables will need the same number of enables | 2544 | * Note, multiple disables will need the same number of enables |
2545 | * to truely enable the writing (much like preempt_disable). | 2545 | * to truly enable the writing (much like preempt_disable). |
2546 | */ | 2546 | */ |
2547 | void ring_buffer_record_enable(struct ring_buffer *buffer) | 2547 | void ring_buffer_record_enable(struct ring_buffer *buffer) |
2548 | { | 2548 | { |
@@ -2578,7 +2578,7 @@ EXPORT_SYMBOL_GPL(ring_buffer_record_disable_cpu); | |||
2578 | * @cpu: The CPU to enable. | 2578 | * @cpu: The CPU to enable. |
2579 | * | 2579 | * |
2580 | * Note, multiple disables will need the same number of enables | 2580 | * Note, multiple disables will need the same number of enables |
2581 | * to truely enable the writing (much like preempt_disable). | 2581 | * to truly enable the writing (much like preempt_disable). |
2582 | */ | 2582 | */ |
2583 | void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu) | 2583 | void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu) |
2584 | { | 2584 | { |