lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091201175221.GB5080@nowhere>
Date:	Tue, 1 Dec 2009 18:52:23 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	mingo@...hat.com, hpa@...or.com, linux-kernel@...r.kernel.org,
	rostedt@...dmis.org, jbaron@...hat.com, tglx@...utronix.de,
	laijs@...fujitsu.com, mingo@...e.hu
Cc:	linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] trace_syscalls: Simplify syscall profile

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--;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