aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2014-07-24 11:26:11 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-07-24 11:26:11 -0400
commitdc6f03f26f570104a2bb03f9d1deb588026d7c75 (patch)
treed2834b5e90000dee36132694395e0911e6c3f16e /kernel/trace/ftrace.c
parent2a0343baa4cc0d4e618898f8bdae8136bbb6e1b2 (diff)
ftrace: Add warning if tramp hash does not match nr_trampolines
After adding all the records to the tramp_hash, add a check that makes sure that the number of records added matches the number of records expected to match and do a WARN_ON and disable ftrace if they do not match. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 6ef1989c2b2e..979bd8cb4349 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2226,6 +2226,9 @@ static int ftrace_save_ops_tramp_hash(struct ftrace_ops *ops)
2226 } 2226 }
2227 } while_for_each_ftrace_rec(); 2227 } while_for_each_ftrace_rec();
2228 2228
2229 /* The number of recs in the hash must match nr_trampolines */
2230 FTRACE_WARN_ON(ops->tramp_hash->count != ops->nr_trampolines);
2231
2229 return 0; 2232 return 0;
2230} 2233}
2231 2234