All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Jaswinder Singh Rajput <jaswinder@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3 -tip] perf_counter tools: Add support to set of multiple events in one shot
Date: Sun, 28 Jun 2009 15:29:26 +0200	[thread overview]
Message-ID: <20090628132926.GD31988@elte.hu> (raw)
In-Reply-To: <1246129498.32198.27.camel@hpdv5.satnam>


* Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:

> On Sat, 2009-06-27 at 18:38 +0200, Ingo Molnar wrote:
> > * Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
> > 
> > > Add support for HARDWARE and SOFTWARE events :
> > >  perf stat -e all-sw-events
> > >  perf stat -e sw-events
> > >  perf stat -e all-hw-events
> > >  perf stat -e hw-events
> > 
> > > +static struct event_type_symbol event_type_symbols[] = {
> > > + [PERF_TYPE_HARDWARE]	= { "hw-events",	"all-hw-events",	},
> > > + [PERF_TYPE_SOFTWARE]	= { "sw-events",	"all-sw-events",	},
> > 
> > Hm, this really just special-cases and open-codes these. The better 
> > solution is what i suggested in my review of your prior patches: 
> > regex pattern matching.
> > 
> 
> parse_events() is responsible to parse events for 'perf stat -e' 
> and it is parsing by parse_event_symbol()
> 
> If you want to use regex pattern matching then either we should 
> make some another option or if we need to rewrite 
> parse_event_symbol to use regex pattern matching which will be 
> applicable to all the events.

As i mentioned it before, i think the most intuitive solution is to 
extend the --event syntax with regex patterns. No new option - just 
richer -e syntax.

We could have this syntax:

  hw-cpu-cycles
  hw-instructions
  hw-cache-references
  hw-cache-misses
  hw-branch-instructions
  hw-branch-misses
  hw-bus-cycles

  sw-cpu-clock
  sw-task-clock
  sw-page-faults
  sw-minor-faults
  sw-major-faults
  sw-context-switches
  sw-cpu-migrations

regex patterns like:

  hw-*
  sw-*
  *

the first one would select all hardware events - the second all 
software events - the third all events in general. But other regex 
patterns make sense too, like:

  *branch*
  *cache*
  *fault*

And as the number of generic events increases, so will regex 
patterns become more and more useful.

	Ingo

  reply	other threads:[~2009-06-28 13:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-26 21:30 [GIT PULL -tip][PATCH 0/3 -tip] perf stat patches Jaswinder Singh Rajput
2009-06-26 21:32 ` [PATCH 1/3 -tip] perf stat: fix stat output Jaswinder Singh Rajput
2009-06-26 21:33   ` [PATCH 2/3 -tip] perf_counter tools: Add support to set of multiple events in one shot Jaswinder Singh Rajput
2009-06-26 21:35     ` [PATCH 3/3 -tip] perf_counter tools: Add support for all CACHE events Jaswinder Singh Rajput
2009-06-27 16:38     ` [PATCH 2/3 -tip] perf_counter tools: Add support to set of multiple events in one shot Ingo Molnar
2009-06-27 19:04       ` Jaswinder Singh Rajput
2009-06-28 13:29         ` Ingo Molnar [this message]
2009-06-28 15:16           ` Jaswinder Singh Rajput
2009-06-29  3:57             ` Ingo Molnar
2009-06-30  8:38               ` Jaswinder Singh Rajput
2009-06-30  9:57                 ` Ingo Molnar
2009-06-30 13:22                   ` Jaswinder Singh Rajput
2009-06-30 22:47                     ` Ingo Molnar
2009-06-27 17:31   ` [tip:perfcounters/urgent] perf stat: Improve output tip-bot for Jaswinder Singh Rajput
2009-06-29 17:11     ` Peter Zijlstra
2009-06-29 19:52       ` 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=20090628132926.GD31988@elte.hu \
    --to=mingo@elte.hu \
    --cc=jaswinder@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.