From: tip-bot for Matt Fleming <matt@console-pimps.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
rostedt@goodmis.org, matt@console-pimps.org, tglx@linutronix.de
Subject: [tip:tracing/urgent] ftrace: Only update $offset when we update $ref_func
Date: Tue, 4 Aug 2009 08:10:39 GMT [thread overview]
Message-ID: <tip-bd171d5ffc5cb2ba471e8205c679ee9d12b90116@git.kernel.org> (raw)
In-Reply-To: <1248365775-25196-2-git-send-email-matt@console-pimps.org>
Commit-ID: bd171d5ffc5cb2ba471e8205c679ee9d12b90116
Gitweb: http://git.kernel.org/tip/bd171d5ffc5cb2ba471e8205c679ee9d12b90116
Author: Matt Fleming <matt@console-pimps.org>
AuthorDate: Thu, 23 Jul 2009 17:16:15 +0100
Committer: Steven Rostedt <rostedt@goodmis.org>
CommitDate: Thu, 23 Jul 2009 12:20:30 -0400
ftrace: Only update $offset when we update $ref_func
The value of $offset should be the offset of $ref_func from the
beginning of the object file. Therefore, we should set both variables
together.
This fixes a bug I was hitting on sh where $offset (which is used to
calcualte the addends for the __mcount_loc entries) was being set
multiple times and didn't correspond to $ref_func's offset in the object
file. The addends in __mcount_loc were calculated incorrectly, resulting
in ftrace dynamically modifying addresses that weren't mcount call
sites.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
LKML-Reference: <1248365775-25196-2-git-send-email-matt@console-pimps.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
scripts/recordmcount.pl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 16c5563..d29baa2 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -403,7 +403,6 @@ while (<IN>) {
# section found, now is this a start of a function?
} elsif ($read_function && /$function_regex/) {
$text_found = 1;
- $offset = hex $1;
$text = $2;
# if this is either a local function or a weak function
@@ -412,10 +411,12 @@ while (<IN>) {
if (!defined($locals{$text}) && !defined($weak{$text})) {
$ref_func = $text;
$read_function = 0;
+ $offset = hex $1;
} else {
# if we already have a function, and this is weak, skip it
if (!defined($ref_func) && !defined($weak{$text})) {
$ref_func = $text;
+ $offset = hex $1;
}
}
} elsif ($read_headers && /$mcount_section/) {
next prev parent reply other threads:[~2009-08-04 8:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-23 9:51 [PATCH -tip] ftrace: Correctly calculate the first function in the .text section Matt Fleming
2009-07-23 14:50 ` Steven Rostedt
2009-07-23 14:52 ` Steven Rostedt
2009-07-27 22:29 ` Paul Mundt
2009-07-27 23:45 ` Steven Rostedt
2009-08-02 8:16 ` Paul Mundt
2009-08-04 8:07 ` Ingo Molnar
2009-08-04 8:08 ` Paul Mundt
2009-07-23 16:16 ` [PATCH 1/2] ftrace: Fix the conditional that updates $ref_func Matt Fleming
2009-07-23 16:16 ` [PATCH 2/2] ftrace: Only update $offset when we update $ref_func Matt Fleming
2009-08-04 8:10 ` tip-bot for Matt Fleming [this message]
2009-08-04 8:10 ` [tip:tracing/urgent] ftrace: Fix the conditional that updates $ref_func tip-bot for Matt Fleming
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=tip-bd171d5ffc5cb2ba471e8205c679ee9d12b90116@git.kernel.org \
--to=matt@console-pimps.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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