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: <alpine.DEB.2.00.0903171853540.10610@gandalf.stny.rr.com>
Date:	Tue, 17 Mar 2009 18:54:36 -0400 (EDT)
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
cc:	mingo@...e.hu, paulus@...ba.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 05/11] ftrace: ensure every event gets an id


On Tue, 17 Mar 2009, Peter Zijlstra wrote:

> Previously only TRACE_EVENT events got ids, because only they generated
> raw output which needs to be demuxed from the trace.
> 
> In order to provide a unique ID for each event, register everybody, regardless.

If this is about the TRACE_FORMAT, they use the TRACE_PRINT format, which
is exported.

Again, I need to look at the rest of the patches ;-)

-- Steve

> 
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> ---
>  kernel/trace/trace_events_stage_3.h |   15 ++++++++++++++-
>  kernel/trace/trace_output.c         |    5 +++++
>  2 files changed, 19 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6/kernel/trace/trace_events_stage_3.h
> ===================================================================
> --- linux-2.6.orig/kernel/trace/trace_events_stage_3.h
> +++ linux-2.6/kernel/trace/trace_events_stage_3.h
> @@ -130,7 +130,19 @@ static void ftrace_unreg_event_##call(vo
>  {									\
>  	unregister_trace_##call(ftrace_event_##call);			\
>  }									\
> -
> +									\
> +static struct ftrace_event_call event_##call;				\
> +									\
> +static int ftrace_init_event_##call(void)				\
> +{									\
> +	int id;								\
> +									\
> +	id = register_ftrace_event(NULL);				\
> +	if (!id)							\
> +		return -ENODEV;						\
> +	event_##call.id = id;						\
> +	return 0;							\
> +}
>  
>  #undef TRACE_FORMAT
>  #define TRACE_FORMAT(call, proto, args, fmt)				\
> @@ -140,6 +152,7 @@ __attribute__((__aligned__(4)))						\
>  __attribute__((section("_ftrace_events"))) event_##call = {		\
>  	.name			= #call,				\
>  	.system			= __stringify(TRACE_SYSTEM),		\
> +	.raw_init		= ftrace_init_event_##call,		\
>  	.regfunc		= ftrace_reg_event_##call,		\
>  	.unregfunc		= ftrace_unreg_event_##call,		\
>  }
> Index: linux-2.6/kernel/trace/trace_output.c
> ===================================================================
> --- linux-2.6.orig/kernel/trace/trace_output.c
> +++ linux-2.6/kernel/trace/trace_output.c
> @@ -444,6 +444,11 @@ int register_ftrace_event(struct trace_e
>  
>  	mutex_lock(&trace_event_mutex);
>  
> +	if (!event) {
> +		ret = next_event_type++;
> +		goto out;
> +	}
> +
>  	if (!event->type)
>  		event->type = next_event_type++;
>  	else if (event->type > __TRACE_LAST_TYPE) {
> 
> -- 
> 
> 
--
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