|
@@ -950,6 +950,8 @@ void tracing_start(void)
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
+ /* Prevent the buffers from switching */
|
|
|
+ arch_spin_lock(&ftrace_max_lock);
|
|
|
|
|
|
buffer = global_trace.buffer;
|
|
|
if (buffer)
|
|
@@ -959,6 +961,8 @@ void tracing_start(void)
|
|
|
if (buffer)
|
|
|
ring_buffer_record_enable(buffer);
|
|
|
|
|
|
+ arch_spin_unlock(&ftrace_max_lock);
|
|
|
+
|
|
|
ftrace_start();
|
|
|
out:
|
|
|
spin_unlock_irqrestore(&tracing_start_lock, flags);
|
|
@@ -980,6 +984,9 @@ void tracing_stop(void)
|
|
|
if (trace_stop_count++)
|
|
|
goto out;
|
|
|
|
|
|
+ /* Prevent the buffers from switching */
|
|
|
+ arch_spin_lock(&ftrace_max_lock);
|
|
|
+
|
|
|
buffer = global_trace.buffer;
|
|
|
if (buffer)
|
|
|
ring_buffer_record_disable(buffer);
|
|
@@ -988,6 +995,8 @@ void tracing_stop(void)
|
|
|
if (buffer)
|
|
|
ring_buffer_record_disable(buffer);
|
|
|
|
|
|
+ arch_spin_unlock(&ftrace_max_lock);
|
|
|
+
|
|
|
out:
|
|
|
spin_unlock_irqrestore(&tracing_start_lock, flags);
|
|
|
}
|