Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412754

[PATCH v9 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro

From He Kuang <hekuang@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v9 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro
Date 2016-06-03 05:40 +0200
Message-ID <rFO7M-6nc-37@gated-at.bofh.it> (permalink)
References <rFO7L-6nc-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 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 bf9f593..b074662 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v9 00/14] Add support for remote unwind He Kuang <hekuang@huawei.com> - 2016-06-03 05:40 +0200
  [PATCH v9 14/14] perf callchain: Support aarch64 cross-platform He Kuang <hekuang@huawei.com> - 2016-06-03 05:40 +0200
    [tip:perf/core] perf callchain: Support aarch64 cross-platform tip-bot for He Kuang <tipbot@zytor.com> - 2016-06-08 11:00 +0200
  [PATCH v9 06/14] perf tools: Separate local/remote libunwind config He Kuang <hekuang@huawei.com> - 2016-06-03 05:40 +0200
    [tip:perf/core] perf unwind: Separate local/remote libunwind config tip-bot for He Kuang <tipbot@zytor.com> - 2016-06-08 10:50 +0200
  [PATCH v9 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro He Kuang <hekuang@huawei.com> - 2016-06-03 05:40 +0200
    [tip:perf/core] perf unwind: Change fixed name of  libunwind__arch_reg_id to macro tip-bot for He Kuang <tipbot@zytor.com> - 2016-06-08 11:00 +0200
  [PATCH v9 09/14] perf tools: Export normalize_arch() function He Kuang <hekuang@huawei.com> - 2016-06-03 05:40 +0200
    [tip:perf/core] perf tools: Export normalize_arch() function tip-bot for He Kuang <tipbot@zytor.com> - 2016-06-08 11:00 +0200
  [PATCH v9 02/14] perf tools: Decouple thread->address_space on libunwind He Kuang <hekuang@huawei.com> - 2016-06-03 05:40 +0200
    [tip:perf/core] perf unwind: Decouple thread->address_space on  libunwind tip-bot for He Kuang <tipbot@zytor.com> - 2016-06-08 10:50 +0200
  Re: [PATCH v9 00/14] Add support for remote unwind Jiri Olsa <jolsa@redhat.com> - 2016-06-03 09:10 +0200
    Re: [PATCH v9 00/14] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-03 21:50 +0200
      Re: [PATCH v9 00/14] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-03 23:10 +0200
        Re: [PATCH v9 00/14] Add support for remote unwind Hekuang <hekuang@huawei.com> - 2016-06-04 07:50 +0200
          Re: [PATCH v9 00/14] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-07 17:20 +0200
          Re: [PATCH v9 00/14] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-07 17:20 +0200
      Re: [PATCH v9 00/14] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-03 23:10 +0200
    Re: [PATCH v9 00/14] Add support for remote unwind Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-06-07 21:50 +0200
      Re: [PATCH v9 00/14] Add support for remote unwind Hekuang <hekuang@huawei.com> - 2016-06-08 09:40 +0200

csiph-web