linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] tracing: add compat syscall support v3
@ 2010-03-16 17:46 Jason Baron
  2010-03-16 17:46 ` [PATCH 01/14] x86: add NR_syscalls_compat, make ia32 syscall table visible Jason Baron
                   ` (16 more replies)
  0 siblings, 17 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Hi,

Re-post to add infrastructure for compat syscall event tracing support. This
patch series also adds x86_64 arch specific support as an example consumer
of the new infrastructure.

Arches can request compat syscall tracing by setting: 
__HAVE_ARCH_FTRACE_COMPAT_SYSCALLS, if CONFIG_COMPAT and CONFIG_FTRACE_SYSCALLS
are set. Arches then need to implement the following interfaces:

1) int is_compat_task(void);
  - most arches seem to have this already
2) unsigned long arch_compat_syscall_addr(int nr);
  - returns a pointer to the compat syscall entry corresponding to syscall 'nr'
3) int NR_syscalls_compat;
  - number of entries in the compat syscall table.

thanks,

-Jason

Changes in v3:

 - create a separate "compat_syscalls" event subsystem
 - ARCH_COMPAT_SYSCALL_DEFINE#N() tacks "sys32" to start of syscall name
 - COMPAT_SYSCALL_DEFINE#N() tacks "compat_sys" to start of syscall name
 - both above macros create perf events as: [enter|exit]_compat_sys_blah
 - non-compat syscall naming changes to: [enter|exit]_sys_blah
 - removes any unreferenced compat syscalls from debugfs

Heiko Carstens (1):
  compat: have generic is_compat_task for !CONFIG_COMPAT

Jason Baron (13):
  x86: add NR_syscalls_compat, make ia32 syscall table visible
  x86: add arch_compat_syscall_addr()
  tracing: remove syscall bitmaps in preparation for compat support
  tracing: move __start_ftrace_events and __stop_ftrace_events to
    header file
  tracing: add tracing support for compat syscalls
  syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
  x86, compat: convert ia32 layer to use
  syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro
  compat: convert to use COMPAT_SYSCALL_DEFINE#N()
  compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros
  tags: recognize compat syscalls
  cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macro
  tracing: make a "compat_syscalls" tracing subsys

 arch/s390/include/asm/compat.h  |    7 --
 arch/s390/kernel/ptrace.c       |    2 +-
 arch/s390/kernel/setup.c        |    2 +-
 arch/s390/mm/mmap.c             |    2 +-
 arch/x86/ia32/ia32entry.S       |    3 +
 arch/x86/ia32/sys_ia32.c        |  106 ++++++++++++++--------------
 arch/x86/include/asm/compat.h   |    2 +
 arch/x86/include/asm/syscall.h  |    5 ++
 arch/x86/kernel/ftrace.c        |    8 ++
 drivers/s390/block/dasd_eckd.c  |    2 +-
 drivers/s390/block/dasd_ioctl.c |    1 +
 drivers/s390/char/fs3270.c      |    1 +
 drivers/s390/char/vmcp.c        |    1 +
 drivers/s390/cio/chsc_sch.c     |    1 +
 drivers/s390/scsi/zfcp_cfdc.c   |    1 +
 fs/compat.c                     |  147 +++++++++++++++++++--------------------
 include/linux/compat.h          |    9 +++
 include/linux/ftrace_event.h    |    3 +
 include/linux/syscalls.h        |   91 +++++++++++++++++-------
 include/trace/syscall.h         |    8 ++
 kernel/compat.c                 |  106 ++++++++++++++---------------
 kernel/trace/trace.h            |    2 +
 kernel/trace/trace_events.c     |    3 -
 kernel/trace/trace_syscalls.c   |  124 +++++++++++++++++++++++++--------
 scripts/tags.sh                 |    8 ++-
 25 files changed, 392 insertions(+), 253 deletions(-)


^ permalink raw reply	[flat|nested] 31+ messages in thread

* [PATCH 01/14] x86: add NR_syscalls_compat, make ia32 syscall table visible
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-16 17:46 ` [PATCH 02/14] x86: add arch_compat_syscall_addr() Jason Baron
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Add 'NR_syscalls_compat' global for x86. Also, make 'ia32_sys_call_table' into a
global.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 arch/x86/ia32/ia32entry.S     |    3 +++
 arch/x86/include/asm/compat.h |    2 ++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 53147ad..acc6fbf 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -503,6 +503,7 @@ END(ia32_ptregs_common)
 
 	.section .rodata,"a"
 	.align 8
+.globl ia32_sys_call_table
 ia32_sys_call_table:
 	.quad sys_restart_syscall
 	.quad sys_exit
@@ -843,3 +844,5 @@ ia32_sys_call_table:
 	.quad sys_perf_event_open
 	.quad compat_sys_recvmmsg
 ia32_syscall_end:
+.globl NR_syscalls_compat
+NR_syscalls_compat: .int ((ia32_syscall_end - ia32_sys_call_table)/8)
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index 9a9c7bd..b5b78e6 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -215,4 +215,6 @@ static inline int is_compat_task(void)
 	return current_thread_info()->status & TS_COMPAT;
 }
 
+extern int NR_syscalls_compat;
+
 #endif /* _ASM_X86_COMPAT_H */
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 02/14] x86: add arch_compat_syscall_addr()
  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 ` 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
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Add arch_compat_syscall_addr(int nr) for x86_64. This is in preparation for adding
compat syscall support to the event tracer.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 arch/x86/include/asm/syscall.h |    5 +++++
 arch/x86/kernel/ftrace.c       |    8 ++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index c4a348f..4e462cc 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -16,7 +16,12 @@
 #include <linux/sched.h>
 #include <linux/err.h>
 
+#if defined(CONFIG_COMPAT) && defined(CONFIG_FTRACE_SYSCALLS)
+ #define __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+#endif
+
 extern const unsigned long sys_call_table[];
+extern const unsigned long *ia32_sys_call_table;
 
 /*
  * Only the low 32 bits of orig_ax are meaningful, so we return int.
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index cd37469..4b36a0b 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -26,6 +26,7 @@
 #include <asm/ftrace.h>
 #include <asm/nops.h>
 #include <asm/nmi.h>
+#include <asm/syscall.h>
 
 
 #ifdef CONFIG_DYNAMIC_FTRACE
@@ -510,3 +511,10 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
 	}
 }
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
+
+#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+unsigned long __init arch_compat_syscall_addr(int nr)
+{
+	return (unsigned long)(&ia32_sys_call_table)[nr];
+}
+#endif
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 03/14] compat: have generic is_compat_task for !CONFIG_COMPAT
  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-16 17:46 ` Jason Baron
  2010-03-16 17:46 ` [PATCH 04/14] tracing: remove syscall bitmaps in preparation for compat support Jason Baron
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

From: Heiko Carstens <heiko.carstens@de.ibm.com>

add generic is_compat_task()

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---
 arch/s390/include/asm/compat.h  |    7 -------
 arch/s390/kernel/ptrace.c       |    2 +-
 arch/s390/kernel/setup.c        |    2 +-
 arch/s390/mm/mmap.c             |    2 +-
 drivers/s390/block/dasd_eckd.c  |    2 +-
 drivers/s390/block/dasd_ioctl.c |    1 +
 drivers/s390/char/fs3270.c      |    1 +
 drivers/s390/char/vmcp.c        |    1 +
 drivers/s390/cio/chsc_sch.c     |    1 +
 drivers/s390/scsi/zfcp_cfdc.c   |    1 +
 include/linux/compat.h          |    7 +++++++
 11 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 01a0802..442795c 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -171,13 +171,6 @@ static inline int is_compat_task(void)
 	return test_thread_flag(TIF_31BIT);
 }
 
-#else
-
-static inline int is_compat_task(void)
-{
-	return 0;
-}
-
 #endif
 
 static inline void __user *compat_alloc_user_space(long len)
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 7cf4642..f69079f 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -36,8 +36,8 @@
 #include <linux/regset.h>
 #include <linux/tracehook.h>
 #include <linux/seccomp.h>
+#include <linux/compat.h>
 #include <trace/syscall.h>
-#include <asm/compat.h>
 #include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/pgtable.h>
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 8d8957b..b30d9ff 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -43,7 +43,7 @@
 #include <linux/reboot.h>
 #include <linux/topology.h>
 #include <linux/ftrace.h>
-
+#include <linux/compat.h>
 #include <asm/ipl.h>
 #include <asm/uaccess.h>
 #include <asm/system.h>
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index 869efba..b7669c5 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -27,8 +27,8 @@
 #include <linux/personality.h>
 #include <linux/mm.h>
 #include <linux/module.h>
+#include <linux/compat.h>
 #include <asm/pgalloc.h>
-#include <asm/compat.h>
 
 /*
  * Top of mmap area (just below the process stack).
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 1cca21a..9b9b444 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -14,6 +14,7 @@
 
 #include <linux/stddef.h>
 #include <linux/kernel.h>
+#include <linux/compat.h>
 #include <linux/slab.h>
 #include <linux/hdreg.h>	/* HDIO_GETGEO			    */
 #include <linux/bio.h>
@@ -23,7 +24,6 @@
 #include <asm/debug.h>
 #include <asm/idals.h>
 #include <asm/ebcdic.h>
-#include <asm/compat.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <asm/cio.h>
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 7039d9c..407726a 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/blkpg.h>
 #include <linux/smp_lock.h>
+#include <linux/compat.h>
 #include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/cmb.h>
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 31c59b0..83a353a 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -14,6 +14,7 @@
 #include <linux/list.h>
 #include <linux/types.h>
 #include <linux/smp_lock.h>
+#include <linux/compat.h>
 
 #include <asm/compat.h>
 #include <asm/ccwdev.h>
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 921dcda..c29e3ad 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -19,6 +19,7 @@
 #include <linux/kernel.h>
 #include <linux/miscdevice.h>
 #include <linux/module.h>
+#include <linux/compat.h>
 #include <asm/compat.h>
 #include <asm/cpcmd.h>
 #include <asm/debug.h>
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index c84ac94..93536eb 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -8,6 +8,7 @@
  */
 
 #include <linux/device.h>
+#include <linux/compat.h>
 #include <linux/module.h>
 #include <linux/uaccess.h>
 #include <linux/miscdevice.h>
diff --git a/drivers/s390/scsi/zfcp_cfdc.c b/drivers/s390/scsi/zfcp_cfdc.c
index 0eb6eef..274140f 100644
--- a/drivers/s390/scsi/zfcp_cfdc.c
+++ b/drivers/s390/scsi/zfcp_cfdc.c
@@ -12,6 +12,7 @@
 
 #include <linux/types.h>
 #include <linux/miscdevice.h>
+#include <linux/compat.h>
 #include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include "zfcp_def.h"
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ef68119..2fca741 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -353,5 +353,12 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
 asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
 				  int flags, int mode);
 
