Re: [PATCH 1/3] ftrace: prevent freeing of all failed updates

From: Abhishek Sagar
Date: Mon Jun 02 2008 - 23:05:01 EST


Steven Rostedt wrote:
> If we unload a module and reload it, will it ever get converted again?

The intent was always to filter core kernel functions to prevent their freeing.
Here's a fix which should allow re-recording of module call-sites.

---
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index ec54cb7..77c9392 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -437,7 +437,7 @@ static void ftrace_replace_code(int enable)
if (failed && (rec->flags & FTRACE_FL_CONVERTED)) {
rec->flags |= FTRACE_FL_FAILED;
if ((system_state == SYSTEM_BOOTING) ||
- !kernel_text_address(rec->ip)) {
+ !core_kernel_text(rec->ip)) {
ftrace_del_hash(rec);
ftrace_free_rec(rec);
}
@@ -658,10 +658,9 @@ static int __ftrace_update_code(void *ignore)
ftrace_update_cnt++;
} else {
if ((system_state == SYSTEM_BOOTING) ||
- !kernel_text_address(p->ip)) {
+ !core_kernel_text(p->ip)) {
ftrace_del_hash(p);
ftrace_free_rec(p);
-
}
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/