aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/trace/trace.c5
-rw-r--r--kernel/trace/trace.h1
-rw-r--r--kernel/trace/trace_irqsoff.c6
-rw-r--r--kernel/trace/trace_sched_wakeup.c6
4 files changed, 14 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 45c3f0352d78..ef82a7fabf3b 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -825,6 +825,11 @@ static void trace_init_cmdlines(void)
825 cmdline_idx = 0; 825 cmdline_idx = 0;
826} 826}
827 827
828int is_tracing_stopped(void)
829{
830 return trace_stop_count;
831}
832
828/** 833/**
829 * ftrace_off_permanent - disable all ftrace code permanently 834 * ftrace_off_permanent - disable all ftrace code permanently
830 * 835 *
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 28247cecd955..4ad4e1ddcb9b 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -461,6 +461,7 @@ void tracing_stop_sched_switch_record(void);
461void tracing_start_sched_switch_record(void); 461void tracing_start_sched_switch_record(void);
462int register_tracer(struct tracer *type); 462int register_tracer(struct tracer *type);
463void unregister_tracer(struct tracer *type); 463void unregister_tracer(struct tracer *type);
464int is_tracing_stopped(void);
464 465
465extern unsigned long nsecs_to_usecs(unsigned long nsecs); 466extern unsigned long nsecs_to_usecs(unsigned long nsecs);
466 467
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 06f8ea9e4b9d..3aa7eaa2114c 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -157,8 +157,10 @@ check_critical_timing(struct trace_array *tr,
157 157
158 data->critical_end = parent_ip; 158 data->critical_end = parent_ip;
159 159
160 tracing_max_latency = delta; 160 if (likely(!is_tracing_stopped())) {
161 update_max_tr_single(tr, current, cpu); 161 tracing_max_latency = delta;
162 update_max_tr_single(tr, current, cpu);
163 }
162 164
163 max_sequence++; 165 max_sequence++;
164 166
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index 6e1529bc6172..26185d727676 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -162,8 +162,10 @@ probe_wakeup_sched_switch(struct rq *rq, struct task_struct *prev,
162 if (!report_latency(delta)) 162 if (!report_latency(delta))
163 goto out_unlock; 163 goto out_unlock;
164 164
165 tracing_max_latency = delta; 165 if (likely(!is_tracing_stopped())) {
166 update_max_tr(wakeup_trace, wakeup_task, wakeup_cpu); 166 tracing_max_latency = delta;
167 update_max_tr(wakeup_trace, wakeup_task, wakeup_cpu);
168 }
167 169
168out_unlock: 170out_unlock:
169 __wakeup_reset(wakeup_trace); 171 __wakeup_reset(wakeup_trace);