|
@@ -2658,19 +2658,17 @@ static int ftrace_convert_nops(struct module *mod,
|
|
}
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_MODULES
|
|
#ifdef CONFIG_MODULES
|
|
-void ftrace_release(void *start, void *end)
|
|
|
|
|
|
+void ftrace_release_mod(struct module *mod)
|
|
{
|
|
{
|
|
struct dyn_ftrace *rec;
|
|
struct dyn_ftrace *rec;
|
|
struct ftrace_page *pg;
|
|
struct ftrace_page *pg;
|
|
- unsigned long s = (unsigned long)start;
|
|
|
|
- unsigned long e = (unsigned long)end;
|
|
|
|
|
|
|
|
- if (ftrace_disabled || !start || start == end)
|
|
|
|
|
|
+ if (ftrace_disabled)
|
|
return;
|
|
return;
|
|
|
|
|
|
mutex_lock(&ftrace_lock);
|
|
mutex_lock(&ftrace_lock);
|
|
do_for_each_ftrace_rec(pg, rec) {
|
|
do_for_each_ftrace_rec(pg, rec) {
|
|
- if ((rec->ip >= s) && (rec->ip < e)) {
|
|
|
|
|
|
+ if (within_module_core(rec->ip, mod)) {
|
|
/*
|
|
/*
|
|
* rec->ip is changed in ftrace_free_rec()
|
|
* rec->ip is changed in ftrace_free_rec()
|
|
* It should not between s and e if record was freed.
|
|
* It should not between s and e if record was freed.
|
|
@@ -2702,9 +2700,7 @@ static int ftrace_module_notify(struct notifier_block *self,
|
|
mod->num_ftrace_callsites);
|
|
mod->num_ftrace_callsites);
|
|
break;
|
|
break;
|
|
case MODULE_STATE_GOING:
|
|
case MODULE_STATE_GOING:
|
|
- ftrace_release(mod->ftrace_callsites,
|
|
|
|
- mod->ftrace_callsites +
|
|
|
|
- mod->num_ftrace_callsites);
|
|
|
|
|
|
+ ftrace_release_mod(mod);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|