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: <20091202231019.GB14770@Krystal>
Date:	Wed, 2 Dec 2009 18:10:19 -0500
From:	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Masami Hiramatsu <mhiramat@...hat.com>, akpm@...ux-foundation.org,
	Ingo Molnar <mingo@...e.hu>, mingo@...hat.com, hpa@...or.com,
	linux-kernel@...r.kernel.org, randy.dunlap@...cle.com,
	wcohen@...hat.com, fweisbec@...il.com, tglx@...utronix.de,
	jbaron@...hat.com, linux-tip-commits@...r.kernel.org,
	Christoph Hellwig <hch@....de>
Subject: Re: trace/events: DECLARE vs DEFINE semantic

* Steven Rostedt (rostedt@...dmis.org) wrote:
> On Wed, 2009-12-02 at 17:36 -0500, Masami Hiramatsu wrote:
> 
> > > Or do you (or anyone else) have a better name?
> > 
> > How about renaming DEFINE_EVENT to TRACE_EVENT_CLASS?
> > 
> > DECLARE_EVENT_CLASS(y, ...)	declare an event-class y
> > TRACE_EVENT_CLASS(x, y, ...)	define/declare a trace event x from event-class y
> > TRACE_EVENT(x, ...)		define/declare a trace event x
> > 
> > Thus TRACE_EVENT_* implies that this macro will be expanded
> > to both of definition and declaration.
> > I don't think separating it is good idea from the viewpoint
> > of maintaining code.
> 
> Hmm, what about just:
> 
> TRACE_CLASS - Declares a class
> TRACE_CLASS_EVENT - defines an event for said class
> TRACE_EVENT - Declares a class and defines an event (as is today)

In addition, I wonder if we should rename "CREATE_TRACE_POINTS" to
something more suitable while we are here ? Basically, it will affect
all TRACE_CLASS/TRACE_CLASS_EVENT/TRACE_EVENT from headers included
after it's defined.

It sounds to me that this "CREATE_TRACE_POINTS" is the define that
controls whether the TRACE_* will actually turn into a DECLARE or a
DEFINE. I agree that the standard behavior should be to "DECLARE" stuff,
as it's the, by far, most common case, but maybe

#define TRACE_DEFINE
#include <trace/events/....h>

would be more descriptive than "CREATE_TRACE_POINTS", given it refers to
the well-known "define" semantic ?

So if we happen to have C file which need many headers to be declared
but only some of them to be defined, we could express it as:

#include <trace/events/sched.h>
#include <trace/events/irq.h>
#include <trace/events/timer.h>

#define TRACE_DEFINE
#include <trace/events/irq.h>
#include <trace/events/timer.h>
#undef TRACE_DEFINE

That would imply that any definition of a trace event header should be
preceded by an inclusion of this same header to perform the declaration.
This would clearly separate the declaration from definition.

Does it make sense ?

Mathieu


-- 
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
--
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