Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269079
b: refs/heads/master
c: e0a413f
h: refs/heads/master
i:
  269077: 4519564
  269075: 7a9d2ab
  269071: 4d93091
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Oct 11, 2011
1 parent 4564490 commit c8fedb6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e36de1de4a5f95b7cb3e5c37d10e6bbb91833ef0
refs/heads/master: e0a413f619ef8bc366dafc6f8221674993b8d85f
8 changes: 8 additions & 0 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3862,6 +3862,14 @@ void ftrace_kill(void)
clear_ftrace_function();
}

/**
* Test if ftrace is dead or not.
*/
int ftrace_is_dead(void)
{
return ftrace_disabled;
}

/**
* register_ftrace_function - register a function for profiling
* @ops - ops structure that holds the function for profiling.
Expand Down
15 changes: 15 additions & 0 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2160,6 +2160,14 @@ void trace_default_header(struct seq_file *m)
}
}

static void test_ftrace_alive(struct seq_file *m)
{
if (!ftrace_is_dead())
return;
seq_printf(m, "# WARNING: FUNCTION TRACING IS CORRUPTED\n");
seq_printf(m, "# MAY BE MISSING FUNCTION EVENTS\n");
}

static int s_show(struct seq_file *m, void *v)
{
struct trace_iterator *iter = v;
Expand All @@ -2169,6 +2177,7 @@ static int s_show(struct seq_file *m, void *v)
if (iter->tr) {
seq_printf(m, "# tracer: %s\n", iter->trace->name);
seq_puts(m, "#\n");
test_ftrace_alive(m);
}
if (iter->trace && iter->trace->print_header)
iter->trace->print_header(m);
Expand Down Expand Up @@ -4613,6 +4622,12 @@ __ftrace_dump(bool disable_tracing, enum ftrace_dump_mode oops_dump_mode)

tracing_off();

/* Did function tracer already get disabled? */
if (ftrace_is_dead()) {
printk("# WARNING: FUNCTION TRACING IS CORRUPTED\n");
printk("# MAY BE MISSING FUNCTION EVENTS\n");
}

if (disable_tracing)
ftrace_kill();

Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,13 @@ static inline int ftrace_trace_task(struct task_struct *task)

return test_tsk_trace_trace(task);
}
extern int ftrace_is_dead(void);
#else
static inline int ftrace_trace_task(struct task_struct *task)
{
return 1;
}
static inline int ftrace_is_dead(void) { return 0; }
#endif

/*
Expand Down

0 comments on commit c8fedb6

Please sign in to comment.