+#else /* CONFIG_COMPAT */
+
+static inline int is_compat_task(void)
+{
+	return 0;
+}
+
 #endif /* CONFIG_COMPAT */
 #endif /* _LINUX_COMPAT_H */
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 04/14] tracing: remove syscall bitmaps in preparation for compat support
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (2 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 03/14] compat: have generic is_compat_task for !CONFIG_COMPAT Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-16 17:46 ` [PATCH 05/14] tracing: move __start_ftrace_events and __stop_ftrace_events to header file Jason Baron
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

In preparation for compat syscall tracing support, let's store the enabled
syscalls, with the struct syscall_metadata itself. That way we don't duplicate
enabled information when the compat table points to an entry in the regular
syscall table. Also, allows us to remove the bitmap data structures completely.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/syscalls.h      |    8 +++++++
 include/trace/syscall.h       |    4 +++
 kernel/trace/trace_syscalls.c |   42 +++++++++++++++++++---------------------
 3 files changed, 32 insertions(+), 22 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 8126f23..e601985 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -185,6 +185,10 @@ struct perf_event_attr;
 		.nb_args 	= nb,				\
 		.types		= types_##sname,		\
 		.args		= args_##sname,			\
+		.ftrace_enter	= 0,				\
+		.ftrace_exit	= 0,				\
+		.perf_enter	= 0,				\
+		.perf_exit	= 0,				\
 		.enter_event	= &event_enter_##sname,		\
 		.exit_event	= &event_exit_##sname,		\
 	};
@@ -198,6 +202,10 @@ struct perf_event_attr;
 	  __syscall_meta__##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,		\
 	};							\
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 0387100..8f5ac38 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -25,6 +25,10 @@ struct syscall_metadata {
 	int		nb_args;
 	const char	**types;
 	const char	**args;
+	char		ftrace_enter;
+	char		ftrace_exit;
+	char		perf_enter;
+	char		perf_exit;
 
 	struct ftrace_event_call *enter_event;
 	struct ftrace_event_call *exit_event;
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index cba47d7..9cb814b 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -11,8 +11,6 @@
 static DEFINE_MUTEX(syscall_trace_lock);
 static int sys_refcount_enter;
 static int sys_refcount_exit;
-static DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls);
-static DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls);
 
 extern unsigned long __start_syscalls_metadata[];
 extern unsigned long __stop_syscalls_metadata[];
@@ -254,13 +252,14 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id)
 	syscall_nr = syscall_get_nr(current, regs);
 	if (syscall_nr < 0)
 		return;
-	if (!test_bit(syscall_nr, enabled_enter_syscalls))
-		return;
 
 	sys_data = syscall_nr_to_meta(syscall_nr);
 	if (!sys_data)
 		return;
 
+	if (!sys_data->ftrace_enter)
+		return;
+
 	size = sizeof(*entry) + sizeof(unsigned long) * sys_data->nb_args;
 
 	event = trace_current_buffer_lock_reserve(&buffer,
@@ -288,13 +287,14 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
 	syscall_nr = syscall_get_nr(current, regs);
 	if (syscall_nr < 0)
 		return;
-	if (!test_bit(syscall_nr, enabled_exit_syscalls))
-		return;
 
 	sys_data = syscall_nr_to_meta(syscall_nr);
 	if (!sys_data)
 		return;
 
+	if (!sys_data->ftrace_exit)
+		return;
+
 	event = trace_current_buffer_lock_reserve(&buffer,
 			sys_data->exit_event->id, sizeof(*entry), 0, 0);
 	if (!event)
@@ -321,7 +321,7 @@ int reg_event_syscall_enter(struct ftrace_event_call *call)
 	if (!sys_refcount_enter)
 		ret = register_trace_sys_enter(ftrace_syscall_enter);
 	if (!ret) {
-		set_bit(num, enabled_enter_syscalls);
+		((struct syscall_metadata *)call->data)->ftrace_enter = 1;
 		sys_refcount_enter++;
 	}
 	mutex_unlock(&syscall_trace_lock);
@@ -337,7 +337,7 @@ void unreg_event_syscall_enter(struct ftrace_event_call *call)
 		return;
 	mutex_lock(&syscall_trace_lock);
 	sys_refcount_enter--;
-	clear_bit(num, enabled_enter_syscalls);
+	((struct syscall_metadata *)call->data)->ftrace_enter = 0;
 	if (!sys_refcount_enter)
 		unregister_trace_sys_enter(ftrace_syscall_enter);
 	mutex_unlock(&syscall_trace_lock);
@@ -355,7 +355,7 @@ int reg_event_syscall_exit(struct ftrace_event_call *call)
 	if (!sys_refcount_exit)
 		ret = register_trace_sys_exit(ftrace_syscall_exit);
 	if (!ret) {
-		set_bit(num, enabled_exit_syscalls);
+		((struct syscall_metadata *)call->data)->ftrace_exit = 1;
 		sys_refcount_exit++;
 	}
 	mutex_unlock(&syscall_trace_lock);
@@ -371,7 +371,7 @@ void unreg_event_syscall_exit(struct ftrace_event_call *call)
 		return;
 	mutex_lock(&syscall_trace_lock);
 	sys_refcount_exit--;
-	clear_bit(num, enabled_exit_syscalls);
+	((struct syscall_metadata *)call->data)->ftrace_exit = 0;
 	if (!sys_refcount_exit)
 		unregister_trace_sys_exit(ftrace_syscall_exit);
 	mutex_unlock(&syscall_trace_lock);
@@ -428,8 +428,6 @@ core_initcall(init_ftrace_syscalls);
 
 #ifdef CONFIG_PERF_EVENTS
 
-static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls);
-static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls);
 static int sys_prof_refcount_enter;
 static int sys_prof_refcount_exit;
 
@@ -443,13 +441,13 @@ static void prof_syscall_enter(struct pt_regs *regs, long id)
 	int size;
 
 	syscall_nr = syscall_get_nr(current, regs);
-	if (!test_bit(syscall_nr, enabled_prof_enter_syscalls))
-		return;
-
 	sys_data = syscall_nr_to_meta(syscall_nr);
 	if (!sys_data)
 		return;
 
+	if (!sys_data->perf_enter)
+		return;
+
 	/* get the size after alignment with the u32 buffer size field */
 	size = sizeof(unsigned long) * sys_data->nb_args + sizeof(*rec);
 	size = ALIGN(size + sizeof(u32), sizeof(u64));
@@ -484,7 +482,7 @@ int prof_sysenter_enable(struct ftrace_event_call *call)
 		pr_info("event trace: Could not activate"
 				"syscall entry trace point");
 	} else {
-		set_bit(num, enabled_prof_enter_syscalls);
+		((struct syscall_metadata *)call->data)->perf_enter = 1;
 		sys_prof_refcount_enter++;
 	}
 	mutex_unlock(&syscall_trace_lock);
@@ -499,7 +497,7 @@ void prof_sysenter_disable(struct ftrace_event_call *call)
 
 	mutex_lock(&syscall_trace_lock);
 	sys_prof_refcount_enter--;
-	clear_bit(num, enabled_prof_enter_syscalls);
+	((struct syscall_metadata *)call->data)->perf_enter = 0;
 	if (!sys_prof_refcount_enter)
 		unregister_trace_sys_enter(prof_syscall_enter);
 	mutex_unlock(&syscall_trace_lock);
@@ -515,13 +513,13 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
 	int size;
 
 	syscall_nr = syscall_get_nr(current, regs);
-	if (!test_bit(syscall_nr, enabled_prof_exit_syscalls))
-		return;
-
 	sys_data = syscall_nr_to_meta(syscall_nr);
 	if (!sys_data)
 		return;
 
+	if (!sys_data->perf_exit)
+		return;
+
 	/* We can probably do that at build time */
 	size = ALIGN(sizeof(*rec) + sizeof(u32), sizeof(u64));
 	size -= sizeof(u32);
@@ -559,7 +557,7 @@ int prof_sysexit_enable(struct ftrace_event_call *call)
 		pr_info("event trace: Could not activate"
 				"syscall exit trace point");
 	} else {
-		set_bit(num, enabled_prof_exit_syscalls);
+		((struct syscall_metadata *)call->data)->perf_exit = 1;
 		sys_prof_refcount_exit++;
 	}
 	mutex_unlock(&syscall_trace_lock);
@@ -574,7 +572,7 @@ void prof_sysexit_disable(struct ftrace_event_call *call)
 
 	mutex_lock(&syscall_trace_lock);
 	sys_prof_refcount_exit--;
-	clear_bit(num, enabled_prof_exit_syscalls);
+	((struct syscall_metadata *)call->data)->perf_exit = 0;
 	if (!sys_prof_refcount_exit)
 		unregister_trace_sys_exit(prof_syscall_exit);
 	mutex_unlock(&syscall_trace_lock);
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 05/14] tracing: move __start_ftrace_events and __stop_ftrace_events to header file
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (3 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 04/14] tracing: remove syscall bitmaps in preparation for compat support Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-16 17:46 ` [PATCH 06/14] tracing: add tracing support for compat syscalls Jason Baron
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

trace_syscalls.c uses __start_ftrace_events and __stop_ftrace_events in order
to prune compat syscall ftrace events that are not referenced by the compat
syscall table. So move the 'extern' definitions to a common header file.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/ftrace_event.h |    3 +++
 kernel/trace/trace_events.c  |    3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 6b7c444..fb6ede1 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -136,6 +136,9 @@ struct ftrace_event_call {
 	void			(*profile_disable)(struct ftrace_event_call *);
 };
 
+extern struct ftrace_event_call __start_ftrace_events[];
+extern struct ftrace_event_call __stop_ftrace_events[];
+
 #define FTRACE_MAX_PROFILE_SIZE	2048
 
 #define MAX_FILTER_PRED		32
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 3f972ad..36d9787 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1222,9 +1222,6 @@ static struct notifier_block trace_module_nb = {
 	.priority = 0,
 };
 
-extern struct ftrace_event_call __start_ftrace_events[];
-extern struct ftrace_event_call __stop_ftrace_events[];
-
 static char bootup_event_buf[COMMAND_LINE_SIZE] __initdata;
 
 static __init int setup_trace_event(char *str)
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 06/14] tracing: add tracing support for compat syscalls
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (4 preceding siblings ...)
  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 ` Jason Baron
  2010-03-20  6:12   ` Frederic Weisbecker
  2010-03-16 17:46 ` [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE() Jason Baron
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Add core support to event tracing for compat syscalls. The basic idea is that we
check if we have a compat task via 'is_compat_task()'. If so, we lookup in the
new compat_syscalls_metadata table, the corresponding struct syscall_metadata, to
check syscall arguments and whether or not we are enabled.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/compat.h        |    2 +
 include/trace/syscall.h       |    4 ++
 kernel/trace/trace.h          |    2 +
 kernel/trace/trace_syscalls.c |   86 +++++++++++++++++++++++++++++++++++++----
 4 files changed, 86 insertions(+), 8 deletions(-)

diff --git a/include/linux/compat.h b/include/linux/compat.h
index 2fca741..5f2600f 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -355,6 +355,8 @@ asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
 
 #else /* CONFIG_COMPAT */
 
+#define NR_syscalls_compat 0
+
 static inline int is_compat_task(void)
 {
 	return 0;
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 8f5ac38..1cc1d1e 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -22,6 +22,7 @@
 struct syscall_metadata {
 	const char	*name;
 	int		syscall_nr;
+	int		compat_syscall_nr;
 	int		nb_args;
 	const char	**types;
 	const char	**args;
@@ -36,6 +37,9 @@ struct syscall_metadata {
 
 #ifdef CONFIG_FTRACE_SYSCALLS
 extern unsigned long arch_syscall_addr(int nr);
+#ifdef CONFIG_COMPAT
+extern unsigned long arch_compat_syscall_addr(int nr);
+#endif
 extern int init_syscall_trace(struct ftrace_event_call *call);
 
 extern int syscall_enter_define_fields(struct ftrace_event_call *call);
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index fd05bca..2992ee1 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -94,12 +94,14 @@ extern struct tracer boot_tracer;
 struct syscall_trace_enter {
 	struct trace_entry	ent;
 	int			nr;
+	int			compat;
 	unsigned long		args[];
 };
 
 struct syscall_trace_exit {
 	struct trace_entry	ent;
 	int			nr;
+	int			compat;
 	long			ret;
 };
 
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 9cb814b..3f88b8e 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -3,6 +3,7 @@
 #include <linux/kernel.h>
 #include <linux/ftrace.h>
 #include <linux/perf_event.h>
+#include <linux/compat.h>
 #include <asm/syscall.h>
 
 #include "trace_output.h"
@@ -16,6 +17,7 @@ extern unsigned long __start_syscalls_metadata[];
 extern unsigned long __stop_syscalls_metadata[];
 
 static struct syscall_metadata **syscalls_metadata;
+static struct syscall_metadata **compat_syscalls_metadata;
 
 static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
 {
@@ -41,8 +43,14 @@ static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
 	return NULL;
 }
 
-static struct syscall_metadata *syscall_nr_to_meta(int nr)
+static struct syscall_metadata *syscall_nr_to_meta(int nr, int compat)
 {
+	if (compat) {
+		if (!compat_syscalls_metadata || nr >= NR_syscalls_compat ||
+									nr < 0)
+			return NULL;
+		return compat_syscalls_metadata[nr];
+	}
 	if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
 		return NULL;
 
@@ -60,7 +68,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags)
 
 	trace = (typeof(trace))ent;
 	syscall = trace->nr;
-	entry = syscall_nr_to_meta(syscall);
+	entry = syscall_nr_to_meta(syscall, trace->compat);
 
 	if (!entry)
 		goto end;
@@ -113,7 +121,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags)
 
 	trace = (typeof(trace))ent;
 	syscall = trace->nr;
-	entry = syscall_nr_to_meta(syscall);
+	entry = syscall_nr_to_meta(syscall, trace->compat);
 
 	if (!entry) {
 		trace_seq_printf(s, "\n");
@@ -248,12 +256,16 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id)
 	struct ring_buffer *buffer;
 	int size;
 	int syscall_nr;
+	int compat = 0;
 
 	syscall_nr = syscall_get_nr(current, regs);
 	if (syscall_nr < 0)
 		return;
 
-	sys_data = syscall_nr_to_meta(syscall_nr);
+	if (is_compat_task())
+		compat = 1;
+
+	sys_data = syscall_nr_to_meta(syscall_nr, compat);
 	if (!sys_data)
 		return;
 
@@ -269,6 +281,7 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id)
 
 	entry = ring_buffer_event_data(event);
 	entry->nr = syscall_nr;
+	entry->compat = compat;
 	syscall_get_arguments(current, regs, 0, sys_data->nb_args, entry->args);
 
 	if (!filter_current_check_discard(buffer, sys_data->enter_event,
@@ -283,12 +296,16 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
 	struct ring_buffer_event *event;
 	struct ring_buffer *buffer;
 	int syscall_nr;
+	int compat = 0;
 
 	syscall_nr = syscall_get_nr(current, regs);
 	if (syscall_nr < 0)
 		return;
 
-	sys_data = syscall_nr_to_meta(syscall_nr);
+	if (is_compat_task())
+		compat = 1;
+
+	sys_data = syscall_nr_to_meta(syscall_nr, compat);
 	if (!sys_data)
 		return;
 
@@ -302,6 +319,7 @@ void ftrace_syscall_exit(struct pt_regs *regs, long ret)
 
 	entry = ring_buffer_event_data(event);
 	entry->nr = syscall_nr;
+	entry->compat = compat;
 	entry->ret = syscall_get_return_value(current, regs);
 
 	if (!filter_current_check_discard(buffer, sys_data->exit_event,
@@ -421,7 +439,49 @@ int __init init_ftrace_syscalls(void)
 		meta->syscall_nr = i;
 		syscalls_metadata[i] = meta;
 	}
-
+#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+	if (NR_syscalls_compat) {
+		int match;
+		struct ftrace_event_call *ftrace_event;
+
+		compat_syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
+						NR_syscalls_compat, GFP_KERNEL);
+		if (!compat_syscalls_metadata) {
+			WARN_ON(1);
+			kfree(syscalls_metadata);
+			return -ENOMEM;
+		}
+		for (i = 0; i < NR_syscalls_compat; i++) {
+			addr = arch_compat_syscall_addr(i);
+			meta = find_syscall_meta(addr);
+			if (!meta)
+				continue;
+
+			meta->compat_syscall_nr = i;
+			compat_syscalls_metadata[i] = meta;
+		}
+		/* now check if any compat_syscalls are not referenced */
+		for (ftrace_event = __start_ftrace_events;
+			(unsigned long)ftrace_event <
+			(unsigned long)__stop_ftrace_events; ftrace_event++) {
+
+			match = 0;
+			if (!ftrace_event->name)
+				continue;
+			if (strcmp(ftrace_event->system, "compat_syscalls"))
+				continue;
+			for (i = 0; i < NR_syscalls_compat; i++) {
+				if (ftrace_event->data ==
+						compat_syscalls_metadata[i]) {
+					match = 1;
+					break;
+				}
+			}
+			if (!match)
+				ftrace_event->name = NULL;
+		}
+	}
+#endif
 	return 0;
 }
 core_initcall(init_ftrace_syscalls);
@@ -439,9 +499,13 @@ static void prof_syscall_enter(struct pt_regs *regs, long id)
 	int syscall_nr;
 	int rctx;
 	int size;
+	int compat = 0;
 
 	syscall_nr = syscall_get_nr(current, regs);
-	sys_data = syscall_nr_to_meta(syscall_nr);
+	if (is_compat_task())
+		compat = 1;
+
+	sys_data = syscall_nr_to_meta(syscall_nr, compat);
 	if (!sys_data)
 		return;
 
@@ -463,6 +527,7 @@ static void prof_syscall_enter(struct pt_regs *regs, long id)
 		return;
 
 	rec->nr = syscall_nr;
+	rec->compat = compat;
 	syscall_get_arguments(current, regs, 0, sys_data->nb_args,
 			       (unsigned long *)&rec->args);
 	ftrace_perf_buf_submit(rec, size, rctx, 0, 1, flags);
@@ -511,9 +576,13 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
 	int syscall_nr;
 	int rctx;
 	int size;
+	int compat = 0;
 
 	syscall_nr = syscall_get_nr(current, regs);
-	sys_data = syscall_nr_to_meta(syscall_nr);
+	if (is_compat_task())
+		compat = 1;
+
+	sys_data = syscall_nr_to_meta(syscall_nr, compat);
 	if (!sys_data)
 		return;
 
@@ -538,6 +607,7 @@ static void prof_syscall_exit(struct pt_regs *regs, long ret)
 		return;
 
 	rec->nr = syscall_nr;
+	rec->compat = compat;
 	rec->ret = syscall_get_return_value(current, regs);
 
 	ftrace_perf_buf_submit(rec, size, rctx, 0, 1, flags);
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (5 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 06/14] tracing: add tracing support for compat syscalls Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-18 18:29   ` [PATCH 07/14 re-post] " Jason Baron
  2010-05-24  7:05   ` [PATCH 07/14] " Ian Munsie
  2010-03-16 17:46 ` [PATCH 08/14] x86, compat: convert ia32 layer to use Jason Baron
                   ` (9 subsequent siblings)
  16 siblings, 2 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Add ARCH_COMPAT_SYSCALL_DEFINE#N() macro which prepends "sys32_" to
arch specific compat syscall names. Identifies the 'compat' syscalls.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/syscalls.h |   50 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index e601985..14ecfcc 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, 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, ...)				\
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 08/14] x86, compat: convert ia32 layer to use
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (6 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE() Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-16 17:46 ` [PATCH 09/14] syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro Jason Baron
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Make use of the new ARCH_COMPAT_SYSCALL_DEFINE#N() macros to tie the compat
syscalls into the event tracer.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 arch/x86/ia32/sys_ia32.c |  106 +++++++++++++++++++++++-----------------------
 1 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 422572c..70b9ee1 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -50,15 +50,15 @@
 #define AA(__x)		((unsigned long)(__x))
 
 
