aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 2074e5b7766b..d6973dfadb36 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -599,7 +599,7 @@ function_profile_call(unsigned long ip, unsigned long parent_ip)
599 local_irq_save(flags); 599 local_irq_save(flags);
600 600
601 stat = &__get_cpu_var(ftrace_profile_stats); 601 stat = &__get_cpu_var(ftrace_profile_stats);
602 if (!stat->hash) 602 if (!stat->hash || !ftrace_profile_enabled)
603 goto out; 603 goto out;
604 604
605 rec = ftrace_find_profiled_func(stat, ip); 605 rec = ftrace_find_profiled_func(stat, ip);
@@ -630,7 +630,7 @@ static void profile_graph_return(struct ftrace_graph_ret *trace)
630 630
631 local_irq_save(flags); 631 local_irq_save(flags);
632 stat = &__get_cpu_var(ftrace_profile_stats); 632 stat = &__get_cpu_var(ftrace_profile_stats);
633 if (!stat->hash) 633 if (!stat->hash || !ftrace_profile_enabled)
634 goto out; 634 goto out;
635 635
636 calltime = trace->rettime - trace->calltime; 636 calltime = trace->rettime - trace->calltime;
@@ -724,6 +724,10 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf,
724 ftrace_profile_enabled = 1; 724 ftrace_profile_enabled = 1;
725 } else { 725 } else {
726 ftrace_profile_enabled = 0; 726 ftrace_profile_enabled = 0;
727 /*
728 * unregister_ftrace_profiler calls stop_machine
729 * so this acts like an synchronize_sched.
730 */
727 unregister_ftrace_profiler(); 731 unregister_ftrace_profiler();
728 } 732 }
729 } 733 }