[PATCH v6 09/11] perf tools: Change fixed name of libunwind__arch_reg_id to macro

From: He Kuang
Date: Sat May 28 2016 - 08:01:47 EST


For local libunwind, it uses the fixed methods to convert register id
according to the host platform, but in remote libunwind, this convert
function should be the one for remote architechture. This patch
changes the fixed name to macro and code for each remote platform can
be compiled indivadually.

Signed-off-by: He Kuang <hekuang@xxxxxxxxxx>
---
tools/perf/util/unwind-libunwind-local.c | 2 +-
tools/perf/util/unwind.h | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 5599adc..b391e3e 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -490,7 +490,7 @@ static int access_reg(unw_addr_space_t __maybe_unused as,
return 0;
}

- id = libunwind__arch_reg_id(regnum);
+ id = LIBUNWIND__ARCH_REG_ID(regnum);
if (id < 0)
return -EINVAL;

diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index 4de423c..9e4f545 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -21,7 +21,10 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,

/* libunwind specific */
#ifdef HAVE_LIBUNWIND_SUPPORT
-int libunwind__arch_reg_id(int regnum);
+#ifndef LIBUNWIND__ARCH_REG_ID
+#define LIBUNWIND__ARCH_REG_ID libunwind__arch_reg_id
+#endif
+int LIBUNWIND__ARCH_REG_ID(int regnum);
int unwind__prepare_access(struct thread *thread, struct map *map);
void unwind__flush_access(struct thread *thread);
void unwind__finish_access(struct thread *thread);
--
1.8.5.2