aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/ftrace.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 46592feab5a6..c701476a648b 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2658,19 +2658,17 @@ static int ftrace_convert_nops(struct module *mod,
2658} 2658}
2659 2659
2660#ifdef CONFIG_MODULES 2660#ifdef CONFIG_MODULES
2661void ftrace_release(void *start, void *end) 2661void ftrace_release_mod(struct module *mod)
2662{ 2662{
2663 struct dyn_ftrace *rec; 2663 struct dyn_ftrace *rec;
2664 struct ftrace_page *pg; 2664 struct ftrace_page *pg;
2665 unsigned long s = (unsigned long)start;
2666 unsigned long e = (unsigned long)end;
2667 2665
2668 if (ftrace_disabled || !start || start == end) 2666 if (ftrace_disabled)
2669 return; 2667 return;
2670 2668
2671 mutex_lock(&ftrace_lock); 2669 mutex_lock(&ftrace_lock);
2672 do_for_each_ftrace_rec(pg, rec) { 2670 do_for_each_ftrace_rec(pg, rec) {
2673 if ((rec->ip >= s) && (rec->ip < e)) { 2671 if (within_module_core(rec->ip, mod)) {
2674 /* 2672 /*
2675 * rec->ip is changed in ftrace_free_rec() 2673 * rec->ip is changed in ftrace_free_rec()
2676 * It should not between s and e if record was freed. 2674 * It should not between s and e if record was freed.
@@ -2702,9 +2700,7 @@ static int ftrace_module_notify(struct notifier_block *self,
2702 mod->num_ftrace_callsites); 2700 mod->num_ftrace_callsites);
2703 break; 2701 break;
2704 case MODULE_STATE_GOING: 2702 case MODULE_STATE_GOING:
2705 ftrace_release(mod->ftrace_callsites, 2703 ftrace_release_mod(mod);
2706 mod->ftrace_callsites +
2707 mod->num_ftrace_callsites);
2708 break; 2704 break;
2709 } 2705 }
2710 2706