[PW_SID:1094515] [v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection#1941
[PW_SID:1094515] [v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection#1941linux-riscv-bot wants to merge 7 commits into
Conversation
…lection Currently, both libdw and libunwind define 'unwind__get_entries'. This causes a duplicate symbol build failure when both are compiled into perf. This commit refactors the DWARF unwind post-processing to be configurable at runtime via the .perfconfig file option 'unwind.style', or using the argument '--unwind-style' in the commands 'perf report', 'perf script' and 'perf inject', in a similar manner to the addr2line or the disassembler style. The file 'tools/perf/util/unwind.c' adds the top-level dispatch function 'unwind__get_entries'. The backend implementations are renamed to 'libdw__get_entries' and 'libunwind__get_entries'. Both are attempted as fallbacks if not configured, or if the primary backend fails. Fixes: 2e91915 ("perf build: Remove NO_LIBDW_DWARF_UNWIND option") Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
The separate test files only exist to pass a different #include, instead have a single source file and pass -include to $(CC) to include the relevant header file for the architecture being tested. Generate the rules using a foreach loop. Include tests for all current libunwind architectures. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Iterate LIBUNWIND_ARCHS when setting up CONFIG_ and HAVE_ definitions rather than treating each architecture individually. This sets up the libunwind build variables and C definitions beyond x86 and arm/aarch64. The existing naming convention is followed for compatibility. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Move the libunwind register to perf register mapping functions in arch/../util/unwind-libunwind.c into a new libunwind-arch directory. Rename the functions to __get_perf_regnum_for_unw_regnum_<arch>. Add untested ppc32 and s390 functions. Add a get_perf_regnum_for_unw_regnum function that takes an ELF machine as well as a register number and chooses the appropriate architecture implementation. Split the x86 and powerpc 32 and 64-bit implementations apart so that a single libunwind-<arch>.h header is included. Move the e_machine into the unwind_info struct to make it easier to pass. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Flush and finish access are relatively simple calls into libunwind, move them out struct unwind_libunwind_ops. So that the correct version can be called, add an e_machine variable to maps. This size regression will go away when the unwind_libunwind_ops no longer need stashing in the maps. To set the e_machine up pass it into unwind__prepare_access, which no longer needs to determine the unwind operations based on a map dso because of this. This also means the maps copying code can call unwind__prepare_access once for the e_machine rather than once per map. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Local unwinding only works on the machine libunwind is built for, rather than cross platform, the APIs for remote and local unwinding are similar but types like unw_word_t depend on the included header. Place the architecture specific code into the appropriate libunwind-<arch>.c file. Put generic code in unwind-libunwind.c and use libunwind-arch to choose the correct implementation based on the thread's e_machine. Structuring the code this way avoids including the unwind-libunwind-local.c for each architecture of remote unwinding. Data is moved into the struct unwind_info to simplify the architecture and generic code, trying to keep as much code as possible generic. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a RISC-V implementation for unwinding. Signed-off-by: Ian Rogers <irogers@google.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 1: "[v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 2: "[v5,2/7] tools build: Deduplicate test-libunwind for different architectures" |
|
Patch 5: "[v5,5/7] perf unwind-libunwind: Move flush/finish access out of local" |
|
Patch 5: "[v5,5/7] perf unwind-libunwind: Move flush/finish access out of local" |
|
Patch 5: "[v5,5/7] perf unwind-libunwind: Move flush/finish access out of local" |
|
Patch 5: "[v5,5/7] perf unwind-libunwind: Move flush/finish access out of local" |
|
Patch 5: "[v5,5/7] perf unwind-libunwind: Move flush/finish access out of local" |
|
Patch 5: "[v5,5/7] perf unwind-libunwind: Move flush/finish access out of local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 6: "[v5,6/7] perf unwind-libunwind: Remove libunwind-local" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
|
Patch 7: "[v5,7/7] perf unwind-libunwind: Add RISC-V libunwind support" |
PR for series 1094515 applied to workflow__riscv__fixes
Name: [v5,1/7] perf unwind: Refactor get_entries to allow dynamic libdw/libunwind selection
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1094515
Version: 5