From: Li Hong <lihong.hi@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>, linux-kernel@vger.kernel.org
Subject: [PATCH v3 5/8] tracing: recordmcount.pl Clarify the logic on mcount section check
Date: Wed, 28 Oct 2009 13:05:23 +0800 [thread overview]
Message-ID: <20091028050523.GE30758@uhli> (raw)
In-Reply-To: <20091028045532.GA30036@uhli>
>From 7cff5ca3e0cdad6fcb4933ef290e5e2bf90e26fb Mon Sep 17 00:00:00 2001
From: Li Hong <lihong.hi@gmail.com>
Date: Tue, 27 Oct 2009 12:53:52 +0800
Subject: [PATCH] tracing: recordmcount.pl Clarify the logic on mcount section check
Move the mcount section check to the beginning of the objdump read loop.
It is clearer, because mcount section check uses headers dump part of objdump
to identify a mcount section, which goes before the section parts.
Signed-off-by: Li Hong <lihong.hi@gmail.com>
---
scripts/recordmcount.pl | 34 +++++++++++++++++++---------------
1 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 1de9826..f4117d6 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -389,9 +389,27 @@ open(IN, "$objdump -hdr $inputfile|") || die "error running $objdump";
my $text;
+
+# read headers first
my $read_headers = 1;
while (<IN>) {
+
+ if ($read_headers && /$mcount_section/) {
+ #
+ # Somehow the make process can execute this script on an
+ # object twice. If it does, we would duplicate the mcount
+ # section and it will cause the function tracer self test
+ # to fail. Check if the mcount section exists, and if it does,
+ # warn and exit.
+ #
+ print STDERR "ERROR: $mcount_section already in $inputfile\n" .
+ "\tThis may be an indication that your build is corrupted.\n" .
+ "\tDelete $inputfile and try again. If the same object file\n" .
+ "\tstill causes an issue, then disable CONFIG_DYNAMIC_FTRACE.\n";
+ exit(-1);
+ }
+
# is it a section?
if (/$section_regex/) {
$read_headers = 0;
@@ -432,21 +450,7 @@ while (<IN>) {
$offset = hex $1;
}
}
- } elsif ($read_headers && /$mcount_section/) {
- #
- # Somehow the make process can execute this script on an
- # object twice. If it does, we would duplicate the mcount
- # section and it will cause the function tracer self test
- # to fail. Check if the mcount section exists, and if it does,
- # warn and exit.
- #
- print STDERR "ERROR: $mcount_section already in $inputfile\n" .
- "\tThis may be an indication that your build is corrupted.\n" .
- "\tDelete $inputfile and try again. If the same object file\n" .
- "\tstill causes an issue, then disable CONFIG_DYNAMIC_FTRACE.\n";
- exit(-1);
- }
-
+ }
# is this a call site to mcount? If so, record it to print later
if ($text_found && /$mcount_regex/) {
$offsets[$#offsets + 1] = hex $1;
--
1.6.0.4
next prev parent reply other threads:[~2009-10-28 5:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-28 4:57 [PATCH v3 0/8] tracing: recordmcount.pl Bug fixes and code improvement Li Hong
2009-10-28 5:01 ` [PATCH v3 1/8] tracing: recordmcount.pl Amend the documentation according to the implementation Li Hong
2009-10-30 16:18 ` [tip:tracing/core] tracing: Amend documentation in recordmcount.pl to reflect implementation tip-bot for Li Hong
2009-10-28 5:02 ` [PATCH v3 2/8] tracing: recordmcount.pl Correct the check on the number of parameters Li Hong
2009-10-28 5:03 ` [PATCH v3 3/8] tracing: recordmcount.pl Support absolute path check on $inputfile Li Hong
2009-10-30 16:19 ` [tip:tracing/core] tracing: Check absolute path of input file in recordmcount.pl tip-bot for Li Hong
2009-10-28 5:04 ` [PATCH v3 4/8] tracing: recordmcount.pl Objcopy check should disable local reference correctly Li Hong
2009-10-28 20:59 ` Steven Rostedt
2009-10-30 16:19 ` [tip:tracing/core] tracing: Fix objcopy revision check in recordmcount.pl tip-bot for Li Hong
2009-10-28 5:05 ` Li Hong [this message]
2009-10-30 16:19 ` [tip:tracing/core] tracing: Move mcount section search to front of loop " tip-bot for Li Hong
2009-10-28 5:06 ` [PATCH v3 6/8] tracing: recordmcount.pl Use more friendly variables to clean up the code Li Hong
2009-10-30 16:20 ` [tip:tracing/core] tracing: Add regex for weak functions in recordmcount.pl tip-bot for Li Hong
2009-10-28 5:07 ` [PATCH v3 7/8] tracing: recordmcount.pl Combine the condition validation in update_funcs Li Hong
2009-10-30 16:20 ` [tip:tracing/core] tracing: Move conditional into update_funcs() in recordmcount.pl tip-bot for Li Hong
2009-10-28 5:07 ` [PATCH v3 8/8] tracing: recordmcount.pl Die if we use a weak function as reference Li Hong
2009-10-30 16:20 ` [tip:tracing/core] tracing: Exit with error if a weak function is used in recordmcount.pl tip-bot for Li Hong
2009-10-28 15:49 ` [PATCH v3 0/8] tracing: recordmcount.pl Bug fixes and code improvement Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091028050523.GE30758@uhli \
--to=lihong.hi@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox