[PATCH] ftrace: Don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTEDrec
From: Zhaolei
Date: Fri Mar 13 2009 - 05:17:54 EST
Do __ftrace_replace_code for !FTRACE_FL_CONVERTED rec will always
fail, we should ignore this rec.
Signed-off-by: Zhao Lei <zhaolei@xxxxxxxxxxxxxx>
---
kernel/trace/ftrace.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 26c45aa..08f4a62 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -532,11 +532,12 @@ static void ftrace_replace_code(int enable)
do_for_each_ftrace_rec(pg, rec) {
/*
- * Skip over free records and records that have
- * failed.
+ * Skip over free records, records that have
+ * failed and not converted.
*/
if (rec->flags & FTRACE_FL_FREE ||
- rec->flags & FTRACE_FL_FAILED)
+ rec->flags & FTRACE_FL_FAILED ||
+ rec->flags & FTRACE_FL_CONVERTED)
continue;
/* ignore updates to this record's mcount site */
@@ -548,7 +549,7 @@ static void ftrace_replace_code(int enable)
}
failed = __ftrace_replace_code(rec, enable);
- if (failed && (rec->flags & FTRACE_FL_CONVERTED)) {
+ if (failed) {
rec->flags |= FTRACE_FL_FAILED;
if ((system_state == SYSTEM_BOOTING) ||
!core_kernel_text(rec->ip)) {
--
1.5.5.3
--
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/