* [PATCH] ftrace: Don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec
@ 2009-03-13 9:16 Zhaolei
2009-03-13 9:33 ` [tip:tracing/ftrace] ftrace: don't " Zhaolei
0 siblings, 1 reply; 3+ messages in thread
From: Zhaolei @ 2009-03-13 9:16 UTC (permalink / raw)
To: Steven Rostedt ;, Ingo Molnar; +Cc: linux-kernel
Do __ftrace_replace_code for !FTRACE_FL_CONVERTED rec will always
fail, we should ignore this rec.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [tip:tracing/ftrace] ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec
2009-03-13 9:16 [PATCH] ftrace: Don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec Zhaolei
@ 2009-03-13 9:33 ` Zhaolei
2009-03-13 12:02 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: Zhaolei @ 2009-03-13 9:33 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, zhaolei, tglx, mingo
Commit-ID: fa9d13cf135efbd454453a53b6299976bea245a9
Gitweb: http://git.kernel.org/tip/fa9d13cf135efbd454453a53b6299976bea245a9
Author: Zhaolei <zhaolei@cn.fujitsu.com>
AuthorDate: Fri, 13 Mar 2009 17:16:34 +0800
Commit: Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 13 Mar 2009 10:25:06 +0100
ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec
Do __ftrace_replace_code for !FTRACE_FL_CONVERTED rec will always
fail, we should ignore this rec.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Cc: "Steven Rostedt ;" <rostedt@goodmis.org>
LKML-Reference: <49BA2472.4060206@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
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)) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [tip:tracing/ftrace] ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec
2009-03-13 9:33 ` [tip:tracing/ftrace] ftrace: don't " Zhaolei
@ 2009-03-13 12:02 ` Steven Rostedt
0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2009-03-13 12:02 UTC (permalink / raw)
To: mingo, hpa, linux-kernel, zhaolei, tglx, mingo; +Cc: linux-tip-commits
On Fri, 13 Mar 2009, Zhaolei wrote:
> Commit-ID: fa9d13cf135efbd454453a53b6299976bea245a9
> Gitweb: http://git.kernel.org/tip/fa9d13cf135efbd454453a53b6299976bea245a9
> Author: Zhaolei <zhaolei@cn.fujitsu.com>
> AuthorDate: Fri, 13 Mar 2009 17:16:34 +0800
> Commit: Ingo Molnar <mingo@elte.hu>
> CommitDate: Fri, 13 Mar 2009 10:25:06 +0100
>
> ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec
>
> Do __ftrace_replace_code for !FTRACE_FL_CONVERTED rec will always
> fail, we should ignore this rec.
Is this also by code review or did you actually hit it?
This code is very sensitive, and changing must be done extremely
carefully.
>
> Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
> Cc: "Steven Rostedt ;" <rostedt@goodmis.org>
> LKML-Reference: <49BA2472.4060206@cn.fujitsu.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
>
>
> ---
> 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) {
Note, if we get here when a record does not have FL_CONVERTED set, then
something already went wrong and tracing should have been disabled.
The check here was simply to prevent mulitple errors from being printed
out.
I'm just getting ready to travel, but maybe I'll look into this code a bit
more, and see what reasons we can get here without that CONVERTED flag
being set. Perhaps the best thing to do is exit the loop?
-- Steve
> rec->flags |= FTRACE_FL_FAILED;
> if ((system_state == SYSTEM_BOOTING) ||
> !core_kernel_text(rec->ip)) {
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-13 12:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-13 9:16 [PATCH] ftrace: Don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec Zhaolei
2009-03-13 9:33 ` [tip:tracing/ftrace] ftrace: don't " Zhaolei
2009-03-13 12:02 ` Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox