Re: [PATCH 04/27] perf list: Add support for listing only json events

From: Ingo Molnar
Date: Sun Oct 16 2016 - 02:54:28 EST



* Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:

> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Add an argument to only list json events. To be used for the command
> line completion script. This requires adding a new flag to the alias
> structure.
>
> Committer notes:
>
> Using it:
>
> $ perf list json

Sigh, this is a pretty poor user interface. :-(

- 'JSON' is an internal data format used by the source code and by vendors to
publish event lists. perf might use something else in the future to store the
events (for example native .c/.h files) - we don't know. Why should the user
care or remember?

- Also, even if the user remembers, it's not clear that using a weird acronym
that does not mean much in itself is a good way to key off a high level user
interface. Acronyms Seriously Suck.

- The output of 'perf list help' is not really helpful either, so the user who
knows that there's "something" to list the vendor hardware events is still
stuck. Also, 'perf list hardware' will list the wrong things.

What we do know about the CPU vendor event names is that they are vendor specific,
and that's a pretty stable property. So my suggestion would be to simply make it:

perf list vendor

with perhaps add aliases as well:

perf list model
perf list cpu-model

... and 'perf list hardware' should probably also list all the vendor specific
hardware events as well.

Could we please work a bit more on making vendor specific hardware event handling
more usable to people who don't care about internals?

Thanks,

Ingo