summaryrefslogtreecommitdiff
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2015-11-25 12:50:47 -0500
committerSteven Rostedt <rostedt@goodmis.org>2015-11-25 15:24:15 -0500
commit02a392a0439ffdc62b4d8f17bd18d68736b166a9 (patch)
treec14877e8b5d5e48487f4bbbd09afed301d8bd21b /include/linux/ftrace.h
parent4e4a4d75700da67c1209c151d5f11a309c3b8367 (diff)
ftrace: Add new type to distinguish what kind of ftrace_bug()
The ftrace function hook utility has several internal checks to make sure that whatever it modifies is exactly what it expects to be modifying. This is essential as modifying running code can be extremely dangerous to the system. When an anomaly is detected, ftrace_bug() is called which sends a splat to the console and disables function tracing. There's some extra information that is printed to help diagnose the issue. One thing that is missing though is output of what ftrace was doing at the time of the crash. Was it updating a call site or perhaps converting a call site to a nop? A new global enum variable is created to state what ftrace was doing at the time of the anomaly, and this is reported in ftrace_bug(). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r--include/linux/ftrace.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index eae6548efbf0..870c8eea38cd 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -296,6 +296,15 @@ int ftrace_arch_code_modify_post_process(void);
struct dyn_ftrace;
+enum ftrace_bug_type {
+ FTRACE_BUG_UNKNOWN,
+ FTRACE_BUG_INIT,
+ FTRACE_BUG_NOP,
+ FTRACE_BUG_CALL,
+ FTRACE_BUG_UPDATE,
+};
+extern enum ftrace_bug_type ftrace_bug_type;
+
void ftrace_bug(int err, struct dyn_ftrace *rec);
struct seq_file;