[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240905031027.2567913-5-namhyung@kernel.org>
Date: Wed, 4 Sep 2024 20:10:26 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>
Cc: Kan Liang <kan.liang@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>,
Ravi Bangoria <ravi.bangoria@....com>,
Michael Ellerman <mpe@...erman.id.au>,
Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Naveen N Rao <naveen@...nel.org>,
Kajol Jain <kjain@...ux.ibm.com>,
Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH 4/5] perf/powerpc: Count dropped samples in core-book3s PMU
Due to the hardware limitation, sometimes it could sample kernel address
while attr.exclude_kernel is set. In that case it silently drops the
sample. Let's count that case in the new dropped_samples counter.
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Nicholas Piggin <npiggin@...il.com>
Cc: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: Naveen N Rao <naveen@...nel.org>
Cc: Kajol Jain <kjain@...ux.ibm.com>
Cc: Athira Rajeev <atrajeev@...ux.vnet.ibm.com>
Cc: linuxppc-dev@...ts.ozlabs.org
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
arch/powerpc/perf/core-book3s.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 42867469752d73cf..553e288b9f113836 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -2287,8 +2287,10 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
*/
if (event->attr.exclude_kernel &&
(event->attr.sample_type & PERF_SAMPLE_IP) &&
- is_kernel_addr(mfspr(SPRN_SIAR)))
+ is_kernel_addr(mfspr(SPRN_SIAR))) {
+ atomic64_inc(&event->dropped_samples);
record = 0;
+ }
/*
* Finally record data if requested.
--
2.46.0.469.g59c65b2a67-goog
Powered by blists - more mailing lists