From: Jason Baron <jbaron@redhat.com>
To: Ian Munsie <imunsie@au1.ibm.com>
Cc: fweisbec <fweisbec@gmail.com>, mingo <mingo@elte.hu>,
rostedt <rostedt@goodmis.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
laijs <laijs@cn.fujitsu.com>, lizf <lizf@cn.fujitsu.com>,
hpa <hpa@zytor.com>, tglx <tglx@linutronix.de>,
mhiramat <mhiramat@redhat.com>,
"heiko.carstens" <heiko.carstens@de.ibm.com>,
benh <benh@kernel.crashing.org>, davem <davem@davemloft.net>,
lethal <lethal@linux-sh.org>,
schwidefsky <schwidefsky@de.ibm.com>,
brueckner <brueckner@linux.vnet.ibm.com>,
"tony.luck" <tony.luck@intel.com>
Subject: Re: [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
Date: Mon, 24 May 2010 16:26:06 -0400 [thread overview]
Message-ID: <20100524202606.GD2720@redhat.com> (raw)
In-Reply-To: <1274684482-sup-7551@au1.ibm.com>
On Mon, May 24, 2010 at 05:05:42PM +1000, Ian Munsie wrote:
>
> Excerpts from Jason Baron's message of Wed Mar 17 04:46:42 +1100 2010:
> <snip>
> > + SYSCALL_METADATA(syscall, compat_sys_##sname, x); \
> > + asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
> > +#else
> > +#define COMPAT_SYSCALL_DEFINEx(x, sname, ...) \
>
> I think that should be:
> #define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...)
>
> To avoid breaking archs without compat syscalls.
>
> Cheers,
> -Ian
yes. good catch. I had spotted this as well. here's the complete re-spun
patch.
thanks,
-Jason
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e601985..b5f66dc 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -141,7 +141,7 @@ struct perf_event_attr;
__attribute__((__aligned__(4))) \
__attribute__((section("_ftrace_events"))) \
event_enter_##sname = { \
- .name = "sys_enter"#sname, \
+ .name = "enter_"#sname, \
.system = "syscalls", \
.event = &enter_syscall_print_##sname, \
.raw_init = init_syscall_trace, \
@@ -163,7 +163,7 @@ struct perf_event_attr;
__attribute__((__aligned__(4))) \
__attribute__((section("_ftrace_events"))) \
event_exit_##sname = { \
- .name = "sys_exit"#sname, \
+ .name = "exit_"#sname, \
.system = "syscalls", \
.event = &exit_syscall_print_##sname, \
.raw_init = init_syscall_trace, \
@@ -174,14 +174,14 @@ struct perf_event_attr;
TRACE_SYS_EXIT_PROFILE_INIT(sname) \
}
-#define SYSCALL_METADATA(sname, nb) \
+#define SYSCALL_METADATA(rname, sname, nb) \
SYSCALL_TRACE_ENTER_EVENT(sname); \
SYSCALL_TRACE_EXIT_EVENT(sname); \
static const struct syscall_metadata __used \
__attribute__((__aligned__(4))) \
__attribute__((section("__syscalls_metadata"))) \
__syscall_meta_##sname = { \
- .name = "sys"#sname, \
+ .name = #rname, \
.nb_args = nb, \
.types = types_##sname, \
.args = args_##sname, \
@@ -194,20 +194,20 @@ struct perf_event_attr;
};
#define SYSCALL_DEFINE0(sname) \
- SYSCALL_TRACE_ENTER_EVENT(_##sname); \
- SYSCALL_TRACE_EXIT_EVENT(_##sname); \
+ SYSCALL_TRACE_ENTER_EVENT(sys_##sname); \
+ SYSCALL_TRACE_EXIT_EVENT(sys_##sname); \
static const struct syscall_metadata __used \
__attribute__((__aligned__(4))) \
__attribute__((section("__syscalls_metadata"))) \
- __syscall_meta__##sname = { \
+ __syscall_meta_sys_##sname = { \
.name = "sys_"#sname, \
.nb_args = 0, \
.ftrace_enter = 0, \
.ftrace_exit = 0, \
.perf_enter = 0, \
.perf_exit = 0, \
- .enter_event = &event_enter__##sname, \
- .exit_event = &event_exit__##sname, \
+ .enter_event = &event_enter_sys_##sname, \
+ .exit_event = &event_exit_sys_##sname, \
}; \
asmlinkage long sys_##sname(void)
#else
@@ -221,6 +221,32 @@ struct perf_event_attr;
#define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
#define SYSCALL_DEFINE6(name, ...) SYSCALL_DEFINEx(6, _##name, __VA_ARGS__)
+#ifdef CONFIG_COMPAT
+
+#define ARCH_COMPAT_SYSCALL_DEFINE1(name, ...) COMPAT_SYSCALL_DEFINEx(1, sys32_##name, name, __VA_ARGS__)
+#define ARCH_COMPAT_SYSCALL_DEFINE2(name, ...) COMPAT_SYSCALL_DEFINEx(2, sys32_##name, name, __VA_ARGS__)
+#define ARCH_COMPAT_SYSCALL_DEFINE3(name, ...) COMPAT_SYSCALL_DEFINEx(3, sys32_##name, name, __VA_ARGS__)
+#define ARCH_COMPAT_SYSCALL_DEFINE4(name, ...) COMPAT_SYSCALL_DEFINEx(4, sys32_##name, name, __VA_ARGS__)
+#define ARCH_COMPAT_SYSCALL_DEFINE5(name, ...) COMPAT_SYSCALL_DEFINEx(5, sys32_##name, name, __VA_ARGS__)
+#define ARCH_COMPAT_SYSCALL_DEFINE6(name, ...) COMPAT_SYSCALL_DEFINEx(6, sys32_##name, name, __VA_ARGS__)
+
+#ifdef CONFIG_FTRACE_SYSCALLS
+#define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...) \
+ static const char *types_compat_sys_##sname[] = { \
+ __SC_STR_TDECL##x(__VA_ARGS__) \
+ }; \
+ static const char *args_compat_sys_##sname[] = { \
+ __SC_STR_ADECL##x(__VA_ARGS__) \
+ }; \
+ SYSCALL_METADATA(syscall, compat_sys_##sname, x); \
+ asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
+#else
+#define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...) \
+ asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
+#endif
+
+#endif
+
#ifdef CONFIG_PPC64
#define SYSCALL_ALIAS(alias, name) \
asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n" \
@@ -237,13 +263,13 @@ struct perf_event_attr;
#ifdef CONFIG_FTRACE_SYSCALLS
#define SYSCALL_DEFINEx(x, sname, ...) \
- static const char *types_##sname[] = { \
+ static const char *types_sys##sname[] = { \
__SC_STR_TDECL##x(__VA_ARGS__) \
}; \
- static const char *args_##sname[] = { \
+ static const char *args_sys##sname[] = { \
__SC_STR_ADECL##x(__VA_ARGS__) \
}; \
- SYSCALL_METADATA(sname, x); \
+ SYSCALL_METADATA(sys##sname, sys##sname, x); \
__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
#else
#define SYSCALL_DEFINEx(x, sname, ...) \
next prev parent reply other threads:[~2010-05-24 20:26 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
2010-03-16 17:46 ` [PATCH 01/14] x86: add NR_syscalls_compat, make ia32 syscall table visible Jason Baron
2010-03-16 17:46 ` [PATCH 02/14] x86: add arch_compat_syscall_addr() Jason Baron
2010-03-17 19:11 ` Frederic Weisbecker
2010-03-16 17:46 ` [PATCH 03/14] compat: have generic is_compat_task for !CONFIG_COMPAT Jason Baron
2010-03-16 17:46 ` [PATCH 04/14] tracing: remove syscall bitmaps in preparation for compat support Jason Baron
2010-03-16 17:46 ` [PATCH 05/14] tracing: move __start_ftrace_events and __stop_ftrace_events to header file Jason Baron
2010-03-16 17:46 ` [PATCH 06/14] tracing: add tracing support for compat syscalls Jason Baron
2010-03-20 6:12 ` Frederic Weisbecker
2010-03-22 20:21 ` Jason Baron
2010-03-27 4:40 ` Frederic Weisbecker
2010-03-16 17:46 ` [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE() Jason Baron
2010-03-18 18:29 ` [PATCH 07/14 re-post] " Jason Baron
2010-03-27 4:56 ` Frederic Weisbecker
2010-05-24 7:05 ` [PATCH 07/14] " Ian Munsie
2010-05-24 20:26 ` Jason Baron [this message]
2010-03-16 17:46 ` [PATCH 08/14] x86, compat: convert ia32 layer to use Jason Baron
2010-03-16 17:46 ` [PATCH 09/14] syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro Jason Baron
2010-03-16 17:46 ` [PATCH 10/14] compat: convert to use COMPAT_SYSCALL_DEFINE#N() Jason Baron
2010-03-16 17:47 ` [PATCH 11/14] compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros Jason Baron
2010-03-16 17:47 ` [PATCH 12/14] tags: recognize compat syscalls Jason Baron
2010-03-16 17:47 ` [PATCH 13/14] cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macro Jason Baron
2010-03-16 17:47 ` [PATCH 14/14] tracing: make a "compat_syscalls" tracing subsys Jason Baron
2010-03-18 18:22 ` [PATCH 15/14] compat_syscalls: introduce CONFIG_COMPAT_FTRACE_SYSCALLS Jason Baron
2010-03-27 5:00 ` [PATCH 00/14] tracing: add compat syscall support v3 Frederic Weisbecker
2010-05-21 9:40 ` Ian Munsie
2010-05-21 13:24 ` Jason Baron
2010-05-21 13:31 ` Frederic Weisbecker
2010-06-17 7:39 ` Ian Munsie
2010-06-17 7:46 ` Frederic Weisbecker
2010-06-17 15:39 ` Jason Baron
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=20100524202606.GD2720@redhat.com \
--to=jbaron@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=brueckner@linux.vnet.ibm.com \
--cc=davem@davemloft.net \
--cc=fweisbec@gmail.com \
--cc=heiko.carstens@de.ibm.com \
--cc=hpa@zytor.com \
--cc=imunsie@au1.ibm.com \
--cc=laijs@cn.fujitsu.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.