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

Ingo Molnar
2009-06-27T16:38:51Z

* 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.

Ingo