]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
powerpc/perf: Don't use perf_hw_context for trace IMC PMU
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Wed, 2 Feb 2022 04:18:37 +0000 (09:48 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:32 +0000 (11:57 +0200)
commit6dded8bcbbd6c1c9ce04a3f09f4d941c8653740a
tree822d48eaf5a4b6d7f057491cbb8493111586a41b
parent093299288d192783fecf855553caeb26a4d90723
powerpc/perf: Don't use perf_hw_context for trace IMC PMU

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 0198322379c25215b2778482bf1221743a76e2b5 ]

Trace IMC (In-Memory collection counters) in powerpc is useful for
application level profiling.

For trace_imc, presently task context (task_ctx_nr) is set to
perf_hw_context. But perf_hw_context should only be used for CPU PMU.
See commit 26657848502b ("perf/core: Verify we have a single
perf_hw_context PMU").

So for trace_imc, even though it is per thread PMU, it is preferred to
use sw_context in order to be able to do application level monitoring.
Hence change the task_ctx_nr to use perf_sw_context.

Fixes: 012ae244845f ("powerpc/perf: Trace imc PMU functions")
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
[mpe: Update subject & incorporate notes into change log, reflow comment]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220202041837.65968-1-atrajeev@linux.vnet.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 94fd8a2a47c8fd52ff67fe3a55cb80489e02a476)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/powerpc/perf/imc-pmu.c