Re: [PATCH 2/3 -tip] perf_counter tools: Add support to set ofmultiple events in one shot

From: Jaswinder Singh Rajput
Date: Sat Jun 27 2009 - 15:06:09 EST


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

Let me know which option you are looking for.

Thanks,
--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/