public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	rostedt@goodmis.org, jbaron@redhat.com, tglx@linutronix.de,
	laijs@cn.fujitsu.com, mingo@elte.hu
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/core] trace_syscalls: Remove unused event_syscall_enter and event_syscall_exit
Date: Tue, 1 Dec 2009 18:40:05 +0100	[thread overview]
Message-ID: <20091201174002.GA5080@nowhere> (raw)
In-Reply-To: <tip-bf56a4ea9f1683c5b223fd3a5dbea23f1fa91c34@git.kernel.org>

On Tue, Dec 01, 2009 at 04:42:35PM +0000, tip-bot for Lai Jiangshan wrote:
> Commit-ID:  bf56a4ea9f1683c5b223fd3a5dbea23f1fa91c34
> Gitweb:     http://git.kernel.org/tip/bf56a4ea9f1683c5b223fd3a5dbea23f1fa91c34
> Author:     Lai Jiangshan <laijs@cn.fujitsu.com>
> AuthorDate: Tue, 1 Dec 2009 16:23:20 +0800
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Tue, 1 Dec 2009 17:33:28 +0100
> 
> trace_syscalls: Remove unused event_syscall_enter and event_syscall_exit
> 
> fix event_enter_##sname->event
> fix event_exit_##sname->event
> 
> remove unused event_syscall_enter and event_syscall_exit
> 
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> Acked-by: Jason Baron <jbaron@redhat.com>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Cc: Frederic Weisbecker <fweisbec@gmail.com>
> LKML-Reference: <4B14D278.4090209@cn.fujitsu.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---



I'm confused.
Each syscall has a enter_syscall_print_##sname,
all of them are identical (they all map to print_syscall_enter())

OTOH we have event_syscall_enter, which is exactly
the same than enter_syscall_print_##sname.

But we are using a strange mix of them: we do that on
init: register_ftrace_event(&enter_syscall_print_##sname)
but we use event_syscall_enter as the "event" field
of the trace_event. It means that we unregister the wrong
event when we remove a module.

Thanks for fixing this!
But I think you fixed it the wrong way.

Why do we need a copy of this event_syscall_enter
for each syscall event?
Can't we actually drop enter_syscall_print_##sname
and always use event_syscall_enter instead?

The same applies to exit syscall events.

Thanks.




>  include/linux/syscalls.h      |    4 ++--
>  include/trace/syscall.h       |    2 --
>  kernel/trace/trace_syscalls.c |    8 --------
>  3 files changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index b50974a..2f7c539 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -178,7 +178,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused)     \
>  	  event_enter_##sname = {					\
>  		.name                   = "sys_enter"#sname,		\
>  		.system                 = "syscalls",			\
> -		.event                  = &event_syscall_enter,		\
> +		.event                  = &enter_syscall_print_##sname,	\
>  		.raw_init		= init_enter_##sname,		\
>  		.show_format		= syscall_enter_format,		\
>  		.define_fields		= syscall_enter_define_fields,	\
> @@ -214,7 +214,7 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *unused)     \
>  	  event_exit_##sname = {					\
>  		.name                   = "sys_exit"#sname,		\
>  		.system                 = "syscalls",			\
> -		.event                  = &event_syscall_exit,		\
> +		.event                  = &exit_syscall_print_##sname,	\
>  		.raw_init		= init_exit_##sname,		\
>  		.show_format		= syscall_exit_format,		\
>  		.define_fields		= syscall_exit_define_fields,	\
> diff --git a/include/trace/syscall.h b/include/trace/syscall.h
> index 51ee17d..5f8827c 100644
> --- a/include/trace/syscall.h
> +++ b/include/trace/syscall.h
> @@ -37,8 +37,6 @@ extern unsigned long arch_syscall_addr(int nr);
>  extern int syscall_name_to_nr(char *name);
>  void set_syscall_enter_id(int num, int id);
>  void set_syscall_exit_id(int num, int id);
> -extern struct trace_event event_syscall_enter;
> -extern struct trace_event event_syscall_exit;
>  
>  extern int syscall_enter_format(struct ftrace_event_call *call,
>  				struct trace_seq *s);
> diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
> index 63aa807..00d6e17 100644
> --- a/kernel/trace/trace_syscalls.c
> +++ b/kernel/trace/trace_syscalls.c
> @@ -444,14 +444,6 @@ void unreg_event_syscall_exit(struct ftrace_event_call *call)
>  	mutex_unlock(&syscall_trace_lock);
>  }
>  
> -struct trace_event event_syscall_enter = {
> -	.trace			= print_syscall_enter,
> -};
> -
> -struct trace_event event_syscall_exit = {
> -	.trace			= print_syscall_exit,
> -};
> -
>  int __init init_ftrace_syscalls(void)
>  {
>  	struct syscall_metadata *meta;


  reply	other threads:[~2009-12-01 17:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01  8:23 [PATCH 1/7] trace_syscalls: remove unused event_syscall_enter and event_syscall_exit Lai Jiangshan
2009-12-01 16:42 ` [tip:perf/core] trace_syscalls: Remove " tip-bot for Lai Jiangshan
2009-12-01 17:40   ` Frederic Weisbecker [this message]
2009-12-01 17:54   ` Frederic Weisbecker
2009-12-02  1:13     ` Lai Jiangshan
2009-12-02  4:24       ` Frederic Weisbecker

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=20091201174002.GA5080@nowhere \
    --to=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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