From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162044AbcFGUJA (ORCPT ); Tue, 7 Jun 2016 16:09:00 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60698 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161924AbcFGUFa (ORCPT ); Tue, 7 Jun 2016 16:05:30 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, He Kuang , Adrian Hunter , Alexander Shishkin , Andi Kleen , David Ahern , Ekaterina Tumanova , Josh Poimboeuf , Kan Liang , Masami Hiramatsu , Namhyung Kim , Pekka Enberg , Peter Zijlstra , Stephane Eranian , Sukadev Bhattiprolu , Wang Nan , Arnaldo Carvalho de Melo Subject: [PATCH 21/24] perf unwind: Change fixed name of libunwind__arch_reg_id to macro Date: Tue, 7 Jun 2016 17:04:59 -0300 Message-Id: <1465329902-11069-22-git-send-email-acme@kernel.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465329902-11069-1-git-send-email-acme@kernel.org> References: <1465329902-11069-1-git-send-email-acme@kernel.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: He Kuang 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 Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Ekaterina Tumanova Cc: Josh Poimboeuf Cc: Kan Liang Cc: Masami Hiramatsu Cc: Namhyung Kim Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Sukadev Bhattiprolu Cc: Wang Nan Link: http://lkml.kernel.org/r/1464924803-22214-12-git-send-email-hekuang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- 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 9c70486c5c6a..631b40d94643 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 bf9f5937caee..b07466240346 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); -- 2.5.5