Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf unwind: Change macro names of perf register

Use macro name prefixed with "LIBUNWIND_ARCH" for better understanding
that the regs used by callbacks of libunwind are arch specific. The real
regs used should be defined in the wrapper file of
"unwind-libunwind-local.c" for each supported arch.

Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1466578626-92406-2-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

He Kuang and committed by
Arnaldo Carvalho de Melo
78ff1d6d 76c588f1

+13 -2
+4 -2
tools/perf/util/unwind-libunwind-local.c
··· 462 462 return 0; 463 463 } 464 464 465 - ret = perf_reg_value(&start, &ui->sample->user_regs, PERF_REG_SP); 465 + ret = perf_reg_value(&start, &ui->sample->user_regs, 466 + LIBUNWIND__ARCH_REG_SP); 466 467 if (ret) 467 468 return ret; 468 469 ··· 622 621 unw_cursor_t c; 623 622 int ret, i = 0; 624 623 625 - ret = perf_reg_value(&val, &ui->sample->user_regs, PERF_REG_IP); 624 + ret = perf_reg_value(&val, &ui->sample->user_regs, 625 + LIBUNWIND__ARCH_REG_IP); 626 626 if (ret) 627 627 return ret; 628 628
+9
tools/perf/util/unwind.h
··· 32 32 #ifndef LIBUNWIND__ARCH_REG_ID 33 33 #define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__arch_reg_id(regnum) 34 34 #endif 35 + 36 + #ifndef LIBUNWIND__ARCH_REG_SP 37 + #define LIBUNWIND__ARCH_REG_SP PERF_REG_SP 38 + #endif 39 + 40 + #ifndef LIBUNWIND__ARCH_REG_IP 41 + #define LIBUNWIND__ARCH_REG_IP PERF_REG_IP 42 + #endif 43 + 35 44 int LIBUNWIND__ARCH_REG_ID(int regnum); 36 45 int unwind__prepare_access(struct thread *thread, struct map *map); 37 46 void unwind__flush_access(struct thread *thread);