From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932580AbcFBJ4F (ORCPT ); Thu, 2 Jun 2016 05:56:05 -0400 Received: from szxga05-in.huawei.com ([58.251.152.179]:36685 "EHLO szxga05-in.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932290AbcFBJ4A (ORCPT ); Thu, 2 Jun 2016 05:56:00 -0400 From: He Kuang To: , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v8 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro Date: Thu, 2 Jun 2016 09:55:23 +0000 Message-ID: <1464861326-22677-12-git-send-email-hekuang@huawei.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1464861326-22677-1-git-send-email-hekuang@huawei.com> References: <1464861326-22677-1-git-send-email-hekuang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020203.575002A8.01A4,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 121cae2c04f0f3eb110916aac87ecb22 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 9c70486..631b40d 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c @@ -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; diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h index dda2156..a77b3dc 100644 --- a/tools/perf/util/unwind.h +++ b/tools/perf/util/unwind.h @@ -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); -- 1.8.5.2