lkml.org 
[lkml]   [2009]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [tip:perf/core] events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS()
From
Date
On Fri, 2009-11-27 at 00:13 +0100, Frederic Weisbecker wrote:

> >
> > 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()
>
>
> It tells so much that it is confusing :)

Information overload huh? ;-)

>
>
> >
> > 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, ...);
>
>
>
> Yep, or DEFINE_EVENT_NOCLASS.

Well it may not be upper class, but I wouldn't say it has no class ;-)

But seriously, that is more misleading. It is a class. Remember, that
TRACE_EVENT is both a class and a define. With the new names for
template trace_event is:

#define TRACE_EVENT(name, ...) \
DECLARE_EVENT_CLASS(name, ...); \
DEFINE_EVENT(name, name, ...);

So TRACE_EVENT really is a DECLARE_CLASS_AND_DEFINE_EVENT(name, ...);

-- Steve

>
>
>
> > DEFINE_EVENT(bar, zoo, ...);
> >
> >
> > May work.
> >
> > -- Steve
> >
> >
>



\
 
 \ /
  Last update: 2009-11-27 04:55    [W:0.064 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site