From 035f0c279bcfc07314240de273d90f4061aef04d Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 17 Jan 2025 10:18:48 -0800 Subject: perf annotate: Prefer passing evsel to evsel->core.idx An evsel idx may not be stable due to sorting, evlist removal, etc. Try to reduce it being part of APIs by explicitly passing the evsel in annotate code. Internally the code just reads evsel->core.idx so behavior is unchanged. Signed-off-by: Ian Rogers Cc: Chen Ni Cc: Athira Rajeev Link: https://lore.kernel.org/r/20250117181848.690474-1-irogers@google.com Signed-off-by: Namhyung Kim --- tools/perf/ui/browsers/annotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/perf/ui/browsers/annotate.c') diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index d7e727345dab..135d6ce88fb3 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -754,7 +754,7 @@ static int annotate_browser__run(struct annotate_browser *browser, hbt->timer(hbt->arg); if (delay_secs != 0) { - symbol__annotate_decay_histogram(sym, evsel->core.idx); + symbol__annotate_decay_histogram(sym, evsel); hists__scnprintf_title(hists, title, sizeof(title)); annotate_browser__show(&browser->b, title, help); } -- cgit v1.2.3