perf callchain: Allow symbols to be optional when resolving a callchain
authorIan Rogers <irogers@google.com>
Mon, 9 Sep 2024 20:37:40 +0000 (13:37 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 10 Sep 2024 20:32:47 +0000 (17:32 -0300)
commit02b2705017d2e5ad32c23067d4b44477ec20b637
tree0506f993f7e749440a5885e8a1d774b1458016da
parent64eed019f3fce1248cd29443c8a8635d317cb70f
perf callchain: Allow symbols to be optional when resolving a callchain

In uses like 'perf inject' it is not necessary to gather the symbol for
each call chain location, the map for the sample IP is wanted so that
build IDs and the like can be injected. Make gathering the symbol in the
callchain_cursor optional.

For a 'perf inject -B' command this lowers the peak RSS from 54.1MB to
29.6MB by avoiding loading symbols.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Anne Macedo <retpolanne@posteo.net>
Cc: Casey Chen <cachen@purestorage.com>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sun Haiyong <sunhaiyong@loongson.cn>
Link: https://lore.kernel.org/r/20240909203740.143492-5-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-inject.c
tools/perf/util/callchain.c
tools/perf/util/callchain.h
tools/perf/util/machine.c
tools/perf/util/machine.h