summaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorAbhishek Sagar <sagar.abhishek@gmail.com>2008-06-26 22:51:51 +0530
committerIngo Molnar <mingo@elte.hu>2008-07-03 14:46:24 +0200
commit98a05ed4bd7774f533ab185fe0bf2fdc58292d7c (patch)
treeaabf40b440c0931e92b8ff0aaf32052a6b4796de /kernel/trace/ftrace.c
parent760378e1497841246ea7e42abad617d8a8ac0bcc (diff)
downloadop-kernel-dev-98a05ed4bd7774f533ab185fe0bf2fdc58292d7c.zip
op-kernel-dev-98a05ed4bd7774f533ab185fe0bf2fdc58292d7c.tar.gz
ftrace: prevent ftrace modifications while being kprobe'd, v2
add two missing chunks for ftrace+kprobe. Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 85e8413..0f271c4 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -502,8 +502,12 @@ static void ftrace_replace_code(int enable)
continue;
/* ignore updates to this record's mcount site */
- if (get_kprobe((void *)rec->ip))
+ if (get_kprobe((void *)rec->ip)) {
+ freeze_record(rec);
continue;
+ } else {
+ unfreeze_record(rec);
+ }
failed = __ftrace_replace_code(rec, old, new, enable);
if (failed && (rec->flags & FTRACE_FL_CONVERTED)) {
@@ -740,7 +744,10 @@ static int __ftrace_update_code(void *ignore)
ftrace_del_hash(p);
INIT_HLIST_NODE(&p->node);
hlist_add_head(&p->node, &temp_list);
+ freeze_record(p);
continue;
+ } else {
+ unfreeze_record(p);
}
/* convert record (i.e, patch mcount-call with NOP) */
OpenPOWER on IntegriCloud