-asmlinkage long sys32_truncate64(char __user *filename,
-				 unsigned long offset_low,
-				 unsigned long offset_high)
+ARCH_COMPAT_SYSCALL_DEFINE3(truncate64, char __user *, filename,
+				 unsigned long, offset_low,
+				 unsigned long, offset_high)
 {
        return sys_truncate(filename, ((loff_t) offset_high << 32) | offset_low);
 }
 
-asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long offset_low,
-				  unsigned long offset_high)
+ARCH_COMPAT_SYSCALL_DEFINE3(ftruncate64, unsigned int, fd, unsigned long, offset_low,
+				  unsigned long, offset_high)
 {
        return sys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low);
 }
@@ -95,8 +95,8 @@ static int cp_stat64(struct stat64 __user *ubuf, struct kstat *stat)
 	return 0;
 }
 
-asmlinkage long sys32_stat64(char __user *filename,
-			     struct stat64 __user *statbuf)
+ARCH_COMPAT_SYSCALL_DEFINE2(stat64, char __user *, filename,
+			     struct stat64 __user *, statbuf)
 {
 	struct kstat stat;
 	int ret = vfs_stat(filename, &stat);
@@ -106,8 +106,8 @@ asmlinkage long sys32_stat64(char __user *filename,
 	return ret;
 }
 
-asmlinkage long sys32_lstat64(char __user *filename,
-			      struct stat64 __user *statbuf)
+ARCH_COMPAT_SYSCALL_DEFINE2(lstat64, char __user *, filename,
+			      struct stat64 __user *, statbuf)
 {
 	struct kstat stat;
 	int ret = vfs_lstat(filename, &stat);
@@ -116,7 +116,7 @@ asmlinkage long sys32_lstat64(char __user *filename,
 	return ret;
 }
 
-asmlinkage long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
+ARCH_COMPAT_SYSCALL_DEFINE2(fstat64, unsigned int, fd, struct stat64 __user *, statbuf)
 {
 	struct kstat stat;
 	int ret = vfs_fstat(fd, &stat);
@@ -125,8 +125,8 @@ asmlinkage long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf)
 	return ret;
 }
 
-asmlinkage long sys32_fstatat(unsigned int dfd, char __user *filename,
-			      struct stat64 __user *statbuf, int flag)
+ARCH_COMPAT_SYSCALL_DEFINE4(fstatat, unsigned int, dfd, char __user *, filename,
+			      struct stat64 __user *, statbuf, int, flag)
 {
 	struct kstat stat;
 	int error;
@@ -152,7 +152,7 @@ struct mmap_arg_struct {
 	unsigned int offset;
 };
 
-asmlinkage long sys32_mmap(struct mmap_arg_struct __user *arg)
+ARCH_COMPAT_SYSCALL_DEFINE1(mmap, struct mmap_arg_struct __user *, arg)
 {
 	struct mmap_arg_struct a;
 
@@ -166,15 +166,15 @@ asmlinkage long sys32_mmap(struct mmap_arg_struct __user *arg)
 			       a.offset>>PAGE_SHIFT);
 }
 
-asmlinkage long sys32_mprotect(unsigned long start, size_t len,
-			       unsigned long prot)
+ARCH_COMPAT_SYSCALL_DEFINE3(mprotect, unsigned long, start, size_t, len,
+			       unsigned long, prot)
 {
 	return sys_mprotect(start, len, prot);
 }
 
-asmlinkage long sys32_rt_sigaction(int sig, struct sigaction32 __user *act,
-				   struct sigaction32 __user *oact,
-				   unsigned int sigsetsize)
+ARCH_COMPAT_SYSCALL_DEFINE4(rt_sigaction, int, sig, struct sigaction32 __user *, act,
+				   struct sigaction32 __user *, oact,
+				   unsigned int, sigsetsize)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -248,8 +248,8 @@ asmlinkage long sys32_rt_sigaction(int sig, struct sigaction32 __user *act,
 	return ret;
 }
 
-asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
-				struct old_sigaction32 __user *oact)
+ARCH_COMPAT_SYSCALL_DEFINE3(sigaction, int, sig, struct old_sigaction32 __user *, act,
+				struct old_sigaction32 __user *, oact)
 {
 	struct k_sigaction new_ka, old_ka;
 	int ret;
@@ -287,9 +287,9 @@ asmlinkage long sys32_sigaction(int sig, struct old_sigaction32 __user *act,
 	return ret;
 }
 
-asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
-				     compat_sigset_t __user *oset,
-				     unsigned int sigsetsize)
+ARCH_COMPAT_SYSCALL_DEFINE4(rt_sigprocmask, int, how, compat_sigset_t __user *, set,
+				     compat_sigset_t __user *, oset,
+				     unsigned int, sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -327,7 +327,7 @@ asmlinkage long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set,
 	return 0;
 }
 
-asmlinkage long sys32_alarm(unsigned int seconds)
+ARCH_COMPAT_SYSCALL_DEFINE1(alarm, unsigned int, seconds)
 {
 	return alarm_setitimer(seconds);
 }
@@ -340,7 +340,7 @@ struct sel_arg_struct {
 	unsigned int tvp;
 };
 
-asmlinkage long sys32_old_select(struct sel_arg_struct __user *arg)
+ARCH_COMPAT_SYSCALL_DEFINE1(old_select, struct sel_arg_struct __user *, arg)
 {
 	struct sel_arg_struct a;
 
@@ -350,21 +350,21 @@ asmlinkage long sys32_old_select(struct sel_arg_struct __user *arg)
 				 compat_ptr(a.exp), compat_ptr(a.tvp));
 }
 
-asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr,
-			      int options)
+ARCH_COMPAT_SYSCALL_DEFINE3(waitpid, compat_pid_t, pid, unsigned int *, stat_addr,
+			      int, options)
 {
 	return compat_sys_wait4(pid, stat_addr, options, NULL);
 }
 
 /* 32-bit timeval and related flotsam.  */
 
-asmlinkage long sys32_sysfs(int option, u32 arg1, u32 arg2)
+ARCH_COMPAT_SYSCALL_DEFINE3(sysfs, int, option, u32, arg1, u32, arg2)
 {
 	return sys_sysfs(option, arg1, arg2);
 }
 
-asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
-				    struct compat_timespec __user *interval)
+ARCH_COMPAT_SYSCALL_DEFINE2(sched_rr_get_interval, compat_pid_t, pid,
+				    struct compat_timespec __user *, interval)
 {
 	struct timespec t;
 	int ret;
@@ -378,8 +378,8 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t pid,
 	return ret;
 }
 
-asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
-				    compat_size_t sigsetsize)
+ARCH_COMPAT_SYSCALL_DEFINE2(rt_sigpending, compat_sigset_t __user *, set,
+				    compat_size_t, sigsetsize)
 {
 	sigset_t s;
 	compat_sigset_t s32;
@@ -402,8 +402,8 @@ asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *set,
 	return ret;
 }
 
-asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
-				      compat_siginfo_t __user *uinfo)
+ARCH_COMPAT_SYSCALL_DEFINE3(rt_sigqueueinfo, int, pid, int, sig,
+				      compat_siginfo_t __user *, uinfo)
 {
 	siginfo_t info;
 	int ret;
@@ -418,22 +418,22 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
 }
 
 /* warning: next two assume little endian */
-asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
-			    u32 poslo, u32 poshi)
+ARCH_COMPAT_SYSCALL_DEFINE5(pread, unsigned int, fd, char __user *, ubuf, u32, count,
+			    u32, poslo, u32, poshi)
 {
 	return sys_pread64(fd, ubuf, count,
 			 ((loff_t)AA(poshi) << 32) | AA(poslo));
 }
 
-asmlinkage long sys32_pwrite(unsigned int fd, char __user *ubuf, u32 count,
-			     u32 poslo, u32 poshi)
+ARCH_COMPAT_SYSCALL_DEFINE5(pwrite, unsigned int, fd, char __user *, ubuf, u32, count,
+			     u32, poslo, u32, poshi)
 {
 	return sys_pwrite64(fd, ubuf, count,
 			  ((loff_t)AA(poshi) << 32) | AA(poslo));
 }
 
 
-asmlinkage long sys32_personality(unsigned long personality)
+ARCH_COMPAT_SYSCALL_DEFINE1(personality, unsigned long, personality)
 {
 	int ret;
 
@@ -446,8 +446,8 @@ asmlinkage long sys32_personality(unsigned long personality)
 	return ret;
 }
 
-asmlinkage long sys32_sendfile(int out_fd, int in_fd,
-			       compat_off_t __user *offset, s32 count)
+ARCH_COMPAT_SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd,
+			       compat_off_t __user *, offset, s32, count)
 {
 	mm_segment_t old_fs = get_fs();
 	int ret;
@@ -466,7 +466,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd,
 	return ret;
 }
 
-asmlinkage long sys32_olduname(struct oldold_utsname __user *name)
+ARCH_COMPAT_SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name)
 {
 	char *arch = "x86_64";
 	int err;
@@ -518,8 +518,8 @@ long sys32_uname(struct old_utsname __user *name)
 	return err ? -EFAULT : 0;
 }
 
-asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
-			     compat_uptr_t __user *envp, struct pt_regs *regs)
+ARCH_COMPAT_SYSCALL_DEFINE4(execve, char __user *, name, compat_uptr_t __user *, argv,
+			compat_uptr_t __user *, envp, struct pt_regs *, regs)
 {
 	long error;
 	char *filename;
@@ -533,8 +533,8 @@ asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
 	return error;
 }
 
