mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	fweisbec@gmail.com, penberg@cs.helsinki.fi, tglx@linutronix.de,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/core] events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS()
Date: Thu, 26 Nov 2009 09:40:39 +0100	[thread overview]
Message-ID: <20091126084039.GA15919@elte.hu> (raw)
In-Reply-To: <1259224390.21397.87.camel@gandalf.stny.rr.com>


* Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu, 2009-11-26 at 08:16 +0000, tip-bot for Ingo Molnar wrote:
> > Commit-ID:  091ad3658e3c76c5fb05f65bfb64a0246f8f31b5
> > Gitweb:     http://git.kernel.org/tip/091ad3658e3c76c5fb05f65bfb64a0246f8f31b5
> > Author:     Ingo Molnar <mingo@elte.hu>
> > AuthorDate: Thu, 26 Nov 2009 09:04:55 +0100
> > Committer:  Ingo Molnar <mingo@elte.hu>
> > CommitDate: Thu, 26 Nov 2009 09:04:55 +0100
> > 
> > events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS()
> > 
> > It is not quite obvious at first sight what TRACE_EVENT_TEMPLATE
> > does: does it define an event as well beyond defining a template?
> > 
> > To clarify this, rename it to DECLARE_EVENT_CLASS, which follows
> > the various 'DECLARE_*()' idioms we already have in the kernel:
> > 
> >   DECLARE_EVENT_CLASS(class)
> > 
> >     DEFINE_EVENT(class, event1)
> >     DEFINE_EVENT(class, event2)
> >     DEFINE_EVENT(class, event3)
> > 
> > To complete this logic we should also rename TRACE_EVENT() to:
> > 
> >   DEFINE_SINGLE_EVENT(single_event)
> > 
> > ... but in a more quiet moment of the kernel cycle.
> 
> 
> 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.)

> A lot of developers have just learned about TRACE_EVENT and now it 
> just disappeared. Well, not really, but in the sense of ' find 
> linux.git -name '*.[ch]' | xargs grep TRACE_EVENT' it no longer 
> exists.

A second problem with the TRACE_EVENT name is that it's not just for 
tracing - we dont necessarily 'trace' events here. We can use the event 
callbacks to collect pure counts:

| aldebaran> perf stat -e sched:sched_wakeup ./hackbench 10
| Time: 0.093
|
|  Performance counter stats for './hackbench 10':
|
|           15481  sched:sched_wakeup      
|
|     0.107390574  seconds time elapsed

etc.

A third problem is that the name 'TRACE_EVENT' does not tell us what is 
being done. Do we declare it? Do we also define it?

DEFINE_SINGLE_EVENT() solves all these problems:

 - It's obvious what it does

 - It suggests users of it that there's another non-single-event 
   facility, gently nudging them towards the use of the more efficient
   DEFINE_EVENT_CLASS() + DEFINE_EVENT() method.

 - It fits nicely into the rest of the naming scheme.

	Ingo

  reply	other threads:[~2009-11-26  8:40 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26  7:02 [PATCH 0/9] tracing: Convert some trace events to DEFINE_TRACE Li Zefan
2009-11-26  7:03 ` [PATCH 1/9] tracing: Convert module refcnt events to DEFINE_EVENT Li Zefan
2009-11-26  8:42   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:04 ` [PATCH 2/9] tracing: Convert some kmem " Li Zefan
2009-11-26  7:24   ` Pekka Enberg
2009-11-26  7:38     ` Steven Rostedt
2009-11-26  7:57     ` Ingo Molnar
2009-11-26  8:29       ` Steven Rostedt
2009-11-26  8:16   ` [tip:perf/core] events: Rename TRACE_EVENT_TEMPLATE() to DECLARE_EVENT_CLASS() tip-bot for Ingo Molnar
2009-11-26  8:33     ` Steven Rostedt
2009-11-26  8:40       ` Ingo Molnar [this message]
2009-11-26 14:45         ` Steven Rostedt
2009-11-26 17:55           ` Frederic Weisbecker
2009-11-26 18:12             ` Ingo Molnar
2009-11-26 19:12               ` Steven Rostedt
2009-11-26 19:20                 ` Ingo Molnar
2009-11-26 19:44                   ` Steven Rostedt
2009-11-26 19:47                     ` Steven Rostedt
2009-11-26 23:13                     ` Frederic Weisbecker
2009-11-27  3:52                       ` Steven Rostedt
2009-11-26  8:42   ` [tip:perf/core] tracing: Convert some kmem events to DEFINE_EVENT tip-bot for Li Zefan
2009-11-26 12:34   ` [tip:perf/core] tracing: Fix kmem event exports tip-bot for Ingo Molnar
2009-11-26  7:04 ` [PATCH 3/9] tracing: Convert softirq events to DEFINE_EVENT Li Zefan
2009-11-26  8:43   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:05 ` [PATCH 4/9] tracing: Convert some workqueue " Li Zefan
2009-11-26  8:43   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:05 ` [PATCH 5/9] tracing: Convert some power " Li Zefan
2009-11-26  8:43   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:06 ` [PATCH 6/9] tracing: Convert some block " Li Zefan
2009-11-26  8:36   ` Jens Axboe
2009-11-26  8:44     ` Ingo Molnar
2009-11-26  8:47       ` Jens Axboe
2009-11-26  8:50         ` Ingo Molnar
2009-11-26  8:52           ` Jens Axboe
2009-11-26  8:43   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:06 ` [PATCH 7/9] tracing: Convert some jbd2 " Li Zefan
2009-11-26  8:44   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:07 ` [PATCH 8/9] tracing: Convert some ext4 events to DEFINE_TRACE Li Zefan
2009-11-26  8:44   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:08 ` [PATCH 9/9] tracing: Restore original format of sched events Li Zefan
2009-11-26  8:44   ` [tip:perf/core] " tip-bot for Li Zefan
2009-11-26  7:32 ` [PATCH 0/9] tracing: Convert some trace events to DEFINE_TRACE Steven Rostedt
2009-11-26  7:59   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091126084039.GA15919@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=penberg@cs.helsinki.fi \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®