]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sparc64: perf: Fix the mapping between perf events and perf counters
authorDave Aldridge <david.j.aldridge@oracle.com>
Fri, 7 Oct 2016 14:57:50 +0000 (07:57 -0700)
committerAllen Pais <allen.pais@oracle.com>
Tue, 16 May 2017 07:15:21 +0000 (12:45 +0530)
commit358fcadb4927335dbd1df28ec14acf253bb3c24b
treebad87af2fdbe6fcf7e27c2ec2ddb77d9d7e627ef
parent85daae1091c28c57e0feccaf4b714c8292d6d625
sparc64: perf: Fix the mapping between perf events and perf counters

Up until now, perf event[0] has been counted on perf counter[0],
perf event[1] on perf counter[1] etc. However, there is no reason why
this has to be the case. Infact, on SPARC-M8 some events can only be
counted on a sub set of the available perf counters, rather than all
the available perf counters. Whilst adding these perf counter
constraints for the SPARC-M8 it became apparent that some confusion
had crept into the existing code.

Some functions were making the assumption that the perf event index was
equivalent to the perf counter index. This commit fixes these assumptions,
and allows for the case where perf event[0] is not counted on
perf counter[0] etc.

Orabug: 23333572

Signed-off-by: Dave Aldridge <david.j.aldridge@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
arch/sparc/kernel/perf_event.c