lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 28 Jun 2009 15:29:26 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Jaswinder Singh Rajput <jaswinder@...nel.org>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3 -tip] perf_counter tools: Add support to set of
	multiple events in one shot


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

> On Sat, 2009-06-27 at 18:38 +0200, Ingo Molnar wrote:
> > * Jaswinder Singh Rajput <jaswinder@...nel.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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