perf annotate-data: Collect global variables in advance
authorNamhyung Kim <namhyung@kernel.org>
Thu, 2 May 2024 06:00:07 +0000 (23:00 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 May 2024 13:47:52 +0000 (10:47 -0300)
commitc1da8411e4be2a96a448979baede9a0e86c5baf8
tree70a5168c82ef66d17d2208d9ce0c8e89d898f768
parentd7b60803a790b716dc930bde2155c6ecb7537d51
perf annotate-data: Collect global variables in advance

Currently it looks up global variables from the current CU using address
and name.  But it sometimes fails to find a variable as the variable can
come from a different CU - but it's still strange it failed to find a
declaration for some reason.

Anyway, it can collect all global variables from all CU once and then
lookup them later on.  This slightly improves the success rate of my
test data set.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240502060011.1838090-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate-data.c