diff options
author | Ian Rogers <irogers@google.com> | 2024-09-09 22:37:40 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2024-09-10 22:32:47 +0200 |
commit | 02b2705017d2e5ad32c23067d4b44477ec20b637 (patch) | |
tree | 0506f993f7e749440a5885e8a1d774b1458016da /tools/perf/util/callchain.c | |
parent | perf inject: Lazy build-id mmap2 event insertion (diff) | |
download | linux-02b2705017d2e5ad32c23067d4b44477ec20b637.tar.xz linux-02b2705017d2e5ad32c23067d4b44477ec20b637.zip |
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>
Diffstat (limited to 'tools/perf/util/callchain.c')
-rw-r--r-- | tools/perf/util/callchain.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index 0d608e875fe9..0c7564747a14 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c @@ -1800,7 +1800,7 @@ s64 callchain_avg_cycles(struct callchain_node *cnode) int sample__for_each_callchain_node(struct thread *thread, struct evsel *evsel, struct perf_sample *sample, int max_stack, - callchain_iter_fn cb, void *data) + bool symbols, callchain_iter_fn cb, void *data) { struct callchain_cursor *cursor = get_tls_callchain_cursor(); int ret; @@ -1809,9 +1809,9 @@ int sample__for_each_callchain_node(struct thread *thread, struct evsel *evsel, return -ENOMEM; /* Fill in the callchain. */ - ret = thread__resolve_callchain(thread, cursor, evsel, sample, - /*parent=*/NULL, /*root_al=*/NULL, - max_stack); + ret = __thread__resolve_callchain(thread, cursor, evsel, sample, + /*parent=*/NULL, /*root_al=*/NULL, + max_stack, symbols); if (ret) return ret; |