linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Ian Munsie <imunsie@au1.ibm.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
	Arnd Bergmann <arnd@arndb.de>, Jason Baron <jbaron@redhat.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
	Ingo Molnar <mingo@redhat.com>, Paul Mackerras <paulus@samba.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Masami Hiramatsu <mhiramat@redhat.com>
Subject: Re: [PATCH 10/40] tracing: add tracing support for compat syscalls
Date: Wed, 23 Jun 2010 11:26:26 -0400	[thread overview]
Message-ID: <1277306786.9181.51.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1277287401-28571-11-git-send-email-imunsie@au1.ibm.com>

On Wed, 2010-06-23 at 20:02 +1000, Ian Munsie wrote:
> From: Jason Baron <jbaron@redhat.com>
> 
> 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>
> Signed-off-by: Ian Munsie <imunsie@au1.ibm.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 ab638e9..a94f13d 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -363,6 +363,8 @@ extern ssize_t compat_rw_copy_check_uvector(int type,
>  
>  #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 75f3dce..67d4e64 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;

This is also bloating the kernel. I don't like to add fields to the
syscall_metadata lightly.

You're adding 4 more bytes to this structure to handle a few items. Find
a better way to do this.

>  	int		nb_args;
>  	const char	**types;
>  	const char	**args;
> @@ -38,6 +39,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 reg_event_syscall_enter(struct ftrace_event_call *call);
> diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
> index 01ce088..53ace4b 100644
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -79,12 +79,14 @@ enum trace_type {
>  struct syscall_trace_enter {
>  	struct trace_entry	ent;
>  	int			nr;
> +	int			compat;

You're adding 4 bytes to a trace (taking up precious buffer space) for a
single flag. If anything, set the 31st bit of nr if it is compat.

-- Steve

>  	unsigned long		args[];
>  };
>  
>  struct syscall_trace_exit {
>  	struct trace_entry	ent;
>  	int			nr;
> +	int			compat;
>  	long			ret;
>  };
>  

  reply	other threads:[~2010-06-23 15:26 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 10:02 ftrace syscalls, PowerPC: Various fixes, Compat Syscall support and PowerPC implementation, V2 Ian Munsie
2010-06-23 10:02 ` [PATCH 01/40] ftrace syscalls: don't add events for unmapped syscalls Ian Munsie
2010-06-23 15:02   ` Steven Rostedt
2010-06-29  1:18     ` Ian Munsie
2010-06-23 10:02 ` [PATCH 02/40] ftrace syscalls: Make arch_syscall_addr weak Ian Munsie
2010-06-23 10:02 ` [PATCH 03/40] ftrace syscalls: Allow arch specific syscall symbol matching Ian Munsie
2010-06-23 10:02 ` [PATCH 04/40] trace, powerpc: Implement raw syscall tracepoints on PowerPC Ian Munsie
2010-06-23 10:02 ` [PATCH 05/40] x86: add NR_syscalls_compat, make ia32 syscall table visible Ian Munsie
2010-06-23 10:02 ` [PATCH 06/40] x86: add arch_compat_syscall_addr() Ian Munsie
2010-06-23 10:02 ` [PATCH 07/40] compat: have generic is_compat_task for !CONFIG_COMPAT Ian Munsie
2010-06-23 10:02 ` [PATCH 08/40] tracing: remove syscall bitmaps in preparation for compat support Ian Munsie
2010-06-23 15:16   ` Steven Rostedt
2010-06-23 19:14     ` Jason Baron
2010-06-23 19:34       ` Jason Baron
2010-06-23 19:45         ` Steven Rostedt
2010-06-23 10:02 ` [PATCH 09/40] tracing: move __start_ftrace_events and __stop_ftrace_events to header file Ian Munsie
2010-06-23 10:02 ` [PATCH 10/40] tracing: add tracing support for compat syscalls Ian Munsie
2010-06-23 15:26   ` Steven Rostedt [this message]
2010-06-23 16:02     ` Frederic Weisbecker
2010-06-23 10:02 ` [PATCH 11/40] syscalls: add ARCH_COMPAT_SYSCALL_DEFINE() Ian Munsie
2010-06-23 10:02 ` [PATCH 12/40] x86, compat: convert ia32 layer to use Ian Munsie
2010-06-23 10:14   ` Christoph Hellwig
2010-06-23 10:36     ` Frederic Weisbecker
2010-06-23 10:46       ` Christoph Hellwig
2010-06-23 11:41         ` Frederic Weisbecker
2010-06-23 19:23           ` H. Peter Anvin
2010-06-24 14:37             ` Christoph Hellwig
2010-06-23 10:02 ` [PATCH 13/40] syscalls: add new COMPAT_SYSCALL_DEFINE#N() macro Ian Munsie
2010-06-23 10:02 ` [PATCH 14/40] compat: convert to use COMPAT_SYSCALL_DEFINE#N() Ian Munsie
2010-06-23 10:02 ` [PATCH 15/40] compat: convert fs compat to use COMPAT_SYSCALL_DEFINE#N() macros Ian Munsie
2010-06-23 10:02 ` [PATCH 16/40] tags: recognize compat syscalls Ian Munsie
2010-06-24 12:02   ` Michal Marek
2010-06-23 10:02 ` [PATCH 17/40] tracing: make a "compat_syscalls" tracing subsys Ian Munsie
2010-06-23 10:02 ` [PATCH 18/40] compat_syscalls: introduce CONFIG_COMPAT_FTRACE_SYSCALLS Ian Munsie
2010-06-23 10:03 ` [PATCH 19/40] trace syscalls: Remove redundant syscall_nr checks Ian Munsie
2010-06-23 10:03 ` [PATCH 20/40] trace syscalls: Considder compat_syscall_nr when verifying syscall_nr Ian Munsie
2010-06-23 10:03 ` [PATCH 21/40] trace syscalls, PPC: Add ftrace compat syscall support for PPC64 Ian Munsie
2010-06-23 10:03 ` [PATCH 22/40] trace syscalls, PPC: Convert syscalls to SYSCALL_DEFINE Ian Munsie
2010-06-23 10:03 ` [PATCH 23/40] trace syscalls, PPC: Convert ppc32 compat syscalls to COMPAT_SYSCALL Ian Munsie
2010-06-23 10:03 ` [PATCH 24/40] trace syscalls, PPC: Convert more " Ian Munsie
2010-06-23 10:03 ` [PATCH 25/40] trace syscalls: Refactor syscall metadata creation Ian Munsie
2010-06-23 10:03 ` [PATCH 26/40] trace syscalls, PPC: Add PPC_REGS_SYSCALL_DEFINE macros Ian Munsie
2010-06-23 10:03 ` [PATCH 27/40] trace syscalls: Add COMPAT_SYSCALL_DEFINE0 macro Ian Munsie
2010-06-23 10:03 ` [PATCH 28/40] trace syscalls, PPC: Convert syscalls using regs to REGS_SYSCALL_DEFINE macros Ian Munsie
2010-06-23 10:03 ` [PATCH 29/40] trace syscalls, PPC: Convert ppc32_ syscalls to ARCH_COMPAT_SYSCALL_DEFINE Ian Munsie
2010-06-23 10:03 ` [PATCH 30/40] trace syscalls: Convert remaining kernel/compat.c syscalls to COMPAT_SYSCALL_DEFINE Ian Munsie
2010-06-23 10:03 ` [PATCH 31/40] trace syscalls: Convert various generic compat syscalls Ian Munsie
2010-06-23 10:19   ` Andi Kleen
2010-06-23 10:29     ` Frederic Weisbecker
2010-06-23 10:37       ` Andi Kleen
2010-06-23 11:38         ` Frederic Weisbecker
2010-06-23 12:35           ` Andi Kleen
2010-06-23 12:41             ` Christoph Hellwig
2010-06-23 15:51           ` H. Peter Anvin
2010-06-24 12:05         ` Michal Marek
2010-06-23 10:30     ` KOSAKI Motohiro
2010-06-23 10:03 ` [PATCH 32/40] trace syscalls: Record metadata for syscalls with their own wrappers Ian Munsie
2010-06-23 10:03 ` [PATCH 33/40] trace syscalls: Infrastructure for syscalls different return types Ian Munsie
2010-06-23 10:03 ` [PATCH 34/40] trace syscalls: Convert generic syscalls without long return type Ian Munsie
2010-06-23 10:03 ` [PATCH 35/40] trace syscalls, PPC: Convert PPC syscalls without long return types Ian Munsie
2010-06-23 10:03 ` [PATCH 36/40] trace syscalls: Early terminate search for sys_ni_syscall Ian Munsie
2010-06-23 10:03 ` [PATCH 37/40] trace syscalls: Print out unmapped syscalls at boot Ian Munsie
2010-06-23 10:03 ` [PATCH 38/40] trace syscalls: Remove redundant test for unmapped compat syscalls Ian Munsie
2010-06-23 10:03 ` [PATCH 39/40] trace syscalls: Clean confusing {s, r, }name and fix ABI breakage Ian Munsie
2010-06-23 18:03   ` [PATCH 39/40] trace syscalls: Clean confusing {s,r,}name " Jason Baron
2010-06-29  1:02     ` [PATCH 39/40] trace syscalls: Clean confusing {s, r, }name " Ian Munsie
2010-06-23 10:03 ` [PATCH 40/40] trace syscalls, PPC: Convert morphing native/compat syscalls Ian Munsie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1277306786.9181.51.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=fweisbec@gmail.com \
    --cc=imunsie@au1.ibm.com \
    --cc=jbaron@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mhiramat@redhat.com \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).