Re: [PATCH 4/6] tracing: add tracing support for compat syscalls

Heiko Carstens
2010-02-03T12:52:55Z

On Tue, Feb 02, 2010 at 04:21:51PM -0500, Jason Baron wrote:
> 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 | 8 +++++
> include/trace/syscall.h | 4 ++
> kernel/trace/trace.h | 2 +
> kernel/trace/trace_syscalls.c | 63 +++++++++++++++++++++++++++++++++++-----
> 4 files changed, 69 insertions(+), 8 deletions(-)
>
> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index ef68119..ab2cda2 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -353,5 +353,13 @@ 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 */
> +
> +#define NR_syscalls_compat 0
> +static inline int is_compat_task(void)
> +{
> + return 0;
> +}
> +
> #endif /* CONFIG_COMPAT */
> #endif /* _LINUX_COMPAT_H */

This part will break compilation on s390, since it has already the same
function defined for !CONFIG_COMPAT.
In order to avoid the whole ifdef mess some s390 files do include
asm/compat.h instead of linux/compat.h. This will get messy :)