diff options
author | Steven Rostedt <srostedt@redhat.com> | 2008-12-02 23:50:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-03 02:56:23 -0500 |
commit | 14a866c567e040ccf6240d68b083dd1dbbde63e6 (patch) | |
tree | 4e8d62ecc345d44e7cd45f973ffb931070637532 /kernel | |
parent | bb4304c71c97bf727ec43cd2f195c2c237c27fd3 (diff) |
ftrace: add ftrace_graph_stop()
Impact: new ftrace_graph_stop function
While developing more features of function graph, I hit a bug that
caused the WARN_ON to trigger in the prepare_ftrace_return function.
Well, it was hard for me to find out that was happening because the
bug would not print, it would just cause a hard lockup or reboot.
The reason is that it is not safe to call printk from this function.
Looking further, I also found that it calls unregister_ftrace_graph,
which grabs a mutex and calls kstop machine. This would definitely
lock the box up if it were to trigger.
This patch adds a fast and safe ftrace_graph_stop() which will
stop the function tracer. Then it is safe to call the WARN ON.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 2e78628443e8..a44af05ae2d0 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1769,5 +1769,10 @@ void ftrace_graph_exit_task(struct task_struct *t) | |||
1769 | 1769 | ||
1770 | kfree(ret_stack); | 1770 | kfree(ret_stack); |
1771 | } | 1771 | } |
1772 | |||
1773 | void ftrace_graph_stop(void) | ||
1774 | { | ||
1775 | ftrace_stop(); | ||
1776 | } | ||
1772 | #endif | 1777 | #endif |
1773 | 1778 | ||