[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091126181205.GA18670@elte.hu>
Date: Thu, 26 Nov 2009 19:12:05 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Frederic Weisbecker <fweisbec@...il.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, mingo@...hat.com,
hpa@...or.com, linux-kernel@...r.kernel.org,
penberg@...helsinki.fi, tglx@...utronix.de,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] events: Rename TRACE_EVENT_TEMPLATE() to
DECLARE_EVENT_CLASS()
* Frederic Weisbecker <fweisbec@...il.com> wrote:
> On Thu, Nov 26, 2009 at 09:45:30AM -0500, Steven Rostedt wrote:
> > On Thu, 2009-11-26 at 09:40 +0100, Ingo Molnar wrote:
> > > * Steven Rostedt <rostedt@...dmis.org> wrote:
> > >
> >
> > > > I would like to hear what others think about this change before we go
> > > > ahead and implement it.
> > >
> > > You mean TRACE_EVENT() -> DEFINE_SINGLE_EVENT()? Sure, we want todo it
> > > in a more quiet moment of the kernel cycle, not now.
> > >
> > > (TRACE_EVENT_TEMPLATE OTOH has existed for just a few days so it's not a
> > > problem.)
> >
> > Yes the template name is new, I'm not talking about that on
> > particularly.
>
> I personally don't mind much about the name, especially between class
> and template. Both make equally sense to me.
>
> But DECLARE sounds like a misnomer here (like DEFINE_EVENT somehow) as
> TRACE_EVENT, DEFINE_EVENT and TRACE_EVENT_TEMPLATE all behave either
> as a declaration or a definition, depending on the CREATE_TRACE_POINT
> macro.
DECLARE_EVENT_CLASS() doesnt really define an event visible to the user
yet though. It defines functions internally (to be used by the real
definition of the event) - but not visible externally really.
So the real 'definition' of an event happens with DEFINE_EVENT() - in
the logical model of this.
So the logical model is clear:
DECLARE_EVENT_CLASS(class);
DEFINE_EVENT(class, event1);
DEFINE_EVENT(class, event2);
DEFINE_EVENT(class, event3);
...
# later:
# DEFINE_STANDALONE_EVENT(event)
And the logical model is what matters: that's what developers will use.
They'll use these constructs based on the logical model, nobody sane
will look into the CPP magic ;-)
And yes, we occasionally have to revisit our naming choices - especially
when mistakes/misnomers become apparent.
Thanks,
Ingo
--
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