]> Pileus Git - ~andy/linux/blobdiff - kernel/trace/trace_irqsoff.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
[~andy/linux] / kernel / trace / trace_irqsoff.c
index 667aa8cc0cfcbcc1d3d4a960d03d8e9e15d1d3fc..20dad0d7a1633c551eec45e7f708dca4ac48b38c 100644 (file)
@@ -23,7 +23,7 @@ static int                            tracer_enabled __read_mostly;
 
 static DEFINE_PER_CPU(int, tracing_cpu);
 
-static DEFINE_SPINLOCK(max_trace_lock);
+static DEFINE_RAW_SPINLOCK(max_trace_lock);
 
 enum {
        TRACER_IRQS_OFF         = (1 << 1),
@@ -321,7 +321,7 @@ check_critical_timing(struct trace_array *tr,
        if (!report_latency(delta))
                goto out;
 
-       spin_lock_irqsave(&max_trace_lock, flags);
+       raw_spin_lock_irqsave(&max_trace_lock, flags);
 
        /* check if we are still the max latency */
        if (!report_latency(delta))
@@ -344,7 +344,7 @@ check_critical_timing(struct trace_array *tr,
        max_sequence++;
 
 out_unlock:
-       spin_unlock_irqrestore(&max_trace_lock, flags);
+       raw_spin_unlock_irqrestore(&max_trace_lock, flags);
 
 out:
        data->critical_sequence = max_sequence;
@@ -505,13 +505,13 @@ EXPORT_SYMBOL(trace_hardirqs_off_caller);
 #ifdef CONFIG_PREEMPT_TRACER
 void trace_preempt_on(unsigned long a0, unsigned long a1)
 {
-       if (preempt_trace())
+       if (preempt_trace() && !irq_trace())
                stop_critical_timing(a0, a1);
 }
 
 void trace_preempt_off(unsigned long a0, unsigned long a1)
 {
-       if (preempt_trace())
+       if (preempt_trace() && !irq_trace())
                start_critical_timing(a0, a1);
 }
 #endif /* CONFIG_PREEMPT_TRACER */