From: Sam Ravnborg <sam@ravnborg.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Zeev Tarantov <zeev.tarantov@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>,
Frederic Weisbecker <fweisbec@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH] tracing: properly align linker defined symbols
Date: Sat, 10 Jul 2010 15:48:49 +0200 [thread overview]
Message-ID: <20100710134849.GA15800@merkur.ravnborg.org> (raw)
In-Reply-To: <1278761646.1537.182.camel@gandalf.stny.rr.com>
On Sat, Jul 10, 2010 at 07:34:05AM -0400, Steven Rostedt wrote:
> On Sat, 2010-07-10 at 13:18 +0300, Zeev Tarantov wrote:
> > On Sat, Jul 10, 2010 at 09:35, Sam Ravnborg <sam@ravnborg.org> wrote:
>
> > > +/*
> > > + * Align to a 32 byte boundary equal to the
> > > + * alignment gcc 4.5 uses for a struct
> > > + */
> > > +#define STRUCT_ALIGN() . = ALIGN(32)
> > > +
>
> What I'm nervous about is when gcc 4.8 decides to up the alignment to
> 64.
>
> Maybe we should have both patches, just to be safe.
Another approach could be to just stop playing games with alignment
and use the fact that __stop_syscalls_metadata point to next byte
after last entry.
Something like the below untested patch.
But to fix the current regression I prefer the simpler
patch that just fixup the aligment.
Sam
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 34e3580..50e9606 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -79,15 +79,19 @@ static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
stop = (struct syscall_metadata *)__stop_syscalls_metadata;
kallsyms_lookup(syscall, NULL, NULL, NULL, str);
- for ( ; start < stop; start++) {
+ /*
+ * start may point a few bytes before first entry
+ * stop points at first byte after last entry
+ */
+ for (stop--; stop >= start; stop--) {
/*
* Only compare after the "sys" prefix. Archs that use
* syscall wrappers may have syscalls symbols aliases prefixed
* with "SyS" instead of "sys", leading to an unwanted
* mismatch.
*/
- if (start->name && !strcmp(start->name + 3, str + 3))
- return start;
+ if (stop->name && !strcmp(stop->name + 3, str + 3))
+ return stop;
}
return NULL;
}
next prev parent reply other threads:[~2010-07-10 13:48 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 [this message]
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:perf/urgent] tracing: Properly " tip-bot for Sam Ravnborg
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=20100710134849.GA15800@merkur.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjw@sisk.pl \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.org \
--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
all inboxes | Powered by JetHome®