Some Power8 PMU events are "latency" events that require specifying a "trigger" to start and stop cycle counts. The trigger settings are not reflected in the codes reported by ophelp. This may also explain why these events do not work with ocount.
--:
$ /usr/bin/sudo ocount --system-wide -e PM_L1MISS_LAT_EXC_32
perf_event_open failed with Invalid argument
Caught runtime error while setting up counters
Internal Error. Perf event setup failed.
Error running ocount
$ perf stat -e PM_L1MISS_LAT_EXC_32
invalid or unsupported event: 'PM_L1MISS_LAT_EXC_32'
Run 'perf list' for a list of valid events
usage: perf stat [<options>] [
-e, --event <event> event selector. use 'perf list' to list available events
$ echo "obase=16; $(ophelp PM_L1MISS_LAT_EXC_32)" | bc
200201E6
$ perf stat -e r200201E6 find /usr -exec echo -n \;
Performance counter stats for 'find /usr -exec echo -n ;':
0 r200201E6
69.918230260 seconds time elapsed
$ perf stat -e r67200201E6 find /usr -exec echo -n \;
Performance counter stats for 'find /usr -exec echo -n ;':
4,933,643 r67200201E6
64.043543194 seconds time elapsed
--:
A (not necessarily exhaustive) list of such events includes:
PM_L1MISS_LAT_EXC_32,67200201E6
PM_L1MISS_LAT_EXC_256,67200101E8
PM_L1MISS_LAT_EXC_1024,67200301EA
PM_L1MISS_LAT_EXC_2048,67200401EC
PM_RC_LIFETIME_EXC_32,DE200201E6
PM_RC_LIFETIME_EXC_256,DE200101E8
PM_RC_LIFETIME_EXC_1024,DE200301EA
PM_RC_LIFETIME_EXC_2048,DE200401EC
A bit more exhaustive this time... I've attached a file showing events which:
1. are missing triggers for thresholding
2. are missing a (required?) mark bit
3. are missing a (required?) sampling mode specification
I think the lack of trigger bits may be effecting ocount as well:
...
$ ocount -e PM_RC_LIFETIME_EXC_256 sleep 0.5
perf_event_open failed with Invalid argument
Caught runtime error while setting up counters
Internal Error. Perf event setup failed.
...
ocount doesn't support raw events, so I can't try to add the bits myself
However, perf may give a clue...
...
$ echo "obase=16; $(ophelp PM_RC_LIFETIME_EXC_256)" | bc
200101E8
$ perf stat -e r200101E8 sleep 0.5
Performance counter stats for 'sleep 0.5':
$ perf stat -e rDE200101E8 sleep 0.5
Performance counter stats for 'sleep 0.5':
--
I always get 0 events for r200101E8, and greater than 0 for DE200101E8
The first issue noted was perf failed to start with "ocount --system-wide -e PM_L1MISS_LAT_EXC_32". Tested on a Power 8 system:
/pe_counting# ocount --system-wide -e PM_L1MISS_LAT_EXC_32
ocount: Press Ctl-c or 'kill -SIGINT 122560' to stop counting
^C
Events were actively counted for 3.3 seconds.
Event counts (actual) for the whole system:
Event Count % time counted
PM_L1MISS_LAT_EXC_32 101,107 100.00
That does give non zero results, no perf errors.
I tried the 256, 1024 and 2048 events as well and they gave non-zero results.
The second issue was with the life time events. I tried:
ocount -e PM_RC_LIFETIME_EXC_256 <various workloads=""></various>
I didn't get any error messages, but I only got a count of 0 for the event.
Similarly, I only got 0 for the 32, 1024 and 2048 events.
The event description says "Number of times the RC machine for a sampled instruction was active....". The test didn't specify an instruction to sample so a count of zero may be reasonable.
I tried setting up the test case:
ocount -e PM_MRK_DATA_FROM_L2 -e PM_RC_LIFETIME_EXC_1024 /home/carll/Workloads/load_v2
where the workload load_v2 is a workload that just thrashes the case. I got a zero count for both events. Can't guarentee my workload generates the performance counter events specified.
I am not seeing any error messages. Not able to reproduce the error "perf_event_open failed with Invalid argument"
I'm not able to reproduce, either. Closing...
I will happily close this once I figure out how to do so. (??)