aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c8
-rw-r--r--kernel/trace/trace.c15
-rw-r--r--kernel/trace/trace.h2
3 files changed, 25 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index c3e4575e7829..077d85387908 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3863,6 +3863,14 @@ void ftrace_kill(void)
3863} 3863}
3864 3864
3865/** 3865/**
3866 * Test if ftrace is dead or not.
3867 */
3868int ftrace_is_dead(void)
3869{
3870 return ftrace_disabled;
3871}
3872
3873/**
3866 * register_ftrace_function - register a function for profiling 3874 * register_ftrace_function - register a function for profiling
3867 * @ops - ops structure that holds the function for profiling. 3875 * @ops - ops structure that holds the function for profiling.
3868 * 3876 *
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 4b8df0dc9358..13f2b8472fed 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2160,6 +2160,14 @@ void trace_default_header(struct seq_file *m)
2160 } 2160 }
2161} 2161}
2162 2162
2163static void test_ftrace_alive(struct seq_file *m)
2164{
2165 if (!ftrace_is_dead())
2166 return;
2167 seq_printf(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n");
2168 seq_printf(m, "# MAY BE MISSING FUNCTION EVENTS\n");
2169}
2170
2163static int s_show(struct seq_file *m, void *v) 2171static int s_show(struct seq_file *m, void *v)
2164{ 2172{
2165 struct trace_iterator *iter = v; 2173 struct trace_iterator *iter = v;
@@ -2169,6 +2177,7 @@ static int s_show(struct seq_file *m, void *v)
2169 if (iter->tr) { 2177 if (iter->tr) {
2170 seq_printf(m, "# tracer: %s\n", iter->trace->name); 2178 seq_printf(m, "# tracer: %s\n", iter->trace->name);
2171 seq_puts(m, "#\n"); 2179 seq_puts(m, "#\n");
2180 test_ftrace_alive(m);
2172 } 2181 }
2173 if (iter->trace && iter->trace->print_header) 2182 if (iter->trace && iter->trace->print_header)
2174 iter->trace->print_header(m); 2183 iter->trace->print_header(m);
@@ -4613,6 +4622,12 @@ __ftrace_dump(bool disable_tracing, enum ftrace_dump_mode oops_dump_mode)
4613 4622
4614 tracing_off(); 4623 tracing_off();
4615 4624
4625 /* Did function tracer already get disabled? */
4626 if (ftrace_is_dead()) {
4627 printk("# WARNING: FUNCTION TRACING IS CORRUPTED\n");
4628 printk("# MAY BE MISSING FUNCTION EVENTS\n");
4629 }
4630
4616 if (disable_tracing) 4631 if (disable_tracing)
4617 ftrace_kill(); 4632 ftrace_kill();
4618 4633
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 4c7540ad5dcb..092e1f8d18dc 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -579,11 +579,13 @@ static inline int ftrace_trace_task(struct task_struct *task)
579 579
580 return test_tsk_trace_trace(task); 580 return test_tsk_trace_trace(task);
581} 581}
582extern int ftrace_is_dead(void);
582#else 583#else
583static inline int ftrace_trace_task(struct task_struct *task) 584static inline int ftrace_trace_task(struct task_struct *task)
584{ 585{
585 return 1; 586 return 1;
586} 587}
588static inline int ftrace_is_dead(void) { return 0; }
587#endif 589#endif
588 590
589/* 591/*