diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 3724756e41ca..37ba67e33265 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1078,14 +1078,9 @@ static void ftrace_replace_code(int enable) | |||
1078 | failed = __ftrace_replace_code(rec, enable); | 1078 | failed = __ftrace_replace_code(rec, enable); |
1079 | if (failed) { | 1079 | if (failed) { |
1080 | rec->flags |= FTRACE_FL_FAILED; | 1080 | rec->flags |= FTRACE_FL_FAILED; |
1081 | if ((system_state == SYSTEM_BOOTING) || | 1081 | ftrace_bug(failed, rec->ip); |
1082 | !core_kernel_text(rec->ip)) { | 1082 | /* Stop processing */ |
1083 | ftrace_free_rec(rec); | 1083 | return; |
1084 | } else { | ||
1085 | ftrace_bug(failed, rec->ip); | ||
1086 | /* Stop processing */ | ||
1087 | return; | ||
1088 | } | ||
1089 | } | 1084 | } |
1090 | } while_for_each_ftrace_rec(); | 1085 | } while_for_each_ftrace_rec(); |
1091 | } | 1086 | } |
@@ -2662,19 +2657,17 @@ static int ftrace_convert_nops(struct module *mod, | |||
2662 | } | 2657 | } |
2663 | 2658 | ||
2664 | #ifdef CONFIG_MODULES | 2659 | #ifdef CONFIG_MODULES |
2665 | void ftrace_release(void *start, void *end) | 2660 | void ftrace_release_mod(struct module *mod) |
2666 | { | 2661 | { |
2667 | struct dyn_ftrace *rec; | 2662 | struct dyn_ftrace *rec; |
2668 | struct ftrace_page *pg; | 2663 | struct ftrace_page *pg; |
2669 | unsigned long s = (unsigned long)start; | ||
2670 | unsigned long e = (unsigned long)end; | ||
2671 | 2664 | ||
2672 | if (ftrace_disabled || !start || start == end) | 2665 | if (ftrace_disabled) |
2673 | return; | 2666 | return; |
2674 | 2667 | ||
2675 | mutex_lock(&ftrace_lock); | 2668 | mutex_lock(&ftrace_lock); |
2676 | do_for_each_ftrace_rec(pg, rec) { | 2669 | do_for_each_ftrace_rec(pg, rec) { |
2677 | if ((rec->ip >= s) && (rec->ip < e)) { | 2670 | if (within_module_core(rec->ip, mod)) { |
2678 | /* | 2671 | /* |
2679 | * rec->ip is changed in ftrace_free_rec() | 2672 | * rec->ip is changed in ftrace_free_rec() |
2680 | * It should not between s and e if record was freed. | 2673 | * It should not between s and e if record was freed. |
@@ -2706,9 +2699,7 @@ static int ftrace_module_notify(struct notifier_block *self, | |||
2706 | mod->num_ftrace_callsites); | 2699 | mod->num_ftrace_callsites); |
2707 | break; | 2700 | break; |
2708 | case MODULE_STATE_GOING: | 2701 | case MODULE_STATE_GOING: |
2709 | ftrace_release(mod->ftrace_callsites, | 2702 | ftrace_release_mod(mod); |
2710 | mod->ftrace_callsites + | ||
2711 | mod->num_ftrace_callsites); | ||
2712 | break; | 2703 | break; |
2713 | } | 2704 | } |
2714 | 2705 | ||