[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260123222209.1181249-5-irogers@google.com>
Date: Fri, 23 Jan 2026 14:22:09 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>, Guo Ren <guoren@...nel.org>,
Tianyou Li <tianyou.li@...el.com>, Athira Rajeev <atrajeev@...ux.ibm.com>,
Stephen Brennan <stephen.s.brennan@...cle.com>, Aditya Bodkhe <aditya.b1@...ux.ibm.com>,
Chun-Tse Shao <ctshao@...gle.com>, Swapnil Sapkal <swapnil.sapkal@....com>,
Howard Chu <howardchu95@...il.com>, Sergei Trofimovich <slyich@...il.com>,
Shimin Guo <shimin.guo@...dio.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-csky@...r.kernel.org
Subject: [PATCH v1 4/4] 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@...gle.com>
---
tools/perf/util/unwind-libdw.c | 9 +++++----
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[];
--
2.52.0.457.g6b5491de43-goog
Powered by blists - more mailing lists