aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorAbhishek Sagar <sagar.abhishek@gmail.com>2008-06-26 13:21:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-03 08:46:24 -0400
commit98a05ed4bd7774f533ab185fe0bf2fdc58292d7c (patch)
treeaabf40b440c0931e92b8ff0aaf32052a6b4796de /kernel/trace
parent760378e1497841246ea7e42abad617d8a8ac0bcc (diff)
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')
-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 85e841335417..0f271c45cd02 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -502,8 +502,12 @@ static void ftrace_replace_code(int enable)
502 continue; 502 continue;
503 503
504 /* ignore updates to this record's mcount site */ 504 /* ignore updates to this record's mcount site */
505 if (get_kprobe((void *)rec->ip)) 505 if (get_kprobe((void *)rec->ip)) {
506 freeze_record(rec);
506 continue; 507 continue;
508 } else {
509 unfreeze_record(rec);
510 }
507 511
508 failed = __ftrace_replace_code(rec, old, new, enable); 512 failed = __ftrace_replace_code(rec, old, new, enable);
509 if (failed && (rec->flags & FTRACE_FL_CONVERTED)) { 513 if (failed && (rec->flags & FTRACE_FL_CONVERTED)) {
@@ -740,7 +744,10 @@ static int __ftrace_update_code(void *ignore)
740 ftrace_del_hash(p); 744 ftrace_del_hash(p);
741 INIT_HLIST_NODE(&p->node); 745 INIT_HLIST_NODE(&p->node);
742 hlist_add_head(&p->node, &temp_list); 746 hlist_add_head(&p->node, &temp_list);
747 freeze_record(p);
743 continue; 748 continue;
749 } else {
750 unfreeze_record(p);
744 } 751 }
745 752
746 /* convert record (i.e, patch mcount-call with NOP) */ 753 /* convert record (i.e, patch mcount-call with NOP) */