From: Ingo Molnar <mingo@elte.hu>
To: Paul Mundt <lethal@linux-sh.org>, Jason Baron <jbaron@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
linux-kernel@vger.kernel.org, laijs@cn.fujitsu.com,
rostedt@goodmis.org, peterz@infradead.org,
mathieu.desnoyers@polymtl.ca, jiayingz@google.com,
mbligh@google.com, lizf@cn.fujitsu.com
Subject: Re: [PATCH 05/12] update FTRACE_SYSCALL_MAX
Date: Mon, 24 Aug 2009 20:34:32 +0200 [thread overview]
Message-ID: <20090824183432.GD9785@elte.hu> (raw)
In-Reply-To: <20090824145011.GA20517@linux-sh.org>
* Paul Mundt <lethal@linux-sh.org> wrote:
> On Mon, Aug 24, 2009 at 10:42:28AM -0400, Jason Baron wrote:
> > On Mon, Aug 24, 2009 at 11:15:39PM +0900, Paul Mundt wrote:
> > > On Mon, Aug 24, 2009 at 10:06:29AM -0400, Jason Baron wrote:
> > > > On Mon, Aug 24, 2009 at 10:41:52PM +0900, Paul Mundt wrote:
> > > > > I hope you can clarify what the meaning of this is supposed to be
> > > > > exactly. Is this number supposed to be the last usable syscall, or is it
> > > > > supposed to be the equivalent of NR_syscalls?
> > > > >
> > > >
> > > > I am using as the equivalent of NR_syscalls.
> > > >
> > > NR_syscalls has always been the total number of system calls, not the
> > > last one.
> > >
> > > > > Presently on SH we have this as NR_syscalls - 1, while on s390 I see it
> > > > > is treated as NR_syscalls directly. s390 opencodes the NR_syscalls
> > > > > directly and so presently blows up in -next due to a missing
> > > > > FTRACE_SYSCALL_MAX definition:
> > > > >
> > > > > http://kisskb.ellerman.id.au/kisskb/buildresult/1120523/
> > > > >
> > > > > I was in the process of fixing that up when I noticed this difference.
> > > > > x86 seems to also treat this as NR_syscalls - 1, but that looks to me
> > > > > like there is an off-by-1 in arch_init_ftrace_syscalls() causing the last
> > > > > syscall to be skipped?
> > > >
> > > > I don't see how its used as 'NR_syscalls - 1' on x86,
> > > > arch_init_ftrace_syscalls() does:
> > > >
> > > > for (i = 0; i < FTRACE_SYSCALL_MAX; i++) {
> > > > meta = find_syscall_meta(psys_syscall_table[i]);
> > > > syscalls_metadata[i] = meta;
> > > > }
> > > >
> > > > So the last syscall should not be skipped.
> > > >
> > >
> > > In today's -next:
> > >
> > > #ifdef CONFIG_X86_64
> > > # define FTRACE_SYSCALL_MAX 299
> > > #else
> > > # define FTRACE_SYSCALL_MAX 337
> > > #endif
> > >
> > > unistd_32.h:
> > >
> > > #define __NR_reflinkat 337
> > >
> > > unistd_64.h:
> > >
> > > #define __NR_reflinkat 299
> > >
> > > The first syscall starts at 0, but I don't see how this last syscall is
> > > handled. If there were a __NR_syscalls 300 and 338 respectively, that
> > > would seem to do the right thing. Or am I missing something?
> >
> > No, you are right. When I changed the FTRACE_SYSCALL_MAX to 299, and
> > 337, there was no reflinkat syscall in the tree. So, it was equivalent
> > to NR_syscalls at that point in time. So that's where the confusion is.
> >
> > Clearly, all the more reason to drop FTRACE_SYSCALL_MAX and change to
> > NR_syscalls...
>
>
> If FTRACE_SYSCALL_MAX is dropped then s390 will be fixed, and I'll
> take care of the sh update. If you want to hold off on adding
> NR_syscalls back to x86, then s390 will need a #define
> FTRACE_SYSCALL_MAX __NR_syscalls in
> arch/s390/include/asm/ftrace.h. Keeping FTRACE_SYSCALL_MAX around
> seems to be asking for trouble, though (although I don't know what
> the original rationale behind adding it was).
I agree with you - we should certainly add a clean and arch-generic
way and drop the FTRACE_SYSCALL_MAX hack which really just tried to
hide the arch differences for no strong reason.
At the same time the compat syscall space should be solved too, and
a synonymous compat_NR_syscalls value introduced. (perhaps defined
to 0 on non-compat kernels)
Ingo
next prev parent reply other threads:[~2009-08-24 18:34 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-10 20:52 [PATCH 00/12] add syscall tracepoints V3 Jason Baron
2009-08-10 20:52 ` [PATCH 01/12] map syscall name to number Jason Baron
2009-08-10 20:52 ` [PATCH 02/12] call arch_init_ftrace_syscalls at boot Jason Baron
2009-08-10 20:52 ` [PATCH 03/12] add DECLARE_TRACE_WITH_CALLBACK() macro Jason Baron
2009-08-10 20:52 ` [PATCH 04/12] add syscall tracepoints Jason Baron
2009-08-10 20:52 ` [PATCH 05/12] update FTRACE_SYSCALL_MAX Jason Baron
2009-08-11 11:00 ` Frederic Weisbecker
2009-08-11 19:39 ` Matt Fleming
2009-08-24 13:41 ` Paul Mundt
2009-08-24 14:06 ` Jason Baron
2009-08-24 14:15 ` Paul Mundt
2009-08-24 14:34 ` Frederic Weisbecker
2009-08-24 14:37 ` Paul Mundt
2009-08-24 14:42 ` Jason Baron
2009-08-24 14:50 ` Paul Mundt
2009-08-24 18:34 ` Ingo Molnar [this message]
2009-08-10 20:52 ` [PATCH 06/12] trace_event - raw_init bailout Jason Baron
2009-08-10 20:52 ` [PATCH 07/12] add ftrace_event_call void * 'data' field Jason Baron
2009-08-11 10:09 ` Frederic Weisbecker
2009-08-17 22:19 ` Steven Rostedt
2009-08-17 23:09 ` Frederic Weisbecker
2009-08-18 0:06 ` Steven Rostedt
2009-08-10 20:52 ` [PATCH 08/12] add trace events for each syscall entry/exit Jason Baron
2009-08-11 10:50 ` Frederic Weisbecker
2009-08-11 11:45 ` Ingo Molnar
2009-08-11 12:01 ` Frederic Weisbecker
2009-08-25 12:50 ` Hendrik Brueckner
2009-08-25 14:15 ` Frederic Weisbecker
2009-08-25 16:02 ` Hendrik Brueckner
2009-08-25 16:20 ` Mathieu Desnoyers
2009-08-25 16:59 ` Frederic Weisbecker
2009-08-25 17:31 ` Frederic Weisbecker
2009-08-25 18:31 ` Mathieu Desnoyers
2009-08-25 19:42 ` Frederic Weisbecker
2009-08-25 19:51 ` Mathieu Desnoyers
2009-08-26 0:19 ` Frederic Weisbecker
2009-08-26 0:42 ` Mathieu Desnoyers
2009-08-26 7:28 ` Ingo Molnar
2009-08-26 17:11 ` Mathieu Desnoyers
2009-08-26 6:48 ` Peter Zijlstra
2009-08-25 22:04 ` Martin Schwidefsky
2009-08-26 7:38 ` Heiko Carstens
2009-08-26 12:32 ` Frederic Weisbecker
2009-08-26 6:21 ` Peter Zijlstra
2009-08-26 17:08 ` Mathieu Desnoyers
2009-08-26 18:41 ` Christoph Hellwig
2009-08-26 18:42 ` Christoph Hellwig
2009-08-26 19:01 ` Mathieu Desnoyers
2009-08-26 7:10 ` Peter Zijlstra
2009-08-26 17:10 ` Mathieu Desnoyers
2009-08-26 17:24 ` H. Peter Anvin
2009-08-25 17:04 ` Jason Baron
2009-08-25 18:15 ` Mathieu Desnoyers
2009-08-26 12:35 ` Frederic Weisbecker
2009-08-26 12:59 ` Heiko Carstens
2009-08-26 13:30 ` Frederic Weisbecker
2009-08-26 13:48 ` Steven Rostedt
2009-08-26 13:53 ` Frederic Weisbecker
2009-08-26 14:44 ` Steven Rostedt
2009-08-26 13:56 ` Peter Zijlstra
2009-08-26 14:41 ` Steven Rostedt
2009-08-26 14:10 ` Heiko Carstens
2009-08-26 14:27 ` Frederic Weisbecker
2009-08-26 14:43 ` Steven Rostedt
2009-08-26 16:14 ` Frederic Weisbecker
2009-08-26 14:43 ` Steven Rostedt
2009-08-26 14:41 ` Hendrik Brueckner
2009-08-28 12:28 ` [tip:tracing/core] tracing: Don't trace kernel thread syscalls tip-bot for Hendrik Brueckner
2009-08-25 21:40 ` [PATCH 08/12] add trace events for each syscall entry/exit Frederic Weisbecker
2009-08-25 22:09 ` Frederic Weisbecker
2009-08-26 7:47 ` Heiko Carstens
2009-08-28 12:27 ` [tip:tracing/core] tracing: Check invalid syscall nr while tracing syscalls tip-bot for Hendrik Brueckner
2009-08-10 20:52 ` [PATCH 09/12] add support traceopint ids Jason Baron
2009-08-11 11:28 ` Frederic Weisbecker
2009-08-10 20:53 ` [PATCH 10/12] add perf counter support Jason Baron
2009-08-11 12:12 ` Frederic Weisbecker
2009-08-11 12:17 ` Ingo Molnar
2009-08-11 12:25 ` Frederic Weisbecker
2009-08-10 20:53 ` [PATCH 11/12] add more namespace area to 'perf list' output Jason Baron
2009-08-10 20:53 ` [PATCH 12/12] convert x86_64 mmap and uname to use DEFINE_SYSCALL Jason Baron
2009-08-25 12:31 ` [PATCH 00/12] add syscall tracepoints V3 - s390 arch update Hendrik Brueckner
2009-08-25 13:52 ` Frederic Weisbecker
2009-08-25 14:39 ` Heiko Carstens
2009-08-25 19:52 ` Frederic Weisbecker
2009-08-25 15:38 ` Hendrik Brueckner
2009-08-26 16:53 ` Frederic Weisbecker
2009-08-27 7:27 ` [PATCH]: tracing: s390 arch updates for tracing syscalls Hendrik Brueckner
2009-08-28 12:27 ` [tip:tracing/core] tracing: Add syscall tracepoints - s390 arch update tip-bot for Hendrik Brueckner
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=20090824183432.GD9785@elte.hu \
--to=mingo@elte.hu \
--cc=fweisbec@gmail.com \
--cc=jbaron@redhat.com \
--cc=jiayingz@google.com \
--cc=laijs@cn.fujitsu.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mbligh@google.com \
--cc=peterz@infradead.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