public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Sam Ravnborg <sam@ravnborg.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	zeev.tarantov@gmail.com, sam@ravnborg.org, fweisbec@gmail.com,
	rostedt@goodmis.org, tglx@linutronix.de
Subject: [tip:perf/urgent] tracing: Properly align linker defined symbols
Date: Thu, 22 Jul 2010 11:51:39 GMT	[thread overview]
Message-ID: <tip-07fca0e57fca925032526349f4370f97ed580cc9@git.kernel.org> (raw)
In-Reply-To: <20100710063459.GA14596@merkur.ravnborg.org>

Commit-ID:  07fca0e57fca925032526349f4370f97ed580cc9
Gitweb:     http://git.kernel.org/tip/07fca0e57fca925032526349f4370f97ed580cc9
Author:     Sam Ravnborg <sam@ravnborg.org>
AuthorDate: Sat, 10 Jul 2010 08:35:00 +0200
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Tue, 20 Jul 2010 19:02:52 -0400

tracing: Properly align linker defined symbols

We define a number of symbols in the linker scipt like this:

    __start_syscalls_metadata = .;
    *(__syscalls_metadata)

But we do not know the alignment of "." when we assign
the __start_syscalls_metadata symbol.
gcc started to uses bigger alignment for structs (32 bytes),
so we saw situations where the linker due to alignment
constraints increased the value of "." after the symbol assignment.

This resulted in boot fails.

Fix this by forcing a 32 byte alignment of "." before the
assignment.

This patch introduces the forced alignment for
ftrace_events and syscalls_metadata.
It may be required in more places.

Reported-by: Zeev Tarantov <zeev.tarantov@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
LKML-Reference: <20100710063459.GA14596@merkur.ravnborg.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/asm-generic/vmlinux.lds.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 48c5299..4b5902a 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -63,6 +63,12 @@
 /* Align . to a 8 byte boundary equals to maximum function alignment. */
 #define ALIGN_FUNCTION()  . = ALIGN(8)
 
+/*
+ * Align to a 32 byte boundary equal to the
+ * alignment gcc 4.5 uses for a struct
+ */
+#define STRUCT_ALIGN() . = ALIGN(32)
+
 /* The actual configuration determine if the init/exit sections
  * are handled as text/data or they can be discarded (which
  * often happens at runtime)
@@ -166,7 +172,11 @@
 	LIKELY_PROFILE()		       				\
 	BRANCH_PROFILE()						\
 	TRACE_PRINTKS()							\
+									\
+	STRUCT_ALIGN();							\
 	FTRACE_EVENTS()							\
+									\
+	STRUCT_ALIGN();							\
 	TRACE_SYSCALLS()
 
 /*

  parent reply	other threads:[~2010-07-22 11:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-09 19:56 [PATCH][GIT PULL][for 2.6.35] tracing: Add alignment to syscall metadata declarations Steven Rostedt
2010-07-09 20:18 ` Ingo Molnar
2010-07-09 20:33 ` Sam Ravnborg
2010-07-09 20:46   ` Steven Rostedt
2010-07-09 20:53     ` Sam Ravnborg
2010-07-09 21:05       ` Steven Rostedt
2010-07-09 21:56         ` Sam Ravnborg
2010-07-09 22:02         ` Sam Ravnborg
2010-07-09 21:25   ` Linus Torvalds
2010-07-10  0:22     ` Steven Rostedt
2010-07-10  6:35       ` [PATCH] tracing: properly align linker defined symbols Sam Ravnborg
2010-07-10 10:18         ` Zeev Tarantov
2010-07-10 11:34           ` Steven Rostedt
2010-07-10 13:06             ` Zeev Tarantov
2010-07-10 13:48             ` Sam Ravnborg
2010-07-10 15:36               ` Zeev Tarantov
2010-07-10 13:49           ` Sam Ravnborg
2010-07-10 22:25         ` Linus Torvalds
2010-07-10 22:27           ` Linus Torvalds
2010-07-11  6:07           ` Sam Ravnborg
2010-07-15 15:05         ` Sam Ravnborg
2010-07-15 15:15           ` Steven Rostedt
2010-07-15 18:31             ` Sam Ravnborg
2010-07-22 11:51         ` tip-bot for Sam Ravnborg [this message]
2010-07-10  9:45       ` [PATCH][GIT PULL][for 2.6.35] tracing: Add alignment to syscall metadata declarations Zeev Tarantov

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-07fca0e57fca925032526349f4370f97ed580cc9@git.kernel.org \
    --to=sam@ravnborg.org \
    --cc=fweisbec@gmail.com \
    --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 \
    --cc=zeev.tarantov@gmail.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