]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf: Fix reading of MSR[HV/PR] bits in trace-imc
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Wed, 26 Aug 2020 06:40:29 +0000 (02:40 -0400)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 27 Aug 2020 07:41:45 +0000 (17:41 +1000)
commit48ac66207856aa55e1898cf4254046a3fcbf8f67
tree4f70b0e915711f5a7082bd7e70f553bb48f14476
parent3698473a427a14e198a6eef99a80660066b5e0e0
powerpc/perf: Fix reading of MSR[HV/PR] bits in trace-imc

IMC trace-mode uses MSR[HV/PR] bits to set the cpumode for the
instruction pointer captured in each sample. The bits are fetched from
the third double word of the trace record. Reading third double word
from IMC trace record should use be64_to_cpu() along with READ_ONCE
inorder to fetch correct MSR[HV/PR] bits. Patch addresses this change.

Currently we are using PERF_RECORD_MISC_HYPERVISOR as cpumode if MSR
HV is 1 and PR is 0 which means the address is from host counter. But
using PERF_RECORD_MISC_HYPERVISOR for host counter data will fail to
resolve the address -> symbol during "perf report" because perf tools
side uses PERF_RECORD_MISC_KERNEL to represent the host counter data.
Therefore, fix the trace imc sample data to use
PERF_RECORD_MISC_KERNEL as cpumode for host kernel information.

Fixes: eb46b93700ad ("powerpc/perf: Add kernel support for new MSR[HV PR] bits in trace-imc")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1598424029-1662-1-git-send-email-atrajeev@linux.vnet.ibm.com
arch/powerpc/perf/imc-pmu.c