diff options
| author | Ian Rogers <irogers@google.com> | 2026-01-24 01:22:09 +0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-01-27 00:31:27 +0300 |
| commit | 2becdd163ab37c9dca05f31da7e943f59f55e510 (patch) | |
| tree | ac4eee841007e5bdd4e7eebd2df65092a3cdf086 /tools | |
| parent | 0403930f7b1534e383116f7122539873dad3c6a6 (diff) | |
| download | linux-2becdd163ab37c9dca05f31da7e943f59f55e510.tar.xz | |
perf unwind-libdw: Wire up e_flags for CSKY
Wire up the e_flags now it can be read for a thread. The e_flags
encode the CSKY ABI level and this can impact which perf registers
need setting up for unwinding.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Aditya Bodkhe <aditya.b1@linux.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.ibm.com>
Cc: Chun-Tse Shao <ctshao@google.com>
Cc: Guo Ren <guoren@kernel.org>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sergei Trofimovich <slyich@gmail.com>
Cc: Shimin Guo <shimin.guo@skydio.com>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Cc: Swapnil Sapkal <swapnil.sapkal@amd.com>
Cc: Tianyou Li <tianyou.li@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/util/unwind-libdw.c | 9 | ||||
| -rw-r--r-- | tools/perf/util/unwind-libdw.h | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index 3fdcfa06bf22..05e8e68bd49c 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -213,7 +213,6 @@ static bool memory_read(Dwfl *dwfl __maybe_unused, Dwarf_Addr addr, Dwarf_Word * { struct dwfl_ui_thread_info *dwfl_ui_ti = arg; struct unwind_info *ui = dwfl_ui_ti->ui; - uint16_t e_machine = thread__e_machine(ui->thread, ui->machine, /*e_flags=*/NULL); struct stack_dump *stack = &ui->sample->user_stack; u64 start, end; int offset; @@ -223,7 +222,7 @@ static bool memory_read(Dwfl *dwfl __maybe_unused, Dwarf_Addr addr, Dwarf_Word * return false; ret = perf_reg_value(&start, ui->sample->user_regs, - perf_arch_reg_sp(e_machine)); + perf_arch_reg_sp(ui->e_machine)); if (ret) return false; @@ -260,7 +259,7 @@ static bool libdw_set_initial_registers(Dwfl_Thread *thread, void *arg) int max_dwarf_reg = 0; bool ret; uint16_t e_machine = ui->e_machine; - int e_flags = 0; + int e_flags = ui->e_flags; uint64_t ip_perf_reg = perf_arch_reg_ip(e_machine); Dwarf_Word val = 0; @@ -348,7 +347,8 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, { struct maps *maps = thread__maps(thread); struct machine *machine = maps__machine(maps); - uint16_t e_machine = thread__e_machine(thread, machine, /*e_flags=*/NULL); + uint32_t e_flags = 0; + uint16_t e_machine = thread__e_machine(thread, machine, &e_flags); struct dwfl_ui_thread_info *dwfl_ui_ti; static struct unwind_info *ui; Dwfl *dwfl; @@ -370,6 +370,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, .arg = arg, .max_stack = max_stack, .e_machine = e_machine, + .e_flags = e_flags, .best_effort = best_effort }; diff --git a/tools/perf/util/unwind-libdw.h b/tools/perf/util/unwind-libdw.h index 3dec0ab8bd50..6423bf5a2492 100644 --- a/tools/perf/util/unwind-libdw.h +++ b/tools/perf/util/unwind-libdw.h @@ -20,6 +20,7 @@ struct unwind_info { void *arg; int max_stack; int idx; + uint32_t e_flags; uint16_t e_machine; bool best_effort; struct unwind_entry entries[]; |
