Merge branch 'for-linus' of git://gitserver.sunplusct.com/linux-2.6-score
[pandora-kernel.git] / kernel / trace / trace_irqsoff.c
index b923d13..3aa7eaa 100644 (file)
@@ -129,15 +129,10 @@ check_critical_timing(struct trace_array *tr,
                      unsigned long parent_ip,
                      int cpu)
 {
-       unsigned long latency, t0, t1;
        cycle_t T0, T1, delta;
        unsigned long flags;
        int pc;
 
-       /*
-        * usecs conversion is slow so we try to delay the conversion
-        * as long as possible:
-        */
        T0 = data->preempt_timestamp;
        T1 = ftrace_now(cpu);
        delta = T1-T0;
@@ -157,18 +152,15 @@ check_critical_timing(struct trace_array *tr,
 
        trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc);
 
-       latency = nsecs_to_usecs(delta);
-
        if (data->critical_sequence != max_sequence)
                goto out_unlock;
 
-       tracing_max_latency = delta;
-       t0 = nsecs_to_usecs(T0);
-       t1 = nsecs_to_usecs(T1);
-
        data->critical_end = parent_ip;
 
-       update_max_tr_single(tr, current, cpu);
+       if (likely(!is_tracing_stopped())) {
+               tracing_max_latency = delta;
+               update_max_tr_single(tr, current, cpu);
+       }
 
        max_sequence++;
 
@@ -178,7 +170,6 @@ out_unlock:
 out:
        data->critical_sequence = max_sequence;
        data->preempt_timestamp = ftrace_now(cpu);
-       tracing_reset(tr, cpu);
        trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc);
 }
 
@@ -208,7 +199,6 @@ start_critical_timing(unsigned long ip, unsigned long parent_ip)
        data->critical_sequence = max_sequence;
        data->preempt_timestamp = ftrace_now(cpu);
        data->critical_start = parent_ip ? : ip;
-       tracing_reset(tr, cpu);
 
        local_save_flags(flags);
 
@@ -379,6 +369,7 @@ static void __irqsoff_tracer_init(struct trace_array *tr)
        irqsoff_trace = tr;
        /* make sure that the tracer is visible */
        smp_wmb();
+       tracing_reset_online_cpus(tr);
        start_irqsoff_tracer(tr);
 }