]> www.infradead.org Git - users/dwmw2/linux.git/commit
powerpc/perf: Exclude kernel samples while counting events in user space.
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Wed, 25 Nov 2020 07:26:55 +0000 (02:26 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Dec 2020 12:47:06 +0000 (13:47 +0100)
commitd81fd62fe45f991ead9d9fb2b26b285a9a20a069
tree2aea7d746055c4de30c26fc1dc68add66e05460d
parent5dfe46bf0b2442986ea323631e330d7edade1aec
powerpc/perf: Exclude kernel samples while counting events in user space.

commit aa8e21c053d72b6639ea5a7f1d3a1d0209534c94 upstream.

Perf event attritube supports exclude_kernel flag to avoid
sampling/profiling in supervisor state (kernel). Based on this event
attr flag, Monitor Mode Control Register bit is set to freeze on
supervisor state. But sometimes (due to hardware limitation), Sampled
Instruction Address Register (SIAR) locks on to kernel address even
when freeze on supervisor is set. Patch here adds a check to drop
those samples.

Cc: stable@vger.kernel.org
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/1606289215-1433-1-git-send-email-atrajeev@linux.vnet.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/perf/core-book3s.c