aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 1f54a94189fe..b2de8de77356 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -596,22 +596,22 @@ ftrace_code_disable(struct dyn_ftrace *rec)
596{ 596{
597 unsigned long ip; 597 unsigned long ip;
598 unsigned char *nop, *call; 598 unsigned char *nop, *call;
599 int failed; 599 int ret;
600 600
601 ip = rec->ip; 601 ip = rec->ip;
602 602
603 nop = ftrace_nop_replace(); 603 nop = ftrace_nop_replace();
604 call = ftrace_call_replace(ip, mcount_addr); 604 call = ftrace_call_replace(ip, mcount_addr);
605 605
606 failed = ftrace_modify_code(ip, call, nop); 606 ret = ftrace_modify_code(ip, call, nop);
607 if (failed) { 607 if (ret) {
608 switch (failed) { 608 switch (ret) {
609 case 1: 609 case -EFAULT:
610 WARN_ON_ONCE(1); 610 WARN_ON_ONCE(1);
611 pr_info("ftrace faulted on modifying "); 611 pr_info("ftrace faulted on modifying ");
612 print_ip_sym(ip); 612 print_ip_sym(ip);
613 break; 613 break;
614 case 2: 614 case -EINVAL:
615 WARN_ON_ONCE(1); 615 WARN_ON_ONCE(1);
616 pr_info("ftrace failed to modify "); 616 pr_info("ftrace failed to modify ");
617 print_ip_sym(ip); 617 print_ip_sym(ip);
@@ -620,6 +620,15 @@ ftrace_code_disable(struct dyn_ftrace *rec)
620 print_ip_ins(" replace: ", nop); 620 print_ip_ins(" replace: ", nop);
621 printk(KERN_CONT "\n"); 621 printk(KERN_CONT "\n");
622 break; 622 break;
623 case -EPERM:
624 WARN_ON_ONCE(1);
625 pr_info("ftrace faulted on writing ");
626 print_ip_sym(ip);
627 break;
628 default:
629 WARN_ON_ONCE(1);
630 pr_info("ftrace faulted on unknown error ");
631 print_ip_sym(ip);
623 } 632 }
624 633
625 rec->flags |= FTRACE_FL_FAILED; 634 rec->flags |= FTRACE_FL_FAILED;