perf unwind: Change fixed name of libunwind__arch_reg_id to macro
authorHe Kuang <hekuang@huawei.com>
Fri, 3 Jun 2016 03:33:20 +0000 (03:33 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 7 Jun 2016 18:11:46 +0000 (15:11 -0300)
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 architecture. This patch changes
the fixed name to macro and code for each remote platform can be
compiled indivadually.

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/1464924803-22214-12-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/unwind-libunwind-local.c
tools/perf/util/unwind.h

index 9c70486c5c6a169b8c0a482938631d8fb4cfea42..631b40d94643c3d856c1560a8bafb143533dc255 100644 (file)
@@ -508,7 +508,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;
 
index bf9f5937caee17b6eb64f771bf946e26b8fdac7e..b074662403464278976d3ced8c2b999670223e91 100644 (file)
@@ -29,7 +29,10 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg,
                        struct perf_sample *data, int max_stack);
 /* libunwind specific */
 #ifdef HAVE_LIBUNWIND_SUPPORT
-int libunwind__arch_reg_id(int regnum);
+#ifndef LIBUNWIND__ARCH_REG_ID
+#define LIBUNWIND__ARCH_REG_ID(regnum) libunwind__arch_reg_id(regnum)
+#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);