From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: support syscall tracing
Date: Tue, 29 Nov 2011 21:55:22 +0000 [thread overview]
Message-ID: <20111129215522.GN9581@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <CAK8d-a+o6A+E537o3i4JdzsXei2fbvqNcCLx_U8WyEMK-vL8Fg@mail.gmail.com>
On Tue, Nov 29, 2011 at 01:12:50PM -0500, Steven Walter wrote:
> Yes, I like how the assembler counts the number of syscalls for you.
> However, every other architecture uses either a bare number or
> __NR_last_syscall+1 for defining NR_syscalls.
>
> > You're also exporting it to userspace. ?It has no business being in
> > userspace.
>
> That was unintentional, I'll fix.
>
> > Lastly, it's wrong. ?__NR_SYSCALL_BASE may be 0 or 0x90000 depending on
> > the ABI selected. ?If it's 0x90000, will tracepoint stuff work or will it
> > explode because of a stupidly large table somewhere?
>
> Right you are. Didn't consider that. Does that mean that
> syscall_get_nr() should return the offset from __NR_SYSCALL_BASE, so
> that it will be strictly less than NR_syscalls?
strace sees the 0x90000 offset today, so tracehook is going to be
compatible with our existing APIs, tracehook needs to keep seeing
that offset.
However, I suspect that's incompatible with tracehook as it stands
today - especially when we might be running a kernel with OABI compat
support enabled (which means you'll get 0x90000+ syscalls for OABI and
0+ syscalls for EABI.)
> > kernel/trace/trace_syscalls.c: ? ? ?for (i = 0; i < NR_syscalls; i++) {
> >
> > and
> >
> > kernel/trace/trace_syscalls.c:static DECLARE_BITMAP(enabled_perf_enter_syscalls, NR_syscalls);
> > kernel/trace/trace_syscalls.c:static DECLARE_BITMAP(enabled_perf_exit_syscalls,NR_syscalls);
> >
> > all point at this being very wrong.
>
> Initially I was going to assign the assembler version of NR_syscalls
> to a symbol which could be referenced from C. However, putting the C
> declaration for the variable in unistd.h made the assembler unhappy.
> Is it kosher to have C stuff in unistd.h? Since there was no prior
> example of it, I assumed not. However, perhaps I could just hide it
> from the assembler with some kind of #ifdef?
#ifndef __ASSEMBLY__
but, as I say, the number of syscalls which the kernel implements is
defined by the size of the table in calls.S, not by the list in
unistd.h. We may allocate a number and put it in unistd.h to reserve
it before we have a final implementation.
next prev parent reply other threads:[~2011-11-29 21:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-29 16:28 [RFC] ARM support for syscall tracing Steven Walter
2011-11-29 16:28 ` [PATCH 1/3] ARM: add support for the generic syscall.h interface Steven Walter
2011-11-29 16:28 ` [PATCH 2/3] ARM: add TRACEHOOK support Steven Walter
2011-11-29 17:04 ` Will Deacon
2011-11-29 17:51 ` Steven Walter
2011-11-29 16:28 ` [PATCH 3/3] ARM: support syscall tracing Steven Walter
2011-11-29 17:24 ` Will Deacon
2011-11-29 18:02 ` Steven Walter
2011-11-29 17:46 ` Russell King - ARM Linux
2011-11-29 18:12 ` Steven Walter
2011-11-29 21:55 ` Russell King - ARM Linux [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-02-22 14:44 [PATCH 0/3] ARM support for " Wade Farnsworth
2012-02-22 14:47 ` [PATCH 3/3] ARM: support " Wade Farnsworth
2012-02-24 11:05 ` Will Deacon
2012-02-24 15:48 ` Wade Farnsworth
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=20111129215522.GN9581@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).