Skip to contentSkip to conversation

perf tools: introduce arm64 support unwind test.

PATCH RESEND In review Wang Nan 2 participants 3 messages Mar 30, 2015 – Apr 21, 2015

Subsystems (2)
lore
Share & tools
lore

Wang Nan

author
#0 lore raw

PATCH RESEND 1/1 perf tools: introduce arm64 support unwind test.

Newest libunwind does support ARM64, and perf is able to utilize it also. This patch enables the missing perf test dwarf unwind for arm64.

Test result:

  # ./perf test unwind
  25: Test dwarf unwind                                      : Ok
---
 tools/perf/arch/arm64/Build                |  1 +
 tools/perf/arch/arm64/include/perf_regs.h  |  3 ++
 tools/perf/arch/arm64/tests/Build          |  2 +
 tools/perf/arch/arm64/tests/dwarf-unwind.c | 61 ++++++++++++++++++++++++++++++
 tools/perf/arch/arm64/tests/regs_load.S    | 46 ++++++++++++++++++++++
 tools/perf/tests/Build                     |  2 +-
 tools/perf/tests/builtin-test.c            |  2 +-
 tools/perf/tests/tests.h                   |  2 +-
 8 files changed, 116 insertions(+), 3 deletions(-)
 create mode 100644 tools/perf/arch/arm64/tests/Build
 create mode 100644 tools/perf/arch/arm64/tests/dwarf-unwind.c
 create mode 100644 tools/perf/arch/arm64/tests/regs_load.S
tools/perf/arch/arm64/Build +1 -0
index 54afe4a..41bf61d 100644
@@ -1 +1,2 @@
 libperf-y += util/
+libperf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/arm64/include/perf_regs.h +3 -0
index 1d3f39c..4e5af27 100644
@@ -5,8 +5,11 @@
 #include <linux/types.h>
 #include <asm/perf_regs.h>
 
+void perf_regs_load(u64 *regs);
+
 #define PERF_REGS_MASK	((1ULL << PERF_REG_ARM64_MAX) - 1)
 #define PERF_REGS_MAX	PERF_REG_ARM64_MAX
+#define PERF_SAMPLE_REGS_ABI	PERF_SAMPLE_REGS_ABI_64
 
 #define PERF_REG_IP	PERF_REG_ARM64_PC
 #define PERF_REG_SP	PERF_REG_ARM64_SP
tools/perf/arch/arm64/tests/Build new file +2 -0
new file mode 100644
index 0000000..b30eff9
@@ -0,0 +1,2 @@
+libperf-y += regs_load.o
+libperf-y += dwarf-unwind.o
tools/perf/arch/arm64/tests/dwarf-unwind.c new file +61 -0

61 lines not on this page · raw message

tools/perf/arch/arm64/tests/regs_load.S new file +46 -0

46 lines not on this page · raw message

tools/perf/tests/Build +1 -1
index 6a8801b..67f48e6 100644
@@ -34,7 +34,7 @@ perf-y += kmod-path.o
 
 perf-$(CONFIG_X86) += perf-time-to-tsc.o
 
-ifeq ($(ARCH),$(filter $(ARCH),x86 arm))
+ifeq ($(ARCH),$(filter $(ARCH),x86 arm arm64))
 perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
 endif
 
tools/perf/tests/builtin-test.c +1 -1
index 4f40981..63b0d27 100644
@@ -126,7 +126,7 @@ static struct test {
 		.desc = "Test parsing with no sample_id_all bit set",
 		.func = test__parse_no_sample_id_all,
 	},
-#if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
 	{
 		.desc = "Test dwarf unwind",
tools/perf/tests/tests.h +1 -1
index 52758a3..a94ea87 100644
@@ -53,7 +53,7 @@ int test__fdarray__filter(void);
 int test__fdarray__add(void);
 int test__kmod_path__parse(void);
 
-#if defined(__x86_64__) || defined(__i386__) || defined(__arm__)
+#if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
 struct thread;
 struct perf_sample;
Signature · 1 line
1.8.3.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wang Nan

Newest libunwind does support ARM64, and perf is able to utilize it also. This patch enables the missing perf test dwarf unwind for arm64.

Test result:

  # ./perf test unwind
  25: Test dwarf unwind                                      : Ok

cannot try, but looks ok and match closely x86 pattern ;-)

thanks,
jirka

author
#2 lore raw
Quoted 8 lines · Jiri Olsa
Quoted 7 lines · Wang Nan

Newest libunwind does support ARM64, and perf is able to utilize it also. This patch enables the missing perf test dwarf unwind for arm64.

Test result:

  # ./perf test unwind
  25: Test dwarf unwind                                      : Ok
Quoted 9 lines
Quoted 1 line

cannot try, but looks ok and match closely x86 pattern ;-)

thanks,
jirka

Sorry, I'm unable to find this patch in git repo (both tip/master and mainline). Is there any problem?