diff options
author | jolsa@redhat.com <jolsa@redhat.com> | 2009-10-07 13:00:35 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-10-07 15:52:09 -0400 |
commit | e7247a15ff3bbdab0a8b402dffa1171e5c05a8e0 (patch) | |
tree | 139c26b2abd8ea5dd55ee6a4d43622bb24a0ee6a /kernel/trace | |
parent | 829b876dfc94ea8be3a47e200d06f1f217bb104f (diff) |
tracing: correct module boundaries for ftrace_release
When the module is about the unload we release its call records.
The ftrace_release function was given wrong values representing
the module core boundaries, thus not releasing its call records.
Plus making ftrace_release function module specific.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <1254934835-363-3-git-send-email-jolsa@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 12 |
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 |
2661 | void ftrace_release(void *start, void *end) | 2661 | void 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 | ||