-asmlinkage long sys32_clone(unsigned int clone_flags, unsigned int newsp,
-			    struct pt_regs *regs)
+ARCH_COMPAT_SYSCALL_DEFINE3(clone, unsigned int, clone_flags, unsigned int, newsp,
+			    struct pt_regs *, regs)
 {
 	void __user *parent_tid = (void __user *)regs->dx;
 	void __user *child_tid = (void __user *)regs->di;
@@ -593,24 +593,24 @@ asmlinkage ssize_t sys32_readahead(int fd, unsigned off_lo, unsigned off_hi,
 	return sys_readahead(fd, ((u64)off_hi << 32) | off_lo, count);
 }
 
-asmlinkage long sys32_sync_file_range(int fd, unsigned off_low, unsigned off_hi,
-				      unsigned n_low, unsigned n_hi,  int flags)
+ARCH_COMPAT_SYSCALL_DEFINE6(sync_file_range, int, fd, unsigned, off_low, unsigned, off_hi,
+			unsigned, n_low, unsigned, n_hi,  int, flags)
 {
 	return sys_sync_file_range(fd,
 				   ((u64)off_hi << 32) | off_low,
 				   ((u64)n_hi << 32) | n_low, flags);
 }
 
-asmlinkage long sys32_fadvise64(int fd, unsigned offset_lo, unsigned offset_hi,
-				size_t len, int advice)
+ARCH_COMPAT_SYSCALL_DEFINE5(fadvise64, int, fd, unsigned, offset_lo, unsigned, offset_hi,
+				size_t, len, int, advice)
 {
 	return sys_fadvise64_64(fd, ((u64)offset_hi << 32) | offset_lo,
 				len, advice);
 }
 
-asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_lo,
-				unsigned offset_hi, unsigned len_lo,
-				unsigned len_hi)
+ARCH_COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, unsigned, offset_lo,
+				unsigned, offset_hi, unsigned, len_lo,
+				unsigned, len_hi)
 {
 	return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo,
 			     ((u64)len_hi << 32) | len_lo);
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 09/14] syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (7 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 08/14] x86, compat: convert ia32 layer to use Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-16 17:46 ` [PATCH 10/14] compat: convert to use COMPAT_SYSCALL_DEFINE#N() Jason Baron
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Add COMPAT_SYSCALL_DEFINE#N() macro define common compat syscalls that
are not arch specific. Prepends "compat_sys_" to the syscall name to identify
it.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/syscalls.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 14ecfcc..4cbc370 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -230,6 +230,13 @@ struct perf_event_attr;
 #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__)
 
+#define COMPAT_SYSCALL_DEFINE1(name, ...) COMPAT_SYSCALL_DEFINEx(1, compat_sys_##name, name, __VA_ARGS__)
+#define COMPAT_SYSCALL_DEFINE2(name, ...) COMPAT_SYSCALL_DEFINEx(2, compat_sys_##name, name, __VA_ARGS__)
+#define COMPAT_SYSCALL_DEFINE3(name, ...) COMPAT_SYSCALL_DEFINEx(3, compat_sys_##name, name, __VA_ARGS__)
+#define COMPAT_SYSCALL_DEFINE4(name, ...) COMPAT_SYSCALL_DEFINEx(4, compat_sys_##name, name, __VA_ARGS__)
+#define COMPAT_SYSCALL_DEFINE5(name, ...) COMPAT_SYSCALL_DEFINEx(5, compat_sys_##name, name, __VA_ARGS__)
+#define COMPAT_SYSCALL_DEFINE6(name, ...) COMPAT_SYSCALL_DEFINEx(6, compat_sys_##name, name, __VA_ARGS__)
+
 #ifdef CONFIG_FTRACE_SYSCALLS
 #define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...)		\
 	static const char *types_compat_sys_##sname[] = {	\
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 10/14] compat: convert to use COMPAT_SYSCALL_DEFINE#N()
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (8 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 09/14] syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro Jason Baron
@ 2010-03-16 17:46 ` Jason Baron
  2010-03-16 17:47 ` [PATCH 11/14] compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros Jason Baron
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:46 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

convert kernel/compat.c to use the new COMPAT_SYSCALL_DEFINE#N macro. Thus,
tying these syscalls into the syscall event layer.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 kernel/compat.c |  106 ++++++++++++++++++++++++++----------------------------
 1 files changed, 51 insertions(+), 55 deletions(-)

diff --git a/kernel/compat.c b/kernel/compat.c
index f6c204f..46dd9c7 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -51,8 +51,8 @@ static int compat_put_timeval(struct compat_timeval __user *o,
 		put_user(i->tv_usec, &o->tv_usec)) ? -EFAULT : 0;
 }
 
-asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv,
-		struct timezone __user *tz)
+COMPAT_SYSCALL_DEFINE2(gettimeofday, struct compat_timeval __user *, tv,
+		struct timezone __user *, tz)
 {
 	if (tv) {
 		struct timeval ktv;
@@ -68,8 +68,8 @@ asmlinkage long compat_sys_gettimeofday(struct compat_timeval __user *tv,
 	return 0;
 }
 
-asmlinkage long compat_sys_settimeofday(struct compat_timeval __user *tv,
-		struct timezone __user *tz)
+COMPAT_SYSCALL_DEFINE2(settimeofday, struct compat_timeval __user *, tv,
+		struct timezone __user *, tz)
 {
 	struct timespec kts;
 	struct timezone ktz;
@@ -123,8 +123,8 @@ static long compat_nanosleep_restart(struct restart_block *restart)
 	return ret;
 }
 
-asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
-				     struct compat_timespec __user *rmtp)
+COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
+				     struct compat_timespec __user *, rmtp)
 {
 	struct timespec tu, rmt;
 	mm_segment_t oldfs;
@@ -177,8 +177,8 @@ static inline long put_compat_itimerval(struct compat_itimerval __user *o,
 		 __put_user(i->it_value.tv_usec, &o->it_value.tv_usec)));
 }
 
-asmlinkage long compat_sys_getitimer(int which,
-		struct compat_itimerval __user *it)
+COMPAT_SYSCALL_DEFINE2(getitimer, int, which,
+		struct compat_itimerval __user *, it)
 {
 	struct itimerval kit;
 	int error;
@@ -189,9 +189,9 @@ asmlinkage long compat_sys_getitimer(int which,
 	return error;
 }
 
-asmlinkage long compat_sys_setitimer(int which,
-		struct compat_itimerval __user *in,
-		struct compat_itimerval __user *out)
+COMPAT_SYSCALL_DEFINE3(setitimer, int, which,
+		struct compat_itimerval __user *, in,
+		struct compat_itimerval __user *, out)
 {
 	struct itimerval kin, kout;
 	int error;
@@ -215,7 +215,7 @@ static compat_clock_t clock_t_to_compat_clock_t(clock_t x)
 	return compat_jiffies_to_clock_t(clock_t_to_jiffies(x));
 }
 
-asmlinkage long compat_sys_times(struct compat_tms __user *tbuf)
+COMPAT_SYSCALL_DEFINE1(times, struct compat_tms __user *, tbuf)
 {
 	if (tbuf) {
 		struct tms tms;
@@ -239,7 +239,7 @@ asmlinkage long compat_sys_times(struct compat_tms __user *tbuf)
  * types that can be passed to put_user()/get_user().
  */
 
-asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
+COMPAT_SYSCALL_DEFINE1(sigpending, compat_old_sigset_t __user *, set)
 {
 	old_sigset_t s;
 	long ret;
@@ -253,8 +253,8 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
 	return ret;
 }
 
-asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
-		compat_old_sigset_t __user *oset)
+COMPAT_SYSCALL_DEFINE3(sigprocmask, int, how, compat_old_sigset_t __user *, set,
+		compat_old_sigset_t __user *, oset)
 {
 	old_sigset_t s;
 	long ret;
@@ -274,8 +274,8 @@ asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
 	return ret;
 }
 
-asmlinkage long compat_sys_setrlimit(unsigned int resource,
-		struct compat_rlimit __user *rlim)
+COMPAT_SYSCALL_DEFINE2(setrlimit, unsigned int, resource,
+		struct compat_rlimit __user *, rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -301,8 +301,8 @@ asmlinkage long compat_sys_setrlimit(unsigned int resource,
 
 #ifdef COMPAT_RLIM_OLD_INFINITY
 
-asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
-		struct compat_rlimit __user *rlim)
+COMPAT_SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
+		struct compat_rlimit __user *, rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -328,8 +328,8 @@ asmlinkage long compat_sys_old_getrlimit(unsigned int resource,
 
 #endif
 
-asmlinkage long compat_sys_getrlimit (unsigned int resource,
-		struct compat_rlimit __user *rlim)
+COMPAT_SYSCALL_DEFINE2(getrlimit, unsigned int, resource,
+		struct compat_rlimit __user *, rlim)
 {
 	struct rlimit r;
 	int ret;
@@ -377,7 +377,7 @@ int put_compat_rusage(const struct rusage *r, struct compat_rusage __user *ru)
 	return 0;
 }
 
-asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
+COMPAT_SYSCALL_DEFINE2(getrusage, int, who, struct compat_rusage __user *, ru)
 {
 	struct rusage r;
 	int ret;
@@ -396,9 +396,8 @@ asmlinkage long compat_sys_getrusage(int who, struct compat_rusage __user *ru)
 	return 0;
 }
 
-asmlinkage long
-compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
-	struct compat_rusage __user *ru)
+COMPAT_SYSCALL_DEFINE4(wait4, compat_pid_t, pid, compat_uint_t __user *, stat_addr, int, options,
+	struct compat_rusage __user *, ru)
 {
 	if (!ru) {
 		return sys_wait4(pid, stat_addr, options, NULL);
@@ -425,9 +424,9 @@ compat_sys_wait4(compat_pid_t pid, compat_uint_t __user *stat_addr, int options,
 	}
 }
 
-asmlinkage long compat_sys_waitid(int which, compat_pid_t pid,
-		struct compat_siginfo __user *uinfo, int options,
-		struct compat_rusage __user *uru)
+COMPAT_SYSCALL_DEFINE5(waitid, int, which, compat_pid_t, pid,
+		struct compat_siginfo __user *, uinfo, int, options,
+		struct compat_rusage __user *, uru)
 {
 	siginfo_t info;
 	struct rusage ru;
@@ -469,9 +468,9 @@ static int compat_get_user_cpu_mask(compat_ulong_t __user *user_mask_ptr,
 	return compat_get_bitmap(k, user_mask_ptr, len * 8);
 }
 
-asmlinkage long compat_sys_sched_setaffinity(compat_pid_t pid,
-					     unsigned int len,
-					     compat_ulong_t __user *user_mask_ptr)
+COMPAT_SYSCALL_DEFINE3(sched_setaffinity, compat_pid_t, pid,
+					     unsigned int, len,
+					     compat_ulong_t __user *, user_mask_ptr)
 {
 	cpumask_var_t new_mask;
 	int retval;
@@ -489,8 +488,8 @@ out:
 	return retval;
 }
 
-asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
-					     compat_ulong_t __user *user_mask_ptr)
+COMPAT_SYSCALL_DEFINE3(sched_getaffinity, compat_pid_t, pid, unsigned int, len,
+					     compat_ulong_t __user *, user_mask_ptr)
 {
 	int ret;
 	cpumask_var_t mask;
@@ -815,10 +814,9 @@ sigset_from_compat (sigset_t *set, compat_sigset_t *compat)
 	}
 }
 
-asmlinkage long
-compat_sys_rt_sigtimedwait (compat_sigset_t __user *uthese,
-		struct compat_siginfo __user *uinfo,
-		struct compat_timespec __user *uts, compat_size_t sigsetsize)
+COMPAT_SYSCALL_DEFINE4(rt_sigtimedwait, compat_sigset_t __user *, uthese,
+		struct compat_siginfo __user *, uinfo,
+		struct compat_timespec __user *, uts, compat_size_t, sigsetsize)
 {
 	compat_sigset_t s32;
 	sigset_t s;
@@ -882,9 +880,8 @@ compat_sys_rt_sigtimedwait (compat_sigset_t __user *uthese,
 
 }
 
-asmlinkage long
-compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
-			     struct compat_siginfo __user *uinfo)
+COMPAT_SYSCALL_DEFINE4(rt_tgsigqueueinfo, compat_pid_t, tgid, compat_pid_t, pid, int, sig,
+			     struct compat_siginfo __user *, uinfo)
 {
 	siginfo_t info;
 
@@ -897,7 +894,7 @@ compat_sys_rt_tgsigqueueinfo(compat_pid_t tgid, compat_pid_t pid, int sig,
 
 /* compat_time_t is a 32 bit "long" and needs to get converted. */
 
-asmlinkage long compat_sys_time(compat_time_t __user * tloc)
+COMPAT_SYSCALL_DEFINE1(time, compat_time_t __user *, tloc)
 {
 	compat_time_t i;
 	struct timeval tv;
@@ -913,7 +910,7 @@ asmlinkage long compat_sys_time(compat_time_t __user * tloc)
 	return i;
 }
 
-asmlinkage long compat_sys_stime(compat_time_t __user *tptr)
+COMPAT_SYSCALL_DEFINE1(stime, compat_time_t __user *, tptr)
 {
 	struct timespec tv;
 	int err;
@@ -934,7 +931,7 @@ asmlinkage long compat_sys_stime(compat_time_t __user *tptr)
 #endif /* __ARCH_WANT_COMPAT_SYS_TIME */
 
 #ifdef __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND
-asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, compat_size_t sigsetsize)
+COMPAT_SYSCALL_DEFINE2(rt_sigsuspend, compat_sigset_t __user *, unewset, compat_size_t, sigsetsize)
 {
 	sigset_t newset;
 	compat_sigset_t newset32;
@@ -961,7 +958,7 @@ asmlinkage long compat_sys_rt_sigsuspend(compat_sigset_t __user *unewset, compat
 }
 #endif /* __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND */
 
-asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp)
+COMPAT_SYSCALL_DEFINE1(adjtimex, struct compat_timex __user *, utp)
 {
 	struct timex txc;
 	int ret;
@@ -1021,11 +1018,11 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp)
 }
 
 #ifdef CONFIG_NUMA
-asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages,
-		compat_uptr_t __user *pages32,
-		const int __user *nodes,
-		int __user *status,
-		int flags)
+COMPAT_SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages,
+		compat_uptr_t __user *, pages32,
+		const int __user *, nodes,
+		int __user *, status,
+		int, flags)
 {
 	const void __user * __user *pages;
 	int i;
@@ -1041,10 +1038,10 @@ asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages,
 	return sys_move_pages(pid, nr_pages, pages, nodes, status, flags);
 }
 
-asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
-			compat_ulong_t maxnode,
-			const compat_ulong_t __user *old_nodes,
-			const compat_ulong_t __user *new_nodes)
+COMPAT_SYSCALL_DEFINE4(migrate_pages, compat_pid_t, pid,
+			compat_ulong_t, maxnode,
+			const compat_ulong_t __user *, old_nodes,
+			const compat_ulong_t __user *, new_nodes)
 {
 	unsigned long __user *old = NULL;
 	unsigned long __user *new = NULL;
@@ -1092,8 +1089,7 @@ struct compat_sysinfo {
 	char _f[20-2*sizeof(u32)-sizeof(int)];
 };
 
-asmlinkage long
-compat_sys_sysinfo(struct compat_sysinfo __user *info)
+COMPAT_SYSCALL_DEFINE1(sysinfo, struct compat_sysinfo __user *, info)
 {
 	struct sysinfo s;
 
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 11/14] compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (9 preceding siblings ...)
  2010-03-16 17:46 ` [PATCH 10/14] compat: convert to use COMPAT_SYSCALL_DEFINE#N() Jason Baron
@ 2010-03-16 17:47 ` Jason Baron
  2010-03-16 17:47 ` [PATCH 12/14] tags: recognize compat syscalls Jason Baron
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:47 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

convert the fs/compat.c file to use the COMPAT_SYSCALL_DEFINE#N() macros to tie
them into the generic compat layer.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 fs/compat.c |  147 +++++++++++++++++++++++++++++------------------------------
 1 files changed, 72 insertions(+), 75 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index 00d90c2..c20c2ca 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -75,7 +75,7 @@ int compat_printk(const char *fmt, ...)
  * Not all architectures have sys_utime, so implement this in terms
  * of sys_utimes.
  */
-asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t)
+COMPAT_SYSCALL_DEFINE2(utime, char __user *, filename, struct compat_utimbuf __user *, t)
 {
 	struct timespec tv[2];
 
@@ -89,7 +89,7 @@ asmlinkage long compat_sys_utime(char __user *filename, struct compat_utimbuf __
 	return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0);
 }
 
-asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, struct compat_timespec __user *t, int flags)
+COMPAT_SYSCALL_DEFINE4(utimensat, unsigned int, dfd, char __user *, filename, struct compat_timespec __user *, t, int, flags)
 {
 	struct timespec tv[2];
 
@@ -104,7 +104,7 @@ asmlinkage long compat_sys_utimensat(unsigned int dfd, char __user *filename, st
 	return do_utimes(dfd, filename, t ? tv : NULL, flags);
 }
 
-asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, struct compat_timeval __user *t)
+COMPAT_SYSCALL_DEFINE3(futimesat, unsigned int, dfd, char __user *, filename, struct compat_timeval __user *, t)
 {
 	struct timespec tv[2];
 
@@ -123,7 +123,7 @@ asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, st
 	return do_utimes(dfd, filename, t ? tv : NULL, 0);
 }
 
-asmlinkage long compat_sys_utimes(char __user *filename, struct compat_timeval __user *t)
+COMPAT_SYSCALL_DEFINE2(utimes, char __user *, filename, struct compat_timeval __user *, t)
 {
 	return compat_sys_futimesat(AT_FDCWD, filename, t);
 }
@@ -167,8 +167,8 @@ static int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
 	return err;
 }
 
