Re: [tip:perf/core] events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2009-11-26 at 20:20 +0100, Ingo Molnar wrote:
> * Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > DECLARE_DEFINE_EVENT?  *naw*
> > 
> > DEFINE_DECLARED_EVENT?
> > 
> > Or we could go with DECLARE_EVENT(), DECLARE_EVENT_CLASS() and 
> > DEFINE_EVENT_CLASS_INSTANCE()?
> 
> I think the most common one should be the shortest, and the most common 
> one will be DEFINE_EVENT() - that's short enough already IMO.

The above were ideas for replacing TRACE_EVENT, not the current
DEFINE_EVENT.

> 
> I think we generally want to encourage the creation of classes of 
> events, not myriads of standalone events, each with their own call 
> signature, record format and printouts.
> 
> In that sense making the TRACE_EVENT() one longer would achieve that 
> goal of discouraging its over-use: DEFINE_SINGLE_EVENT() tells the 
> developer that it's an event of it's kind.

But I do agree with Frederic that this can be a little confusing, since
it makes it sound like DEFINE_EVENT is for multiple events.

What about saying exactly what it does?

DECLARE_AND_DEFINE_EVENT()


Come to think of it, since current TRACE_EVENT is now just:

#define TRACE_EVENT() \
	TRACE_EVENT_TEMPLATE() \
	DEFINE_EVENT

This may make the most sense. I haven't tried it, but I believe that you
could even base other events off of the TRACE_EVENT. That is:

TRACE_EVENT(x, ...);

DEFINE_EVENT(x, y, ...);

And y would use x as its class.

So going back to your scheme of DECLARE_EVENT_CLASS(), it may make sense
to have DECLARE_AND_DEFINE_EVENT().


DECLARE_EVENT_CLASS(class, ...);
DEFINE_EVENT(class, foo, ...);

DECLARE_AND_DEFINE_EVENT(bar, ...);

DEFINE_EVENT(bar, zoo, ...);


May work.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux