Skip to content

Commit 7210520

Browse files
James-A-Clarkacmel
authored andcommitted
perf unwind: Use dynamic register set for DWARF unwind
Architectures can detect availability of extra registers at runtime so use this more complete set for unwinding. This will include the VG register on arm64 in a later commit. If the function isn't implemented then PERF_REGS_MASK is returned and there is no change. Committer notes: Added util/perf_regs.c to tools/perf/util/python-ext-sources so that 'perf test python' passes, i.e. the perf python binding has all the symbols it needs, addressing: $ perf test -v python 19: 'import perf' in python : --- start --- test child forked, pid 2037817 python usage test: "echo "import sys ; sys.path.append('/tmp/build/perf/python'); import perf" | '/usr/bin/python3' " Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: /tmp/build/perf/python/perf.cpython-310-x86_64-linux-gnu.so: undefined symbol: arch__user_reg_mask test child finished with -1 ---- end ---- 'import perf' in python: FAILED! $ Reviewed-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: James Clark <james.clark@arm.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: German Gomez <german.gomez@arm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: John Garry <john.garry@huawei.com> Cc: Mark Brown <broonie@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220525154114.718321-4-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent f450f11 commit 7210520

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

tools/perf/util/evsel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *o
897897
"specifying a subset with --user-regs may render DWARF unwinding unreliable, "
898898
"so the minimal registers set (IP, SP) is explicitly forced.\n");
899899
} else {
900-
attr->sample_regs_user |= PERF_REGS_MASK;
900+
attr->sample_regs_user |= arch__user_reg_mask();
901901
}
902902
attr->sample_stack_user = param->dump_size;
903903
attr->exclude_callchain_user = 1;

tools/perf/util/python-ext-sources

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ util/units.c
3838
util/affinity.c
3939
util/rwsem.c
4040
util/hashmap.c
41+
util/perf_regs.c
4142
util/pmu-hybrid.c
4243
util/fncache.c

0 commit comments

Comments
 (0)