From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Matt Fleming <matthew.fleming@imgtec.com>,
Steven Rostedt <srostedt@redhat.com>
Subject: [PATCH 08/10] ftrace: Align __mcount_loc sections
Date: Fri, 07 Nov 2008 22:46:13 -0500 [thread overview]
Message-ID: <20081108034750.183495492@goodmis.org> (raw)
In-Reply-To: <20081108034605.289816911@goodmis.org>
[-- Attachment #1: 0008-ftrace-Align-__mcount_loc-sections.patch --]
[-- Type: text/plain, Size: 1930 bytes --]
Impact: alignment option for recordmcount.pl script
Align the __mcount_loc sections so that architectures with strict
alignment requirements need not worry about performing unaligned
accesses.
This fixes an issue where I was seeing unaligned accesses, which are not
supported on our architecture (the results of an unaligned access are
undefined).
Signed-off-by: Matt Fleming <matthew.fleming@imgtec.com>
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
---
scripts/recordmcount.pl | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 6b9fe3e..eeac71c 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -134,6 +134,7 @@ my $section_regex; # Find the start of a section
my $function_regex; # Find the name of a function
# (return offset and func name)
my $mcount_regex; # Find the call site to mcount (return offset)
+my $alignment; # The .align value to use for $mcount_section
if ($arch eq "x86") {
if ($bits == 64) {
@@ -148,6 +149,7 @@ if ($arch eq "x86_64") {
$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$";
$type = ".quad";
+ $alignment = 8;
# force flags for this arch
$ld .= " -m elf_x86_64";
@@ -160,6 +162,7 @@ if ($arch eq "x86_64") {
$function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:";
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
$type = ".long";
+ $alignment = 4;
# force flags for this arch
$ld .= " -m elf_i386";
@@ -288,6 +291,7 @@ sub update_funcs
open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
$opened = 1;
print FILE "\t.section $mcount_section,\"a\",\@progbits\n";
+ print FILE "\t.align $alignment\n";
}
printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;
}
--
1.5.6.5
--
next prev parent reply other threads:[~2008-11-08 3:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-08 3:46 [PATCH 00/10] ftrace: various updates Steven Rostedt
2008-11-08 3:46 ` [PATCH 01/10] ftrace: fix set_ftrace_filter Steven Rostedt
2008-11-08 3:46 ` [PATCH 02/10] ftrace: fix boot trace sched startup Steven Rostedt
2008-11-08 4:12 ` Frédéric Weisbecker
2008-11-08 12:17 ` Steven Rostedt
2008-11-08 3:46 ` [PATCH 03/10] ftrace: fix sched_switch API Steven Rostedt
2008-11-08 4:20 ` Frédéric Weisbecker
2008-11-08 3:46 ` [PATCH 04/10] ftrace: irqsoff tracer incorrect reset Steven Rostedt
2008-11-08 3:46 ` [PATCH 05/10] ftrace: enable trace_printk by default Steven Rostedt
2008-11-08 3:46 ` [PATCH 06/10] ftrace: remove ctrl_update method Steven Rostedt
2008-11-08 3:46 ` [PATCH 07/10] ftrace: remove trace array ctrl Steven Rostedt
2008-11-08 3:46 ` Steven Rostedt [this message]
2008-11-08 3:55 ` [PATCH 08/10] ftrace: Align __mcount_loc sections Steven Rostedt
2008-11-08 3:46 ` [PATCH 09/10] ftrace: force pass of preemptoff selftest Steven Rostedt
2008-11-08 3:46 ` [PATCH 10/10] ftrace: display start of CPU buffer in trace output Steven Rostedt
2008-11-08 8:42 ` [PATCH 00/10] ftrace: various updates Ingo Molnar
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=20081108034750.183495492@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.fleming@imgtec.com \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=srostedt@redhat.com \
/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
all inboxes | Powered by JetHome®