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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090811100904.GA4938@nowhere>
Date:	Tue, 11 Aug 2009 12:09:07 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Jason Baron <jbaron@...hat.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
	rostedt@...dmis.org, peterz@...radead.org,
	mathieu.desnoyers@...ymtl.ca, jiayingz@...gle.com,
	mbligh@...gle.com, lizf@...fujitsu.com
Subject: Re: [PATCH 07/12] add ftrace_event_call void * 'data' field

On Mon, Aug 10, 2009 at 04:52:44PM -0400, Jason Baron wrote:
> add an optional * void pointer to 'ftrace_event_call' that is
> passed in for regfunc and unregfunc.
> 
> Signed-off-by: Jason Baron <jbaron@...hat.com>
> 
> ---
>  include/linux/ftrace_event.h |    5 +++--
>  include/trace/ftrace.h       |    4 ++--
>  kernel/trace/trace_events.c  |    4 ++--
>  3 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
> index ac8c6f8..8544f12 100644
> --- a/include/linux/ftrace_event.h
> +++ b/include/linux/ftrace_event.h
> @@ -112,8 +112,8 @@ struct ftrace_event_call {
>  	struct dentry		*dir;
>  	struct trace_event	*event;
>  	int			enabled;
> -	int			(*regfunc)(void);
> -	void			(*unregfunc)(void);
> +	int			(*regfunc)(void *);
> +	void			(*unregfunc)(void *);
>  	int			id;
>  	int			(*raw_init)(void);
>  	int			(*show_format)(struct trace_seq *s);
> @@ -122,6 +122,7 @@ struct ftrace_event_call {
>  	int			filter_active;
>  	struct event_filter	*filter;
>  	void			*mod;
> +	void			*data;
>  
>  	atomic_t		profile_count;
>  	int			(*profile_enable)(struct ftrace_event_call *);
> diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
> index 80e5f6c..a0de384 100644
> --- a/include/trace/ftrace.h
> +++ b/include/trace/ftrace.h
> @@ -568,7 +568,7 @@ static void ftrace_raw_event_##call(proto)				\
>  		trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
>  }									\
>  									\
> -static int ftrace_raw_reg_event_##call(void)				\
> +static int ftrace_raw_reg_event_##call(void *ptr)			\


Shouldn't it have a __used attribute here, or something?


>  {									\
>  	int ret;							\
>  									\
> @@ -579,7 +579,7 @@ static int ftrace_raw_reg_event_##call(void)				\
>  	return ret;							\
>  }									\
>  									\
> -static void ftrace_raw_unreg_event_##call(void)				\
> +static void ftrace_raw_unreg_event_##call(void *ptr)			\



Same here.



>  {									\
>  	unregister_trace_##call(ftrace_raw_event_##call);		\
>  }									\
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index f95f847..1d289e2 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -86,14 +86,14 @@ static void ftrace_event_enable_disable(struct ftrace_event_call *call,
>  		if (call->enabled) {
>  			call->enabled = 0;
>  			tracing_stop_cmdline_record();
> -			call->unregfunc();
> +			call->unregfunc(call->data);
>  		}
>  		break;
>  	case 1:
>  		if (!call->enabled) {
>  			call->enabled = 1;
>  			tracing_start_cmdline_record();
> -			call->regfunc();
> +			call->regfunc(call->data);
>  		}
>  		break;
>  	}
> -- 
> 1.6.2.5
> 

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