BLS-460: Perf group counting requires 'cpu_cycles' event as the first event in the event list specified to the perf tool.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linaro-landing-team-arm |
Fix Committed
|
Medium
|
Robin Randhawa |
Bug Description
Issue with grouped counters found. If we specify the events with the
string approach (i.e. specifying the PMU by name), then the first event
has to be cpu-cycles. Otherwise this does not work.
E.g:
perf stat -x, -o perf_golden.dat -r 10 -g -e
ARMv7_Cortex_
taskset 0x1C ../../common/cache
3628292479,
1415470141,
741187897,
67686042,
134857500,
<not supported>
Cortex-A7 has 4 counters, so we get values for 'a7_instructions',
'a7_cache_
'a7_branch_
supported> which is the expected behaviour.
If I do not specify 'a7_cpu_cycles' as the first event, the behaviour is
different. All events return with '<not supported>' or '0'.
The behaviour is the same on Cortex-A15 (with 6 + 1 counters obviously).
information type: | Proprietary → Public |
Changed in linaro-landing-team-arm: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
When validating the group events, each event is checked for its state STATE_OFF STATE_INACTIVE.
and availability. The group leader's state is set to PERF_EVENT_
while its siblings set to PERF_EVENT_
Currently since the event state needs to be greater than STATE_OFF, the group leader is skipped while checking for the
PERF_EVENT_
availabilty. This results in allowing an extra event than the actual
available counters.
The fix is to make sure the event state is checked properly so that the group
leader event is also considered for availabilty check.
Will Deacon has posted the patch to A/LKML, follow the same for more updates: /lkml.org/ lkml/2013/ 3/28/412
https:/