From 721bb20a8a7d1ff2f7b062f8d92f50c743883d35 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 14 Nov 2018 14:18:56 +0100 Subject: [PATCH 2/2] [WIP] perf unwind: use iregs for unwinding TODO: only use it if available TODO: figure out when to skip iregs->ip frame, and when to use it (e.g. when function for iregs->ip and uregs->ip differs?) Signed-off-by: Milian Wolff Cc: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Jiri Olsa --- tools/perf/util/unwind-libunwind-local.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 79f521a552cf..39f19673cc34 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c @@ -492,12 +492,12 @@ static int access_mem(unw_addr_space_t __maybe_unused as, int ret; /* Don't support write, probably not needed. */ - if (__write || !stack || !ui->sample->user_regs.regs) { + if (__write || !stack || !ui->sample->intr_regs.regs) { *valp = 0; return 0; } - ret = perf_reg_value(&start, &ui->sample->user_regs, + ret = perf_reg_value(&start, &ui->sample->intr_regs, LIBUNWIND__ARCH_REG_SP); if (ret) return ret; @@ -541,7 +541,7 @@ static int access_reg(unw_addr_space_t __maybe_unused as, return 0; } - if (!ui->sample->user_regs.regs) { + if (!ui->sample->intr_regs.regs) { *valp = 0; return 0; } @@ -550,7 +550,7 @@ static int access_reg(unw_addr_space_t __maybe_unused as, if (id < 0) return -EINVAL; - ret = perf_reg_value(&val, &ui->sample->user_regs, id); + ret = perf_reg_value(&val, &ui->sample->intr_regs, id); if (ret) { pr_err("unwind: can't read reg %d\n", regnum); return ret; @@ -716,7 +716,7 @@ static int _unwind__get_entries(unwind_entry_cb_t cb, void *arg, .machine = thread->mg->machine, }; - if (!data->user_regs.regs) + if (!data->intr_regs.regs) return -EINVAL; if (max_stack <= 0) -- 2.19.1