Re: [PATCH v1 3/3] perf annotate: Prefer passing evsel to evsel->core.idx

From: Arnaldo Carvalho de Melo
Date: Fri Dec 20 2024 - 14:50:50 EST


On Thu, Nov 14, 2024 at 03:07:13PM -0800, Ian Rogers wrote:
> 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.

I think this is where this comes into play, are you running 'make -C
tools/perf tools-build' before submitting?

I'll have to stop now, but will fix this if you don´t have time for a
v2.

- Arnaldo

ui/gtk/annotate.c: In function ‘perf_gtk__get_percent’:
ui/gtk/annotate.c:45:48: error: passing argument 2 of ‘annotation__histogram’ makes pointer from integer without a cast [-Wint-conversion]
45 | symhist = annotation__histogram(notes, evidx);
| ^~~~~
| |
| int
In file included from ui/gtk/annotate.c:5:
/home/acme/git/perf-tools-next/tools/perf/util/annotate.h:383:74: note: expected ‘const struct evsel *’ but argument is of type ‘int’
383 | const struct evsel *evsel)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
ui/gtk/annotate.c:46:58: error: passing argument 2 of ‘annotated_source__hist_entry’ makes pointer from integer without a cast [-Wint-conversion]
46 | entry = annotated_source__hist_entry(notes->src, evidx, dl->al.offset);
| ^~~~~
| |
| int
/home/acme/git/perf-tools-next/tools/perf/util/annotate.h:389:80: note: expected ‘const struct evsel *’ but argument is of type ‘int’
389 | annotated_source__hist_entry(struct annotated_source *src, const struct evsel *evsel, u64 offset)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
TEST tests/shell/test_task_analyzer.sh.shellcheck_log
make[6]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:105: ui/gtk/annotate.o] Error 1
TEST tests/shell/test_uprobe_from_different_cu.sh.shellcheck_log
CC util/session.o
make[5]: *** [/home/acme/git/perf-tools-next/tools/build/Makefile.build:158: ui/gtk] Error 2
make[4]: *** [Makefile.perf:802: gtk-in.o] Error 2
make[4]: *** Waiting for unfinished jobs....
CC util/tool.o