aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) */