-asmlinkage long compat_sys_newstat(char __user * filename,
-		struct compat_stat __user *statbuf)
+COMPAT_SYSCALL_DEFINE2(newstat, char __user *, filename,
+			struct compat_stat __user *, statbuf)
 {
 	struct kstat stat;
 	int error;
@@ -179,8 +179,8 @@ asmlinkage long compat_sys_newstat(char __user * filename,
 	return cp_compat_stat(&stat, statbuf);
 }
 
-asmlinkage long compat_sys_newlstat(char __user * filename,
-		struct compat_stat __user *statbuf)
+COMPAT_SYSCALL_DEFINE2(newlstat, char __user *, filename,
+			struct compat_stat __user *, statbuf)
 {
 	struct kstat stat;
 	int error;
@@ -192,8 +192,8 @@ asmlinkage long compat_sys_newlstat(char __user * filename,
 }
 
 #ifndef __ARCH_WANT_STAT64
-asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename,
-		struct compat_stat __user *statbuf, int flag)
+COMPAT_SYSCALL_DEFINE4(newfstatat, unsigned int, dfd, char __user *, filename,
+			struct compat_stat __user *, statbuf, int, flag)
 {
 	struct kstat stat;
 	int error;
@@ -205,8 +205,8 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename,
 }
 #endif
 
-asmlinkage long compat_sys_newfstat(unsigned int fd,
-		struct compat_stat __user * statbuf)
+COMPAT_SYSCALL_DEFINE2(newfstat, unsigned int, fd,
+			struct compat_stat __user *, statbuf)
 {
 	struct kstat stat;
 	int error = vfs_fstat(fd, &stat);
@@ -257,7 +257,7 @@ static int put_compat_statfs(struct compat_statfs __user *ubuf, struct kstatfs *
  * The following statfs calls are copies of code from fs/open.c and
  * should be checked against those from time to time
  */
-asmlinkage long compat_sys_statfs(const char __user *pathname, struct compat_statfs __user *buf)
+COMPAT_SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct compat_statfs __user *, buf)
 {
 	struct path path;
 	int error;
@@ -273,7 +273,7 @@ asmlinkage long compat_sys_statfs(const char __user *pathname, struct compat_sta
 	return error;
 }
 
-asmlinkage long compat_sys_fstatfs(unsigned int fd, struct compat_statfs __user *buf)
+COMPAT_SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct compat_statfs __user *, buf)
 {
 	struct file * file;
 	struct kstatfs tmp;
@@ -322,7 +322,7 @@ static int put_compat_statfs64(struct compat_statfs64 __user *ubuf, struct kstat
 	return 0;
 }
 
-asmlinkage long compat_sys_statfs64(const char __user *pathname, compat_size_t sz, struct compat_statfs64 __user *buf)
+COMPAT_SYSCALL_DEFINE3(statfs64, const char __user *, pathname, compat_size_t, sz, struct compat_statfs64 __user *, buf)
 {
 	struct path path;
 	int error;
@@ -341,7 +341,7 @@ asmlinkage long compat_sys_statfs64(const char __user *pathname, compat_size_t s
 	return error;
 }
 
-asmlinkage long compat_sys_fstatfs64(unsigned int fd, compat_size_t sz, struct compat_statfs64 __user *buf)
+COMPAT_SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, compat_size_t, sz, struct compat_statfs64 __user *, buf)
 {
 	struct file * file;
 	struct kstatfs tmp;
@@ -367,7 +367,7 @@ out:
  * Given how simple this syscall is that apporach is more maintainable
  * than the various conversion hacks.
  */
-asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u)
+COMPAT_SYSCALL_DEFINE2(ustat, unsigned, dev, struct compat_ustat __user *, u)
 {
 	struct super_block *sb;
 	struct compat_ustat tmp;
@@ -442,8 +442,8 @@ static int put_compat_flock64(struct flock *kfl, struct compat_flock64 __user *u
 }
 #endif
 
-asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
-		unsigned long arg)
+COMPAT_SYSCALL_DEFINE3(fcntl64, unsigned int, fd, unsigned int, cmd,
+			unsigned long, arg)
 {
 	mm_segment_t old_fs;
 	struct flock f;
@@ -511,16 +511,15 @@ asmlinkage long compat_sys_fcntl64(unsigned int fd, unsigned int cmd,
 	return ret;
 }
 
-asmlinkage long compat_sys_fcntl(unsigned int fd, unsigned int cmd,
-		unsigned long arg)
+COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd,
+			unsigned long, arg)
 {
 	if ((cmd == F_GETLK64) || (cmd == F_SETLK64) || (cmd == F_SETLKW64))
 		return -EINVAL;
 	return compat_sys_fcntl64(fd, cmd, arg);
 }
 
-asmlinkage long
-compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
+COMPAT_SYSCALL_DEFINE2(io_setup, unsigned, nr_reqs, u32 __user *, ctx32p)
 {
 	long ret;
 	aio_context_t ctx64;
@@ -539,12 +538,11 @@ compat_sys_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
 	return ret;
 }
 
-asmlinkage long
-compat_sys_io_getevents(aio_context_t ctx_id,
-				 unsigned long min_nr,
-				 unsigned long nr,
-				 struct io_event __user *events,
-				 struct compat_timespec __user *timeout)
+COMPAT_SYSCALL_DEFINE5(io_getevents, aio_context_t, ctx_id,
+				 unsigned long, min_nr,
+				 unsigned long, nr,
+				 struct io_event __user *, events,
+				 struct compat_timespec __user *, timeout)
 {
 	long ret;
 	struct timespec t;
@@ -584,8 +582,7 @@ copy_iocb(long nr, u32 __user *ptr32, struct iocb __user * __user *ptr64)
 
 #define MAX_AIO_SUBMITS 	(PAGE_SIZE/sizeof(struct iocb *))
 
-asmlinkage long
-compat_sys_io_submit(aio_context_t ctx_id, int nr, u32 __user *iocb)
+COMPAT_SYSCALL_DEFINE3(io_submit, aio_context_t, ctx_id, int, nr, u32 __user *, iocb)
 {
 	struct iocb __user * __user *iocb64; 
 	long ret;
@@ -762,9 +759,9 @@ static int do_nfs4_super_data_conv(void *raw_data)
 #define NCPFS_NAME      "ncpfs"
 #define NFS4_NAME	"nfs4"
 
-asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
-				 char __user * type, unsigned long flags,
-				 void __user * data)
+COMPAT_SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name,
+			char __user *, type, unsigned long, flags,
+			void __user *, data)
 {
 	char *kernel_type;
 	unsigned long data_page;
@@ -863,8 +860,9 @@ efault:
 	return -EFAULT;
 }
 
-asmlinkage long compat_sys_old_readdir(unsigned int fd,
-	struct compat_old_linux_dirent __user *dirent, unsigned int count)
+COMPAT_SYSCALL_DEFINE3(old_readdir, unsigned int, fd,
+			struct compat_old_linux_dirent __user *, dirent,
+			unsigned int, count)
 {
 	int error;
 	struct file *file;
@@ -943,8 +941,9 @@ efault:
 	return -EFAULT;
 }
 
-asmlinkage long compat_sys_getdents(unsigned int fd,
-		struct compat_linux_dirent __user *dirent, unsigned int count)
+COMPAT_SYSCALL_DEFINE3(getdents, unsigned int, fd,
+			struct compat_linux_dirent __user *, dirent,
+			unsigned int, count)
 {
 	struct file * file;
 	struct compat_linux_dirent __user * lastdirent;
@@ -1031,8 +1030,9 @@ efault:
 	return -EFAULT;
 }
 
-asmlinkage long compat_sys_getdents64(unsigned int fd,
-		struct linux_dirent64 __user * dirent, unsigned int count)
+COMPAT_SYSCALL_DEFINE3(getdents64, unsigned int, fd,
+			struct linux_dirent64 __user *, dirent,
+			unsigned int, count)
 {
 	struct file * file;
 	struct linux_dirent64 __user * lastdirent;
@@ -1291,9 +1291,8 @@ compat_sys_pwritev(unsigned long fd, const struct compat_iovec __user *vec,
 	return ret;
 }
 
-asmlinkage long
-compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
-		    unsigned int nr_segs, unsigned int flags)
+COMPAT_SYSCALL_DEFINE4(vmsplice, int, fd, const struct compat_iovec __user *, iov32,
+			unsigned int, nr_segs, unsigned int, flags)
 {
 	unsigned i;
 	struct iovec __user *iov;
@@ -1315,8 +1314,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
  * Exactly like fs/open.c:sys_open(), except that it doesn't set the
  * O_LARGEFILE flag.
  */
-asmlinkage long
-compat_sys_open(const char __user *filename, int flags, int mode)
+COMPAT_SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode)
 {
 	return do_sys_open(AT_FDCWD, filename, flags, mode);
 }
@@ -1325,8 +1323,7 @@ compat_sys_open(const char __user *filename, int flags, int mode)
  * Exactly like fs/open.c:sys_openat(), except that it doesn't set the
  * O_LARGEFILE flag.
  */
-asmlinkage long
-compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode)
+COMPAT_SYSCALL_DEFINE4(openat, unsigned int, dfd, const char __user *, filename, int, flags, int, mode)
 {
 	return do_sys_open(dfd, filename, flags, mode);
 }
@@ -1770,9 +1767,9 @@ out_nofds:
 	return ret;
 }
 
-asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
-	compat_ulong_t __user *outp, compat_ulong_t __user *exp,
-	struct compat_timeval __user *tvp)
+COMPAT_SYSCALL_DEFINE5(select, int, n, compat_ulong_t __user *, inp,
+			compat_ulong_t __user *, outp, compat_ulong_t __user *, exp,
+			struct compat_timeval __user *, tvp)
 {
 	struct timespec end_time, *to = NULL;
 	struct compat_timeval tv;
@@ -1847,9 +1844,9 @@ static long do_compat_pselect(int n, compat_ulong_t __user *inp,
 	return ret;
 }
 
-asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
-	compat_ulong_t __user *outp, compat_ulong_t __user *exp,
-	struct compat_timespec __user *tsp, void __user *sig)
+COMPAT_SYSCALL_DEFINE6(pselect6, int, n, compat_ulong_t __user *, inp,
+			compat_ulong_t __user *, outp, compat_ulong_t __user *, exp,
+			struct compat_timespec __user *, tsp, void __user *, sig)
 {
 	compat_size_t sigsetsize = 0;
 	compat_uptr_t up = 0;
@@ -1866,9 +1863,9 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,
 				 sigsetsize);
 }
 
-asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
-	unsigned int nfds, struct compat_timespec __user *tsp,
-	const compat_sigset_t __user *sigmask, compat_size_t sigsetsize)
+COMPAT_SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds,
+			unsigned int, nfds, struct compat_timespec __user *, tsp,
+			const compat_sigset_t __user *, sigmask, compat_size_t, sigsetsize)
 {
 	compat_sigset_t ss32;
 	sigset_t ksigmask, sigsaved;
@@ -2096,9 +2093,9 @@ static int compat_nfs_getfh_res_trans(union nfsctl_res *kres,
 	return (err) ? -EFAULT : 0;
 }
 
-asmlinkage long compat_sys_nfsservctl(int cmd,
-				struct compat_nfsctl_arg __user *arg,
-				union compat_nfsctl_res __user *res)
+COMPAT_SYSCALL_DEFINE3(nfsservctl, int cmd,
+			struct compat_nfsctl_arg __user *, arg,
+			union compat_nfsctl_res __user *, res)
 {
 	struct nfsctl_arg *karg;
 	union nfsctl_res *kres;
@@ -2174,11 +2171,11 @@ long asmlinkage compat_sys_nfsservctl(int cmd, void *notused, void *notused2)
 #ifdef CONFIG_EPOLL
 
 #ifdef HAVE_SET_RESTORE_SIGMASK
-asmlinkage long compat_sys_epoll_pwait(int epfd,
-			struct compat_epoll_event __user *events,
-			int maxevents, int timeout,
-			const compat_sigset_t __user *sigmask,
-			compat_size_t sigsetsize)
+COMPAT_SYSCALL_DEFINE6(epoll_pwait, int, epfd,
+			struct compat_epoll_event __user *, events,
+			int, maxevents, int, timeout,
+			const compat_sigset_t __user *, sigmask,
+			compat_size_t, sigsetsize)
 {
 	long err;
 	compat_sigset_t csigmask;
@@ -2223,9 +2220,9 @@ asmlinkage long compat_sys_epoll_pwait(int epfd,
 
 #ifdef CONFIG_SIGNALFD
 
-asmlinkage long compat_sys_signalfd4(int ufd,
-				     const compat_sigset_t __user *sigmask,
-				     compat_size_t sigsetsize, int flags)
+COMPAT_SYSCALL_DEFINE4(signalfd4, int, ufd,
+			const compat_sigset_t __user *, sigmask,
+			compat_size_t, sigsetsize, int, flags)
 {
 	compat_sigset_t ss32;
 	sigset_t tmp;
@@ -2243,9 +2240,9 @@ asmlinkage long compat_sys_signalfd4(int ufd,
 	return sys_signalfd4(ufd, ksigmask, sizeof(sigset_t), flags);
 }
 
-asmlinkage long compat_sys_signalfd(int ufd,
-				    const compat_sigset_t __user *sigmask,
-				    compat_size_t sigsetsize)
+COMPAT_SYSCALL_DEFINE3(signalfd, int, ufd,
+			const compat_sigset_t __user *, sigmask,
+			compat_size_t, sigsetsize)
 {
 	return compat_sys_signalfd4(ufd, sigmask, sigsetsize, 0);
 }
@@ -2253,9 +2250,9 @@ asmlinkage long compat_sys_signalfd(int ufd,
 
 #ifdef CONFIG_TIMERFD
 
-asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
-				   const struct compat_itimerspec __user *utmr,
-				   struct compat_itimerspec __user *otmr)
+COMPAT_SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,
+			const struct compat_itimerspec __user *, utmr,
+			struct compat_itimerspec __user *, otmr)
 {
 	int error;
 	struct itimerspec t;
@@ -2274,8 +2271,8 @@ asmlinkage long compat_sys_timerfd_settime(int ufd, int flags,
 	return error;
 }
 
-asmlinkage long compat_sys_timerfd_gettime(int ufd,
-				   struct compat_itimerspec __user *otmr)
+COMPAT_SYSCALL_DEFINE2(timerfd_gettime, int, ufd,
+			struct compat_itimerspec __user *, otmr)
 {
 	int error;
 	struct itimerspec t;
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 12/14] tags: recognize compat syscalls
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (10 preceding siblings ...)
  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 ` Jason Baron
  2010-03-16 17:47 ` [PATCH 13/14] cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macro Jason Baron
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:47 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

make tags.sh recognize the new syscall macros:

COMPAT_SYSCALL_DEFINE#N()
ARCH_COMPAT_SYSCALL_DEFINE#N()

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 scripts/tags.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 1a0c44d..fe5d4a3 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -110,7 +110,9 @@ exuberant()
 	-I DEFINE_TRACE,EXPORT_TRACEPOINT_SYMBOL,EXPORT_TRACEPOINT_SYMBOL_GPL \
 	--extra=+f --c-kinds=-px                                \
 	--regex-asm='/^ENTRY\(([^)]*)\).*/\1/'                  \
-	--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/'
+	--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/' \
+	--regex-c='/^COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/compat_sys_\1/' \
+	--regex-c='/^ARCH_COMPAT_SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys32_\1/'
 
 	all_kconfigs | xargs $1 -a                              \
 	--langdef=kconfig --language-force=kconfig              \
@@ -130,7 +132,9 @@ emacs()
 {
 	all_sources | xargs $1 -a                               \
 	--regex='/^ENTRY(\([^)]*\)).*/\1/'                      \
-	--regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/'
+	--regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/'   \
+	--regex='/^COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/compat_sys_\1/' \
+	--regex='/^ARCH_COMPAT_SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys32_\1/'
 
 	all_kconfigs | xargs $1 -a                              \
 	--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 13/14] cleanup: remove arg from TRACE_SYS_ENTER_PROFILE_INIT() macro
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (11 preceding siblings ...)
  2010-03-16 17:47 ` [PATCH 12/14] tags: recognize compat syscalls Jason Baron
@ 2010-03-16 17:47 ` Jason Baron
  2010-03-16 17:47 ` [PATCH 14/14] tracing: make a "compat_syscalls" tracing subsys Jason Baron
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:47 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Since TRACE_SYS_ENTER_PROFILE_INIT() and TRACE_SYS_EXIT_PROFILE_INIT() don't do
anything with their arguments, remove them. Also, TRACE_SYS_ENTER_PROFILE() and
TRACE_SYS_EXIT_PROFILE() don't appear to be used. remove them.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/syscalls.h |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 4cbc370..501cd46 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -101,18 +101,16 @@ struct perf_event_attr;
 
 #ifdef CONFIG_PERF_EVENTS
 
-#define TRACE_SYS_ENTER_PROFILE_INIT(sname)				       \
+#define TRACE_SYS_ENTER_PROFILE_INIT					       \
 	.profile_enable = prof_sysenter_enable,				       \
 	.profile_disable = prof_sysenter_disable,
 
-#define TRACE_SYS_EXIT_PROFILE_INIT(sname)				       \
+#define TRACE_SYS_EXIT_PROFILE_INIT					       \
 	.profile_enable = prof_sysexit_enable,				       \
 	.profile_disable = prof_sysexit_disable,
 #else
-#define TRACE_SYS_ENTER_PROFILE(sname)
-#define TRACE_SYS_ENTER_PROFILE_INIT(sname)
-#define TRACE_SYS_EXIT_PROFILE(sname)
-#define TRACE_SYS_EXIT_PROFILE_INIT(sname)
+#define TRACE_SYS_ENTER_PROFILE_INIT
+#define TRACE_SYS_EXIT_PROFILE_INIT
 #endif /* CONFIG_PERF_EVENTS */
 
 #ifdef CONFIG_FTRACE_SYSCALLS
@@ -149,7 +147,7 @@ struct perf_event_attr;
 		.regfunc		= reg_event_syscall_enter,	\
 		.unregfunc		= unreg_event_syscall_enter,	\
 		.data			= (void *)&__syscall_meta_##sname,\
-		TRACE_SYS_ENTER_PROFILE_INIT(sname)			\
+		TRACE_SYS_ENTER_PROFILE_INIT				\
 	}
 
 #define SYSCALL_TRACE_EXIT_EVENT(sname)					\
@@ -171,7 +169,7 @@ struct perf_event_attr;
 		.regfunc		= reg_event_syscall_exit,	\
 		.unregfunc		= unreg_event_syscall_exit,	\
 		.data			= (void *)&__syscall_meta_##sname,\
-		TRACE_SYS_EXIT_PROFILE_INIT(sname)			\
+		TRACE_SYS_EXIT_PROFILE_INIT				\
 	}
 
 #define SYSCALL_METADATA(rname, sname, nb)			\
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* [PATCH 14/14] tracing: make a "compat_syscalls" tracing subsys
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (12 preceding siblings ...)
  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 ` Jason Baron
  2010-03-18 18:22 ` [PATCH 15/14] compat_syscalls: introduce CONFIG_COMPAT_FTRACE_SYSCALLS Jason Baron
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-16 17:47 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

Create a new "compat_syscalls" subsys for tracing

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/syscalls.h |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 501cd46..94caf73 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -128,7 +128,7 @@ struct perf_event_attr;
 #define __SC_STR_TDECL5(t, a, ...)	#t, __SC_STR_TDECL4(__VA_ARGS__)
 #define __SC_STR_TDECL6(t, a, ...)	#t, __SC_STR_TDECL5(__VA_ARGS__)
 
-#define SYSCALL_TRACE_ENTER_EVENT(sname)				\
+#define SYSCALL_TRACE_ENTER_EVENT(sname, subsys)			\
 	static const struct syscall_metadata __syscall_meta_##sname;	\
 	static struct ftrace_event_call					\
 	__attribute__((__aligned__(4))) event_enter_##sname;		\
@@ -140,7 +140,7 @@ struct perf_event_attr;
 	  __attribute__((section("_ftrace_events")))			\
 	  event_enter_##sname = {					\
 		.name                   = "enter_"#sname,		\
-		.system                 = "syscalls",			\
+		.system                 = #subsys,			\
 		.event                  = &enter_syscall_print_##sname,	\
 		.raw_init		= init_syscall_trace,		\
 		.define_fields		= syscall_enter_define_fields,	\
@@ -150,7 +150,7 @@ struct perf_event_attr;
 		TRACE_SYS_ENTER_PROFILE_INIT				\
 	}
 
-#define SYSCALL_TRACE_EXIT_EVENT(sname)					\
+#define SYSCALL_TRACE_EXIT_EVENT(sname, subsys)			\
 	static const struct syscall_metadata __syscall_meta_##sname;	\
 	static struct ftrace_event_call					\
 	__attribute__((__aligned__(4))) event_exit_##sname;		\
@@ -162,7 +162,7 @@ struct perf_event_attr;
 	  __attribute__((section("_ftrace_events")))			\
 	  event_exit_##sname = {					\
 		.name                   = "exit_"#sname,		\
-		.system                 = "syscalls",			\
+		.system                 = #subsys,			\
 		.event                  = &exit_syscall_print_##sname,	\
 		.raw_init		= init_syscall_trace,		\
 		.define_fields		= syscall_exit_define_fields,	\
@@ -172,9 +172,9 @@ struct perf_event_attr;
 		TRACE_SYS_EXIT_PROFILE_INIT				\
 	}
 
-#define SYSCALL_METADATA(rname, sname, nb)			\
-	SYSCALL_TRACE_ENTER_EVENT(sname);			\
-	SYSCALL_TRACE_EXIT_EVENT(sname);			\
+#define SYSCALL_METADATA(rname, sname, nb, subsys)		\
+	SYSCALL_TRACE_ENTER_EVENT(sname, subsys);		\
+	SYSCALL_TRACE_EXIT_EVENT(sname, subsys);		\
 	static const struct syscall_metadata __used		\
 	  __attribute__((__aligned__(4)))			\
 	  __attribute__((section("__syscalls_metadata")))	\
@@ -192,8 +192,8 @@ struct perf_event_attr;
 	};
 
 #define SYSCALL_DEFINE0(sname)					\
-	SYSCALL_TRACE_ENTER_EVENT(sys_##sname);			\
-	SYSCALL_TRACE_EXIT_EVENT(sys_##sname);			\
+	SYSCALL_TRACE_ENTER_EVENT(sys_##sname, syscalls);	\
+	SYSCALL_TRACE_EXIT_EVENT(sys_##sname, syscalls);	\
 	static const struct syscall_metadata __used		\
 	  __attribute__((__aligned__(4)))			\
 	  __attribute__((section("__syscalls_metadata")))	\
@@ -236,17 +236,17 @@ struct perf_event_attr;
 #define COMPAT_SYSCALL_DEFINE6(name, ...) COMPAT_SYSCALL_DEFINEx(6, compat_sys_##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);	\
+#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, compat_syscalls);\
 	asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
 #else
-#define COMPAT_SYSCALL_DEFINEx(x, sname, ...)			\
+#define COMPAT_SYSCALL_DEFINEx(x, sname, ...)				\
 	asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
 #endif
 
@@ -274,7 +274,7 @@ struct perf_event_attr;
 	static const char *args_sys##sname[] = {		\
 		__SC_STR_ADECL##x(__VA_ARGS__)			\
 	};							\
-	SYSCALL_METADATA(sys##sname, sys##sname, x);		\
+	SYSCALL_METADATA(sys##sname, sys##sname, x, syscalls);	\
 	__SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
 #else
 #define SYSCALL_DEFINEx(x, sname, ...)				\
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 02/14] x86: add arch_compat_syscall_addr()
  2010-03-16 17:46 ` [PATCH 02/14] x86: add arch_compat_syscall_addr() Jason Baron
@ 2010-03-17 19:11   ` Frederic Weisbecker
  0 siblings, 0 replies; 31+ messages in thread
From: Frederic Weisbecker @ 2010-03-17 19:11 UTC (permalink / raw)
  To: Jason Baron
  Cc: mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx, mhiramat,
	heiko.carstens, benh, davem, lethal, schwidefsky, brueckner,
	tony.luck

On Tue, Mar 16, 2010 at 01:46:17PM -0400, Jason Baron wrote:
> Add arch_compat_syscall_addr(int nr) for x86_64. This is in preparation for adding
> compat syscall support to the event tracer.
> 
> Signed-off-by: Jason Baron <jbaron@redhat.com>
> ---
>  arch/x86/include/asm/syscall.h |    5 +++++
>  arch/x86/kernel/ftrace.c       |    8 ++++++++
>  2 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
> index c4a348f..4e462cc 100644
> --- a/arch/x86/include/asm/syscall.h
> +++ b/arch/x86/include/asm/syscall.h
> @@ -16,7 +16,12 @@
>  #include <linux/sched.h>
>  #include <linux/err.h>
>  
> +#if defined(CONFIG_COMPAT) && defined(CONFIG_FTRACE_SYSCALLS)
> + #define __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
> +#endif
> +



A config would be better:

arch/Kconfig:

	config HAVE_COMPAT_FTRACE_SYSCALLS
		bool

	config COMPAT_FTRACE_SYSCALLS
		def_bool y
		depends on COMPAT && FTRACE_SYSCALLS && HAVE_COMPAT_FTRACE_SYSCALLS

arch/x86/Kconfig:

	config X86
		[...]
		select HAVE_COMPAT_FTRACE_SYSCALLS
		[...]

So that we centralize the definition of COMPAT_FTRACE_SYSCALLS and
we don't need every archs to redefine the dependency and to stay sync
with potential dependency changes.

Thanks.



>  extern const unsigned long sys_call_table[];
> +extern const unsigned long *ia32_sys_call_table;
>  
>  /*
>   * Only the low 32 bits of orig_ax are meaningful, so we return int.
> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index cd37469..4b36a0b 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -26,6 +26,7 @@
>  #include <asm/ftrace.h>
>  #include <asm/nops.h>
>  #include <asm/nmi.h>
> +#include <asm/syscall.h>
>  
>  
>  #ifdef CONFIG_DYNAMIC_FTRACE
> @@ -510,3 +511,10 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
>  	}
>  }
>  #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
> +
> +#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
> +unsigned long __init arch_compat_syscall_addr(int nr)
> +{
> +	return (unsigned long)(&ia32_sys_call_table)[nr];
> +}
> +#endif
> -- 
> 1.6.5.1
> 


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 15/14] compat_syscalls: introduce CONFIG_COMPAT_FTRACE_SYSCALLS
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (13 preceding siblings ...)
  2010-03-16 17:47 ` [PATCH 14/14] tracing: make a "compat_syscalls" tracing subsys Jason Baron
@ 2010-03-18 18:22 ` 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
  16 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-03-18 18:22 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck

move the logic for enabling compat syscalls to common arch/Kconfig, where
config_compat_ftrace_syscalls depends on CONFIG_COMPAT, CONFIG_FTRACE_SYSCALLS,
and a per-arch CONFIG_HAVE_COMPAT_FTRACE_SYSCALLS. In this way arches that
want to add support for compat syscalls, can request it via selecting
HAVE_COMPAT_FTRACE_SYSCALLS in their respective arch Kconfig files.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 arch/Kconfig                   |    7 +++++++
 arch/x86/Kconfig               |    1 +
 arch/x86/include/asm/syscall.h |    4 ----
 arch/x86/kernel/ftrace.c       |    2 +-
 include/linux/syscalls.h       |    2 +-
 kernel/trace/trace_syscalls.c  |    2 +-
 6 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index e0ad3ca..0aca622 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -153,4 +153,11 @@ config HAVE_HW_BREAKPOINT
 config HAVE_USER_RETURN_NOTIFIER
 	bool
 
+config HAVE_COMPAT_FTRACE_SYSCALLS
+	bool
+
+config COMPAT_FTRACE_SYSCALLS
+	def_bool y
+	depends on COMPAT && FTRACE_SYSCALLS && HAVE_COMPAT_FTRACE_SYSCALLS
+
 source "kernel/gcov/Kconfig"
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 6de8f35..4083c0f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -40,6 +40,7 @@ config X86
 	select HAVE_FUNCTION_TRACE_MCOUNT_TEST
 	select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE
 	select HAVE_SYSCALL_TRACEPOINTS
+	select HAVE_COMPAT_FTRACE_SYSCALLS
 	select HAVE_KVM
 	select HAVE_ARCH_KGDB
 	select HAVE_ARCH_TRACEHOOK
diff --git a/arch/x86/include/asm/syscall.h b/arch/x86/include/asm/syscall.h
index 4e462cc..f734812 100644
--- a/arch/x86/include/asm/syscall.h
+++ b/arch/x86/include/asm/syscall.h
@@ -16,10 +16,6 @@
 #include <linux/sched.h>
 #include <linux/err.h>
 
-#if defined(CONFIG_COMPAT) && defined(CONFIG_FTRACE_SYSCALLS)
- #define __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
-#endif
-
 extern const unsigned long sys_call_table[];
 extern const unsigned long *ia32_sys_call_table;
 
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 4b36a0b..662343b 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -512,7 +512,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
 }
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
-#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+#ifdef CONFIG_COMPAT_FTRACE_SYSCALLS
 unsigned long __init arch_compat_syscall_addr(int nr)
 {
 	return (unsigned long)(&ia32_sys_call_table)[nr];
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2361d9a..cf230a6 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -235,7 +235,7 @@ struct perf_event_attr;
 #define COMPAT_SYSCALL_DEFINE5(name, ...) COMPAT_SYSCALL_DEFINEx(5, compat_sys_##name, name, __VA_ARGS__)
 #define COMPAT_SYSCALL_DEFINE6(name, ...) COMPAT_SYSCALL_DEFINEx(6, compat_sys_##name, name, __VA_ARGS__)
 
-#ifdef CONFIG_FTRACE_SYSCALLS
+#ifdef CONFIG_COMPAT_FTRACE_SYSCALLS
 #define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...)			\
 	static const char *types_compat_sys_##sname[] = {		\
 		__SC_STR_TDECL##x(__VA_ARGS__)				\
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 3f88b8e..6db3794 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -439,7 +439,7 @@ int __init init_ftrace_syscalls(void)
 		meta->syscall_nr = i;
 		syscalls_metadata[i] = meta;
 	}
-#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
+#ifdef CONFIG_COMPAT_FTRACE_SYSCALLS
 	if (NR_syscalls_compat) {
 		int match;
 		struct ftrace_event_call *ftrace_event;
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 07/14 re-post] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
  2010-03-16 17:46 ` [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE() Jason Baron
@ 2010-03-18 18:29   ` Jason Baron
  2010-03-27  4:56     ` Frederic Weisbecker
  2010-05-24  7:05   ` [PATCH 07/14] " Ian Munsie
  1 sibling, 1 reply; 31+ messages in thread
From: Jason Baron @ 2010-03-18 18:29 UTC (permalink / raw)
  To: fweisbec, mingo, rostedt
  Cc: linux-kernel, laijs, lizf, hpa, tglx, mhiramat, heiko.carstens,
	benh, davem, lethal, schwidefsky, brueckner, tony.luck


Re-post due to missing macro parameter. interdiff:

diff -u b/include/linux/syscalls.h b/include/linux/syscalls.h
--- b/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -241,7 +241,7 @@
 	SYSCALL_METADATA(syscall, compat_sys_##sname, x);	\
 	asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
 #else
-#define COMPAT_SYSCALL_DEFINEx(x, sname, ...)			\
+#define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...)		\
 	asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
 #endif

--------------------------------------------------------

Add ARCH_COMPAT_SYSCALL_DEFINE#N() macro which prepends "sys32_" to
arch specific compat syscall names. Identifies the 'compat' syscalls.

Signed-off-by: Jason Baron <jbaron@redhat.com>
---
 include/linux/syscalls.h |   50 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 38 insertions(+), 12 deletions(-)

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, ...)				\
-- 
1.6.5.1


^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 06/14] tracing: add tracing support for compat syscalls
  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
  0 siblings, 1 reply; 31+ messages in thread
From: Frederic Weisbecker @ 2010-03-20  6:12 UTC (permalink / raw)
  To: Jason Baron
  Cc: mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx, mhiramat,
	heiko.carstens, benh, davem, lethal, schwidefsky, brueckner,
	tony.luck

On Tue, Mar 16, 2010 at 01:46:36PM -0400, Jason Baron wrote:
>  #else /* CONFIG_COMPAT */
>  
> +#define NR_syscalls_compat 0
> +
>  static inline int is_compat_task(void)
>  {
>  	return 0;
> diff --git a/include/trace/syscall.h b/include/trace/syscall.h
> index 8f5ac38..1cc1d1e 100644
> --- a/include/trace/syscall.h
> +++ b/include/trace/syscall.h
> @@ -22,6 +22,7 @@
>  struct syscall_metadata {
>  	const char	*name;
>  	int		syscall_nr;
> +	int		compat_syscall_nr;



Why do you need both syscall_nr and compat_syscall_nr?
Compat and usual syscalls never share the same syscall
metadata.



> +#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
> +	if (NR_syscalls_compat) {
> +		int match;
> +		struct ftrace_event_call *ftrace_event;
> +
> +		compat_syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
> +						NR_syscalls_compat, GFP_KERNEL);
> +		if (!compat_syscalls_metadata) {
> +			WARN_ON(1);
> +			kfree(syscalls_metadata);
> +			return -ENOMEM;
> +		}
> +		for (i = 0; i < NR_syscalls_compat; i++) {
> +			addr = arch_compat_syscall_addr(i);
> +			meta = find_syscall_meta(addr);
> +			if (!meta)
> +				continue;
> +
> +			meta->compat_syscall_nr = i;
> +			compat_syscalls_metadata[i] = meta;
> +		}
> +		/* now check if any compat_syscalls are not referenced */
> +		for (ftrace_event = __start_ftrace_events;
> +			(unsigned long)ftrace_event <
> +			(unsigned long)__stop_ftrace_events; ftrace_event++) {



You could reuse for_each_event()



> +			match = 0;
> +			if (!ftrace_event->name)
> +				continue;
> +			if (strcmp(ftrace_event->system, "compat_syscalls"))
> +				continue;
> +			for (i = 0; i < NR_syscalls_compat; i++) {
> +				if (ftrace_event->data ==
> +						compat_syscalls_metadata[i]) {
> +					match = 1;
> +					break;


Nano-neat: starting the whole block with if (NR_syscalls_compat)
or making the whole a separate init_ftrace_syscalls() would
have made it win one level of indentation.



> +				}
> +			}
> +			if (!match)
> +				ftrace_event->name = NULL;



Nice :)

Thanks.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 06/14] tracing: add tracing support for compat syscalls
  2010-03-20  6:12   ` Frederic Weisbecker
@ 2010-03-22 20:21     ` Jason Baron
  2010-03-27  4:40       ` Frederic Weisbecker
  0 siblings, 1 reply; 31+ messages in thread
From: Jason Baron @ 2010-03-22 20:21 UTC (permalink / raw)
  To: Frederic Weisbecker
  Cc: mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx, mhiramat,
	heiko.carstens, benh, davem, lethal, schwidefsky, brueckner,
	tony.luck

On Sat, Mar 20, 2010 at 07:12:17AM +0100, Frederic Weisbecker wrote:
> >  #else /* CONFIG_COMPAT */
> >  
> > +#define NR_syscalls_compat 0
> > +
> >  static inline int is_compat_task(void)
> >  {
> >  	return 0;
> > diff --git a/include/trace/syscall.h b/include/trace/syscall.h
> > index 8f5ac38..1cc1d1e 100644
> > --- a/include/trace/syscall.h
> > +++ b/include/trace/syscall.h
> > @@ -22,6 +22,7 @@
> >  struct syscall_metadata {
> >  	const char	*name;
> >  	int		syscall_nr;
> > +	int		compat_syscall_nr;
> 
> 
> 
> Why do you need both syscall_nr and compat_syscall_nr?
> Compat and usual syscalls never share the same syscall
> metadata.
> 
> 

For example, something like 'sys_read()' is pointed to by both
syscalls_metadata and compat_syscalls_metadata. Thus, the same syscall
metadata record is referenced by two different tables. That said, I'm not
making use of compat_syscall_nr. Although it could be added to the
checks in 'reg_event_syscall_enter()', to make sure that the
compat_syscall_nr is valid. 


> 
> > +#ifdef __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS
> > +	if (NR_syscalls_compat) {
> > +		int match;
> > +		struct ftrace_event_call *ftrace_event;
> > +
> > +		compat_syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) *
> > +						NR_syscalls_compat, GFP_KERNEL);
> > +		if (!compat_syscalls_metadata) {
> > +			WARN_ON(1);
> > +			kfree(syscalls_metadata);
> > +			return -ENOMEM;
> > +		}
> > +		for (i = 0; i < NR_syscalls_compat; i++) {
> > +			addr = arch_compat_syscall_addr(i);
> > +			meta = find_syscall_meta(addr);
> > +			if (!meta)
> > +				continue;
> > +
> > +			meta->compat_syscall_nr = i;
> > +			compat_syscalls_metadata[i] = meta;
> > +		}
> > +		/* now check if any compat_syscalls are not referenced */
> > +		for (ftrace_event = __start_ftrace_events;
> > +			(unsigned long)ftrace_event <
> > +			(unsigned long)__stop_ftrace_events; ftrace_event++) {
> 
> 
> 
> You could reuse for_each_event()
> 
> 

ok. will update.

> 
> > +			match = 0;
> > +			if (!ftrace_event->name)
> > +				continue;
> > +			if (strcmp(ftrace_event->system, "compat_syscalls"))
> > +				continue;
> > +			for (i = 0; i < NR_syscalls_compat; i++) {
> > +				if (ftrace_event->data ==
> > +						compat_syscalls_metadata[i]) {
> > +					match = 1;
> > +					break;
> 
> 
> Nano-neat: starting the whole block with if (NR_syscalls_compat)
> or making the whole a separate init_ftrace_syscalls() would
> have made it win one level of indentation.
> 

yeah...I did that to add local variables at the beginning of the block
so I wouldn't get unused warnings. A separate function is probably
cleaner...will fix.


thanks,

-Jason

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 06/14] tracing: add tracing support for compat syscalls
  2010-03-22 20:21     ` Jason Baron
@ 2010-03-27  4:40       ` Frederic Weisbecker
  0 siblings, 0 replies; 31+ messages in thread
From: Frederic Weisbecker @ 2010-03-27  4:40 UTC (permalink / raw)
  To: Jason Baron
  Cc: mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx, mhiramat,
	heiko.carstens, benh, davem, lethal, schwidefsky, brueckner,
	tony.luck

On Mon, Mar 22, 2010 at 04:21:42PM -0400, Jason Baron wrote:
> On Sat, Mar 20, 2010 at 07:12:17AM +0100, Frederic Weisbecker wrote:
> > >  #else /* CONFIG_COMPAT */
> > >  
> > > +#define NR_syscalls_compat 0
> > > +
> > >  static inline int is_compat_task(void)
> > >  {
> > >  	return 0;
> > > diff --git a/include/trace/syscall.h b/include/trace/syscall.h
> > > index 8f5ac38..1cc1d1e 100644
> > > --- a/include/trace/syscall.h
> > > +++ b/include/trace/syscall.h
> > > @@ -22,6 +22,7 @@
> > >  struct syscall_metadata {
> > >  	const char	*name;
> > >  	int		syscall_nr;
> > > +	int		compat_syscall_nr;
> > 
> > 
> > 
> > Why do you need both syscall_nr and compat_syscall_nr?
> > Compat and usual syscalls never share the same syscall
> > metadata.
> > 
> > 
> 
> For example, something like 'sys_read()' is pointed to by both
> syscalls_metadata and compat_syscalls_metadata. Thus, the same syscall
> metadata record is referenced by two different tables. That said, I'm not
> making use of compat_syscall_nr. Although it could be added to the
> checks in 'reg_event_syscall_enter()', to make sure that the
> compat_syscall_nr is valid. 



Yep, but we need it to be referenced by two different tables
as normal and compat syscalls don't have the exact same
parameters. It is not about the same syscall metadata.

Once we'll get support for user pointer dereferencing to get
user parameters content in the traces, we'll need to build a
table of types to be aware of the type. And these types will
be different between compat and normal syscalls.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 07/14 re-post] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
  2010-03-18 18:29   ` [PATCH 07/14 re-post] " Jason Baron
@ 2010-03-27  4:56     ` Frederic Weisbecker
  0 siblings, 0 replies; 31+ messages in thread
From: Frederic Weisbecker @ 2010-03-27  4:56 UTC (permalink / raw)
  To: Jason Baron
  Cc: mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx, mhiramat,
	heiko.carstens, benh, davem, lethal, schwidefsky, brueckner,
	tony.luck

On Thu, Mar 18, 2010 at 02:29:09PM -0400, Jason Baron wrote:
> 
> Re-post due to missing macro parameter. interdiff:
> 
> diff -u b/include/linux/syscalls.h b/include/linux/syscalls.h
> --- b/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -241,7 +241,7 @@
>  	SYSCALL_METADATA(syscall, compat_sys_##sname, x);	\
>  	asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
>  #else
> -#define COMPAT_SYSCALL_DEFINEx(x, sname, ...)			\
> +#define COMPAT_SYSCALL_DEFINEx(x, syscall, sname, ...)		\
>  	asmlinkage long syscall(__SC_DECL##x(__VA_ARGS__))
>  #endif
> 
> --------------------------------------------------------
> 
> Add ARCH_COMPAT_SYSCALL_DEFINE#N() macro which prepends "sys32_" to
> arch specific compat syscall names. Identifies the 'compat' syscalls.
> 
> Signed-off-by: Jason Baron <jbaron@redhat.com>
> ---
>  include/linux/syscalls.h |   50 ++++++++++++++++++++++++++++++++++-----------
>  1 files changed, 38 insertions(+), 12 deletions(-)
> 
> 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,		\



BTW, removing the sys_ prefix would be a cool change but I'd prefer
we limit the ABI changes if possible (although I must confess
the ABI is going to be seriously damaged if we support user pointer
deref later :p)

Thanks.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (14 preceding siblings ...)
  2010-03-18 18:22 ` [PATCH 15/14] compat_syscalls: introduce CONFIG_COMPAT_FTRACE_SYSCALLS Jason Baron
@ 2010-03-27  5:00 ` Frederic Weisbecker
  2010-05-21  9:40 ` Ian Munsie
  16 siblings, 0 replies; 31+ messages in thread
From: Frederic Weisbecker @ 2010-03-27  5:00 UTC (permalink / raw)
  To: Jason Baron
  Cc: mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx, mhiramat,
	heiko.carstens, benh, davem, lethal, schwidefsky, brueckner,
	tony.luck

On Tue, Mar 16, 2010 at 01:46:08PM -0400, Jason Baron wrote:
> Hi,
> 
> Re-post to add infrastructure for compat syscall event tracing support. This
> patch series also adds x86_64 arch specific support as an example consumer
> of the new infrastructure.
> 
> Arches can request compat syscall tracing by setting: 
> __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS, if CONFIG_COMPAT and CONFIG_FTRACE_SYSCALLS
> are set. Arches then need to implement the following interfaces:
> 
> 1) int is_compat_task(void);
>   - most arches seem to have this already
> 2) unsigned long arch_compat_syscall_addr(int nr);
>   - returns a pointer to the compat syscall entry corresponding to syscall 'nr'
> 3) int NR_syscalls_compat;
>   - number of entries in the compat syscall table.
> 
> thanks,
> 
> -Jason
> 
> Changes in v3:
> 
>  - create a separate "compat_syscalls" event subsystem
>  - ARCH_COMPAT_SYSCALL_DEFINE#N() tacks "sys32" to start of syscall name
>  - COMPAT_SYSCALL_DEFINE#N() tacks "compat_sys" to start of syscall name
>  - both above macros create perf events as: [enter|exit]_compat_sys_blah
>  - non-compat syscall naming changes to: [enter|exit]_sys_blah
>  - removes any unreferenced compat syscalls from debugfs



Other than the small comments I had, it's a very nice stuff.
Just waiting for your next iteration before applying.

Thanks!


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  2010-03-16 17:46 [PATCH 00/14] tracing: add compat syscall support v3 Jason Baron
                   ` (15 preceding siblings ...)
  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
  16 siblings, 1 reply; 31+ messages in thread
From: Ian Munsie @ 2010-05-21  9:40 UTC (permalink / raw)
  To: Jason Baron; +Cc: fweisbec, mingo, rostedt, linux-kernel

Hi Jason,

I'm currently in the process of implementing syscall tracepoints for
PowerPC, and a considerable amount of my work is going to end up
requiring these patches of yours. I've reviewed and tested your patches
(and spent a good chunk of time rebasing them on top of
tip/tracing/core) and they all seem pretty good.

I *particularly* like the way in which they prevent ftrace syscalls from
reporting that sys_swapoff was constantly firing on x86_64 kernels with
a 32bit userspace ;)

Anyway, I'm just wondering if you have an ETA for the v4 patchset to
address the remaining issues that Frederic raised so that they can be
merged.

Cheers,
-Ian

Excerpts from Jason Baron's message of Wed Mar 17 04:46:08 +1100 2010:
> Hi,
> 
> Re-post to add infrastructure for compat syscall event tracing support. This
> patch series also adds x86_64 arch specific support as an example consumer
> of the new infrastructure.
> 
> Arches can request compat syscall tracing by setting: 
> __HAVE_ARCH_FTRACE_COMPAT_SYSCALLS, if CONFIG_COMPAT and CONFIG_FTRACE_SYSCALLS
> are set. Arches then need to implement the following interfaces:
> 
> 1) int is_compat_task(void);
>   - most arches seem to have this already
> 2) unsigned long arch_compat_syscall_addr(int nr);
>   - returns a pointer to the compat syscall entry corresponding to syscall 'nr'
> 3) int NR_syscalls_compat;
>   - number of entries in the compat syscall table.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  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
  0 siblings, 2 replies; 31+ messages in thread
From: Jason Baron @ 2010-05-21 13:24 UTC (permalink / raw)
  To: Ian Munsie; +Cc: fweisbec, mingo, rostedt, linux-kernel

On Fri, May 21, 2010 at 07:40:21PM +1000, Ian Munsie wrote:
> Hi Jason,
> 
> I'm currently in the process of implementing syscall tracepoints for
> PowerPC, and a considerable amount of my work is going to end up
> requiring these patches of yours. I've reviewed and tested your patches
> (and spent a good chunk of time rebasing them on top of
> tip/tracing/core) and they all seem pretty good.
> 
> I *particularly* like the way in which they prevent ftrace syscalls from
> reporting that sys_swapoff was constantly firing on x86_64 kernels with
> a 32bit userspace ;)
> 
> Anyway, I'm just wondering if you have an ETA for the v4 patchset to
> address the remaining issues that Frederic raised so that they can be
> merged.
> 
> Cheers,
> -Ian
> 

hi Ian,

I think the main issue left was that I am using the same meta data for
both the 32-bit and 64-bit table entries, when they reference the same
syscall. for example, for x86 both the compat and underlying 64-bit
kernel reference 'sys_rename'. Thus, i am pointing both perf events at
the same meta data. Frederic was saying they need to be separate. I'm
not sure i completely understand why, since the 32-bit are just sign
extended to 64-bit in this case. Frederic, perhaps, you can explain this
a bit more for me?

thanks,

-Jason

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  2010-05-21 13:24   ` Jason Baron
@ 2010-05-21 13:31     ` Frederic Weisbecker
  2010-06-17  7:39     ` Ian Munsie
  1 sibling, 0 replies; 31+ messages in thread
From: Frederic Weisbecker @ 2010-05-21 13:31 UTC (permalink / raw)
  To: Jason Baron; +Cc: Ian Munsie, mingo, rostedt, linux-kernel

On Fri, May 21, 2010 at 09:24:07AM -0400, Jason Baron wrote:
> On Fri, May 21, 2010 at 07:40:21PM +1000, Ian Munsie wrote:
> > Hi Jason,
> > 
> > I'm currently in the process of implementing syscall tracepoints for
> > PowerPC, and a considerable amount of my work is going to end up
> > requiring these patches of yours. I've reviewed and tested your patches
> > (and spent a good chunk of time rebasing them on top of
> > tip/tracing/core) and they all seem pretty good.
> > 
> > I *particularly* like the way in which they prevent ftrace syscalls from
> > reporting that sys_swapoff was constantly firing on x86_64 kernels with
> > a 32bit userspace ;)
> > 
> > Anyway, I'm just wondering if you have an ETA for the v4 patchset to
> > address the remaining issues that Frederic raised so that they can be
> > merged.
> > 
> > Cheers,
> > -Ian
> > 
> 
> hi Ian,
> 
> I think the main issue left was that I am using the same meta data for
> both the 32-bit and 64-bit table entries, when they reference the same
> syscall. for example, for x86 both the compat and underlying 64-bit
> kernel reference 'sys_rename'. Thus, i am pointing both perf events at
> the same meta data. Frederic was saying they need to be separate. I'm
> not sure i completely understand why, since the 32-bit are just sign
> extended to 64-bit in this case. Frederic, perhaps, you can explain this
> a bit more for me?
> 
> thanks,
> 
> -Jason


If they are pointing to the same function with the same parameters, then
yeah it's fine.

I think I worried about two different handlers that don't have the
exact same parameters (one having compat things, and the other having
not). But now that I think about it that's probably not what you did.

I'll give another shot to this patchset then, as I've probably confused
something, I just need to wait a bit for the giant patchset from Steve
on trace events to be applied, before applying this set. Should happen
soon.

Will look at this next week.
Thanks.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
  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-05-24  7:05   ` Ian Munsie
  2010-05-24 20:26     ` Jason Baron
  1 sibling, 1 reply; 31+ messages in thread
From: Ian Munsie @ 2010-05-24  7:05 UTC (permalink / raw)
  To: Jason Baron
  Cc: fweisbec, mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx,
	mhiramat, heiko.carstens, benh, davem, lethal, schwidefsky,
	brueckner, tony.luck

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

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 07/14] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE()
  2010-05-24  7:05   ` [PATCH 07/14] " Ian Munsie
@ 2010-05-24 20:26     ` Jason Baron
  0 siblings, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-05-24 20:26 UTC (permalink / raw)
  To: Ian Munsie
  Cc: fweisbec, mingo, rostedt, linux-kernel, laijs, lizf, hpa, tglx,
	mhiramat, heiko.carstens, benh, davem, lethal, schwidefsky,
	brueckner, tony.luck

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, ...)				\

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  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
  1 sibling, 2 replies; 31+ messages in thread
From: Ian Munsie @ 2010-06-17  7:39 UTC (permalink / raw)
  To: Jason Baron; +Cc: fweisbec, linux-kernel

Excerpts from Jason Baron's message of Fri May 21 23:24:07 +1000 2010:
> On Fri, May 21, 2010 at 07:40:21PM +1000, Ian Munsie wrote:
> > Hi Jason,
> > 
> > I'm currently in the process of implementing syscall tracepoints for
> > PowerPC, and a considerable amount of my work is going to end up
> > requiring these patches of yours. I've reviewed and tested your patches
> > (and spent a good chunk of time rebasing them on top of
> > tip/tracing/core) and they all seem pretty good.
> > 
> > I *particularly* like the way in which they prevent ftrace syscalls from
> > reporting that sys_swapoff was constantly firing on x86_64 kernels with
> > a 32bit userspace ;)
> > 
> > Anyway, I'm just wondering if you have an ETA for the v4 patchset to
> > address the remaining issues that Frederic raised so that they can be
> > merged.
> > 
> > Cheers,
> > -Ian
> > 
> 
> hi Ian,
> 
> I think the main issue left was that I am using the same meta data for
> both the 32-bit and 64-bit table entries, when they reference the same
> syscall. for example, for x86 both the compat and underlying 64-bit
> kernel reference 'sys_rename'. Thus, i am pointing both perf events at
> the same meta data. Frederic was saying they need to be separate. I'm
> not sure i completely understand why, since the 32-bit are just sign
> extended to 64-bit in this case. Frederic, perhaps, you can explain this
> a bit more for me?
> 
> thanks,
> 
> -Jason

Hi Jason,

I'm currently cleaning up my patch series for ftrace syscalls on PowerPC
and want to release it soon.

It's probably easiest for me if I release your compat syscall support v3
patches as part of the series. You'd still be marked as the author of
those commits - the only changes I have made to them was rebasing them
against the current tip tree and resolving the conflicts that I came
across.

Is that OK with you? Otherwise I can wait until you put out the v4
patches then rebase mine on top of those.

Cheers,
-Ian

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  2010-06-17  7:39     ` Ian Munsie
@ 2010-06-17  7:46       ` Frederic Weisbecker
  2010-06-17 15:39       ` Jason Baron
  1 sibling, 0 replies; 31+ messages in thread
From: Frederic Weisbecker @ 2010-06-17  7:46 UTC (permalink / raw)
  To: Ian Munsie; +Cc: Jason Baron, linux-kernel

On Thu, Jun 17, 2010 at 05:39:07PM +1000, Ian Munsie wrote:
> Excerpts from Jason Baron's message of Fri May 21 23:24:07 +1000 2010:
> > On Fri, May 21, 2010 at 07:40:21PM +1000, Ian Munsie wrote:
> > > Hi Jason,
> > > 
> > > I'm currently in the process of implementing syscall tracepoints for
> > > PowerPC, and a considerable amount of my work is going to end up
> > > requiring these patches of yours. I've reviewed and tested your patches
> > > (and spent a good chunk of time rebasing them on top of
> > > tip/tracing/core) and they all seem pretty good.
> > > 
> > > I *particularly* like the way in which they prevent ftrace syscalls from
> > > reporting that sys_swapoff was constantly firing on x86_64 kernels with
> > > a 32bit userspace ;)
> > > 
> > > Anyway, I'm just wondering if you have an ETA for the v4 patchset to
> > > address the remaining issues that Frederic raised so that they can be
> > > merged.
> > > 
> > > Cheers,
> > > -Ian
> > > 
> > 
> > hi Ian,
> > 
> > I think the main issue left was that I am using the same meta data for
> > both the 32-bit and 64-bit table entries, when they reference the same
> > syscall. for example, for x86 both the compat and underlying 64-bit
> > kernel reference 'sys_rename'. Thus, i am pointing both perf events at
> > the same meta data. Frederic was saying they need to be separate. I'm
> > not sure i completely understand why, since the 32-bit are just sign
> > extended to 64-bit in this case. Frederic, perhaps, you can explain this
> > a bit more for me?
> > 
> > thanks,
> > 
> > -Jason
> 
> Hi Jason,
> 
> I'm currently cleaning up my patch series for ftrace syscalls on PowerPC
> and want to release it soon.
> 
> It's probably easiest for me if I release your compat syscall support v3
> patches as part of the series. You'd still be marked as the author of
> those commits - the only changes I have made to them was rebasing them
> against the current tip tree and resolving the conflicts that I came
> across.



Perfect! I was about to ask Jason to rebase his patchset against latest -tip.

If you send this set, please also add your own Signed-off-by.

Thanks.


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PATCH 00/14] tracing: add compat syscall support v3
  2010-06-17  7:39     ` Ian Munsie
  2010-06-17  7:46       ` Frederic Weisbecker
@ 2010-06-17 15:39       ` Jason Baron
  1 sibling, 0 replies; 31+ messages in thread
From: Jason Baron @ 2010-06-17 15:39 UTC (permalink / raw)
  To: Ian Munsie; +Cc: fweisbec, linux-kernel

On Thu, Jun 17, 2010 at 05:39:07PM +1000, Ian Munsie wrote:
> Excerpts from Jason Baron's message of Fri May 21 23:24:07 +1000 2010:
> > On Fri, May 21, 2010 at 07:40:21PM +1000, Ian Munsie wrote:
> > > Hi Jason,
> > > 
> > > I'm currently in the process of implementing syscall tracepoints for
> > > PowerPC, and a considerable amount of my work is going to end up
> > > requiring these patches of yours. I've reviewed and tested your patches
> > > (and spent a good chunk of time rebasing them on top of
> > > tip/tracing/core) and they all seem pretty good.
> > > 
> > > I *particularly* like the way in which they prevent ftrace syscalls from
> > > reporting that sys_swapoff was constantly firing on x86_64 kernels with
> > > a 32bit userspace ;)
> > > 
> > > Anyway, I'm just wondering if you have an ETA for the v4 patchset to
> > > address the remaining issues that Frederic raised so that they can be
> > > merged.
> > > 
> > > Cheers,
> > > -Ian
> > > 
> > 
> > hi Ian,
> > 
> > I think the main issue left was that I am using the same meta data for
> > both the 32-bit and 64-bit table entries, when they reference the same
> > syscall. for example, for x86 both the compat and underlying 64-bit
> > kernel reference 'sys_rename'. Thus, i am pointing both perf events at
> > the same meta data. Frederic was saying they need to be separate. I'm
> > not sure i completely understand why, since the 32-bit are just sign
> > extended to 64-bit in this case. Frederic, perhaps, you can explain this
> > a bit more for me?
> > 
> > thanks,
> > 
> > -Jason
> 
> Hi Jason,
> 
> I'm currently cleaning up my patch series for ftrace syscalls on PowerPC
> and want to release it soon.
> 
> It's probably easiest for me if I release your compat syscall support v3
> patches as part of the series. You'd still be marked as the author of
> those commits - the only changes I have made to them was rebasing them
> against the current tip tree and resolving the conflicts that I came
> across.
> 
> Is that OK with you? Otherwise I can wait until you put out the v4
> patches then rebase mine on top of those.
> 

Hi Ian

if its easier for you, that's fine, feel free to include my patches with
your patchset.

thanks,

-Jason

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2010-06-17 15:39 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).