Re: perf: Add support for full Intel event lists v7

From: Andi Kleen
Date: Tue Jul 08 2014 - 15:28:53 EST

Thanks for testing.

On Tue, Jul 08, 2014 at 11:43:11AM -0700, Sukadev Bhattiprolu wrote:
> | The JSON format and perf parser has some minor Intelisms, but they
> | are simple and small and optional. It's easy to extend, so it would be
> | possible to use it for other CPUs too, add different pmu attributes, and
> | add new download sites to the downloader tool.
> Is there a minimal set of JSON entries an architecture would need ?

That should be enough, assuming the EventCode is enough to select
the event.

> I tried the following on Power
> [
> {
> "EventCode": "2",
> "EventName": "PM_INST_CMPL",
> "BriefDescription": "Instructions completed",
> "PublicDescription": "Number of PPC instructions finished",
> },
> {
> "EventCode": "0x1E",
> "EventName": "PM_CYC",
> "BriefDescription": "Cycles completed",
> "PublicDescription": "Number of PPC cycles finished",
> }
> ]
> /tmp/perf record --events-file=/tmp/power8.json -e PM_INST_CMPL sleep 1
> works, but for some TBD reason,
> /tmp/perf list --events-file=/tmp/power8.json doesn't list PM_INST_CMPL.

Works for me with your input file:

% perf list --events-file t.json
pm_cyc [Cycles completed]
pm_inst_cmpl [Instructions completed]

> Another observation was that the order of --events-file and -e is significant.
> Maybe worth a note in the man page.

Will add.

> Can you specify the qualifiers like ':k' or ':ku' with the events on
> Intel ?
>to only monitor kernel or user ? Or do they need some additional JSON
> entries ?

They can be all specified.

> With the above events file, I get "invalid event" for 'PM_INST_CMPL:u'

It works in new style syntax, like

perf stat --events-file t.json -e cpu/pm_inst_cmpl/u ls


ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at