Skip to contentSkip to conversation

tracing/ftrace: fix the check on nopped sites

PATCH Steven Rostedt 2 participants 3 messages Mar 16, 2009 – Mar 18, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Steven Rostedt

author Acked-by
#1 lore raw
Quoted 23 lines · Frederic Weisbecker

Impact: fix a dynamic tracing failure

Recently, the function and function graph tracers failed to use dynamic tracing after the following commit:

fa9d13cf135efbd454453a53b6299976bea245a9
(ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec)

The patch is right except a mistake on the check for the FTRACE_FL_CONVERTED flag. The code patching is aborted in case of successfully nopped sites. What we want is the opposite: ignore the callsites that haven't been nopped.

---
 kernel/trace/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +0 -0
index 90d5729..7847806 100644

kernel/trace/ftrace.c static void ftrace_replace_code(int enable) · line 543

Quoted 8 lines
kernel/trace/ftrace.c +1 -1
@@ -537,7 +537,7 @@ static void ftrace_replace_code(int enable)
 		 */
 		if (rec->flags & FTRACE_FL_FREE ||
 		    rec->flags & FTRACE_FL_FAILED ||
-		    rec->flags & FTRACE_FL_CONVERTED)
+		    !(rec->flags & FTRACE_FL_CONVERTED))
 			continue;
 
 		/* ignore updates to this record's mcount site */

Heh, I just found this bug too, and wrote a patch. But you posted before I did, so I'll let you have it ;-)

-- Steve

#2 lore raw

* From: "Steven Rostedt" <[email protected]>

Quoted 33 lines · Frederic Weisbecker
Quoted 30 lines

Impact: fix a dynamic tracing failure

Recently, the function and function graph tracers failed to use dynamic tracing after the following commit:

fa9d13cf135efbd454453a53b6299976bea245a9
(ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec)

The patch is right except a mistake on the check for the FTRACE_FL_CONVERTED flag. The code patching is aborted in case of successfully nopped sites. What we want is the opposite: ignore the callsites that haven't been nopped.

---
 kernel/trace/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +1 -1
index 90d5729..7847806 100644
@@ -537,7 +537,7 @@ static void ftrace_replace_code(int enable)
 */
 if (rec->flags & FTRACE_FL_FREE ||
     rec->flags & FTRACE_FL_FAILED ||
-     rec->flags & FTRACE_FL_CONVERTED)
+     !(rec->flags & FTRACE_FL_CONVERTED))
 continue;
 
Quoted 2 lines

kernel/trace/ftrace.c static void ftrace_replace_code(int enable) · line 543

Quoted 2 lines
kernel/trace/ftrace.c +0 -0
 /* ignore updates to this record's mcount site */

Hello,

Sorry for my fault.

B.R.
Zhaolei

Quoted 10 lines

Heh, I just found this bug too, and wrote a patch. But you posted before I did, so I'll let you have it ;-)

-- Steve

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±þG«�éÿŠ{ayºʇڙë,j­¢f£¢·hš�ï�êÿ‘êçz_è®(­éšŽŠÝ¢j"�ú¶m§ÿÿ¾«þG«�éÿ¢¸?™¨è­Ú&£ø§~�á¶iO•æ¬z·švØ^¶m§ÿÿà ÿ¶ìÿ¢¸?–I¥

#3 lore raw
In reply to a message not in the archive

Ingo,

I pulled this into my repo, and will post it shortly.

-- Steve

Quoted 34 lines · Frederic Weisbecker

Impact: fix a dynamic tracing failure

Recently, the function and function graph tracers failed to use dynamic tracing after the following commit:

fa9d13cf135efbd454453a53b6299976bea245a9
(ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec)

The patch is right except a mistake on the check for the FTRACE_FL_CONVERTED flag. The code patching is aborted in case of successfully nopped sites. What we want is the opposite: ignore the callsites that haven't been nopped.

---
 kernel/trace/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +1 -1
index 90d5729..7847806 100644
@@ -537,7 +537,7 @@ static void ftrace_replace_code(int enable)
 		 */
 		if (rec->flags & FTRACE_FL_FREE ||
 		    rec->flags & FTRACE_FL_FAILED ||
-		    rec->flags & FTRACE_FL_CONVERTED)
+		    !(rec->flags & FTRACE_FL_CONVERTED))
 			continue;
 
 		/* ignore updates to this record's mcount site */
Signature · 1 line
1.6.1