[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240813160208.2493643-3-kan.liang@linux.intel.com>
Date: Tue, 13 Aug 2024 09:02:01 -0700
From: kan.liang@...ux.intel.com
To: acme@...nel.org,
namhyung@...nel.org,
irogers@...gle.com,
peterz@...radead.org,
mingo@...nel.org,
linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org
Cc: adrian.hunter@...el.com,
ak@...ux.intel.com,
eranian@...gle.com,
Kan Liang <kan.liang@...ux.intel.com>
Subject: [PATCH V3 2/9] perf report: Remove the first overflow check for branch counters
From: Kan Liang <kan.liang@...ux.intel.com>
A false overflow warning is triggered if a sample doesn't have any LBRs
recorded and the branch counters feature is enabled.
The current code does OVERFLOW_CHECK_u64() at the very beginning when
reading the information of branch counters. It assumes that there is at
least one LBR in the PEBS record. But it is a valid case that 0 LBR is
recorded especially in a high context switch.
Remove the OVERFLOW_CHECK_u64(). The later OVERFLOW_CHECK() should be
good enough to check the overflow when reading the information of the
branch counters.
Fixes: 9fbb4b02302b ("perf tools: Add branch counter knob")
Acked-by: Namhyung Kim <namhyung@...nel.org>
Reviewed-by: Andi Kleen <ak@...ux.intel.com>
Signed-off-by: Kan Liang <kan.liang@...ux.intel.com>
---
tools/perf/util/evsel.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index d607056b73c9..f22f402d54cc 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2884,8 +2884,6 @@ int evsel__parse_sample(struct evsel *evsel, union perf_event *event,
array = (void *)array + sz;
if (evsel__has_branch_counters(evsel)) {
- OVERFLOW_CHECK_u64(array);
-
data->branch_stack_cntr = (u64 *)array;
sz = data->branch_stack->nr * sizeof(u64);
--
2.38.1
Powered by blists - more mailing lists