[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260209174032.4142096-15-irogers@google.com>
Date: Mon, 9 Feb 2026 09:40:21 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>, Paul Walmsley <pjw@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Alexandre Ghiti <alex@...ti.fr>, Leo Yan <leo.yan@....com>, Tianyou Li <tianyou.li@...el.com>,
Athira Rajeev <atrajeev@...ux.ibm.com>, Derek Foreman <derek.foreman@...labora.com>,
Thomas Falcon <thomas.falcon@...el.com>, Howard Chu <howardchu95@...il.com>,
Dmitry Vyukov <dvyukov@...gle.com>, Andi Kleen <ak@...ux.intel.com>, tanze <tanze@...inos.cn>,
Hrishikesh Suresh <hrishikesh123s@...il.com>, Quan Zhou <zhouquan@...as.ac.cn>,
Andrew Jones <ajones@...tanamicro.com>, Anup Patel <anup@...infault.org>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>, "Dr. David Alan Gilbert" <linux@...blig.org>,
"Krzysztof Ćopatowski" <krzysztof.m.lopatowski@...il.com>, Chun-Tse Shao <ctshao@...gle.com>,
Ravi Bangoria <ravi.bangoria@....com>, Swapnil Sapkal <swapnil.sapkal@....com>,
Chen Ni <nichen@...as.ac.cn>, Blake Jones <blakejones@...gle.com>,
Yujie Liu <yujie.liu@...el.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v1 14/25] perf report: Directly use sample->evsel to avoid
computing from sample->id
In count_lost_samples_events try to avoid searching for the evsel for
the sample, just use the variable within the sample.
Signed-off-by: Ian Rogers <irogers@...gle.com>
---
tools/perf/builtin-report.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index ae7985ec2bd8..c088c7f94fac 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -793,9 +793,11 @@ static int count_lost_samples_event(const struct perf_tool *tool,
struct machine *machine __maybe_unused)
{
struct report *rep = container_of(tool, struct report, tool);
- struct evsel *evsel;
+ struct evsel *evsel = sample->evsel;
+
+ if (!evsel)
+ evsel = evlist__id2evsel(rep->session->evlist, sample->id);
- evsel = evlist__id2evsel(rep->session->evlist, sample->id);
if (evsel) {
struct hists *hists = evsel__hists(evsel);
u32 count = event->lost_samples.lost;
--
2.53.0.239.g8d8fc8a987-goog
Powered by blists - more mailing lists