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: Simplify syscall profile
Date: Tue, 1 Dec 2009 18:52:23 +0100 [thread overview]
Message-ID: <20091201175221.GB5080@nowhere> (raw)
In-Reply-To: <tip-3bbe84e9d385205d638035ee9dcc4db1b486ea08@git.kernel.org>
On Tue, Dec 01, 2009 at 04:43:44PM +0000, tip-bot for Lai Jiangshan wrote:
> -int reg_prof_syscall_enter(char *name)
> +int prof_sysenter_enable(struct ftrace_event_call *call)
> {
> int ret = 0;
> int num;
>
> - num = syscall_name_to_nr(name);
> - if (num < 0 || num >= NR_syscalls)
> - return -ENOSYS;
> + num = ((struct syscall_metadata *)call->data)->syscall_nr;
Now that you use the above construct very often. Could you please
wrap it using a quick helper?
This will be more proper than having this explicit scary cast
everywhere :)
Thanks.
>
> mutex_lock(&syscall_trace_lock);
> if (!sys_prof_refcount_enter)
> @@ -543,13 +541,11 @@ int reg_prof_syscall_enter(char *name)
> return ret;
> }
>
> -void unreg_prof_syscall_enter(char *name)
> +void prof_sysenter_disable(struct ftrace_event_call *call)
> {
> int num;
>
> - num = syscall_name_to_nr(name);
> - if (num < 0 || num >= NR_syscalls)
> - return;
> + num = ((struct syscall_metadata *)call->data)->syscall_nr;
>
> mutex_lock(&syscall_trace_lock);
> sys_prof_refcount_enter--;
> @@ -625,14 +621,12 @@ end_recursion:
> local_irq_restore(flags);
> }
>
> -int reg_prof_syscall_exit(char *name)
> +int prof_sysexit_enable(struct ftrace_event_call *call)
> {
> int ret = 0;
> int num;
>
> - num = syscall_name_to_nr(name);
> - if (num < 0 || num >= NR_syscalls)
> - return -ENOSYS;
> + num = ((struct syscall_metadata *)call->data)->syscall_nr;
>
> mutex_lock(&syscall_trace_lock);
> if (!sys_prof_refcount_exit)
> @@ -648,13 +642,11 @@ int reg_prof_syscall_exit(char *name)
> return ret;
> }
>
> -void unreg_prof_syscall_exit(char *name)
> +void prof_sysexit_disable(struct ftrace_event_call *call)
> {
> int num;
>
> - num = syscall_name_to_nr(name);
> - if (num < 0 || num >= NR_syscalls)
> - return;
> + num = ((struct syscall_metadata *)call->data)->syscall_nr;
>
> mutex_lock(&syscall_trace_lock);
> sys_prof_refcount_exit--;
prev parent reply other threads:[~2009-12-01 17:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-01 8:24 [PATCH 6/7] trace_syscalls: simplify syscall profile Lai Jiangshan
2009-12-01 16:43 ` [tip:perf/core] trace_syscalls: Simplify " tip-bot for Lai Jiangshan
2009-12-01 17:52 ` Frederic Weisbecker [this message]
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=20091201175221.GB5080@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