aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2015-06-25 21:11:08 -0400
committerMax Filippov <jcmvbkbc@gmail.com>2015-08-17 00:33:32 -0400
commit18bc5b85aac08d35eeca174abc73238a4d5deb0b (patch)
tree07931881fc2da5520b660f25e229e1517e159d1a
parent9bd46da45edd9701bcb2a221d58afe7d01febd1d (diff)
perf tools: xtensa: add DWARF register names
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
-rw-r--r--tools/perf/arch/xtensa/Build1
-rw-r--r--tools/perf/arch/xtensa/Makefile3
-rw-r--r--tools/perf/arch/xtensa/util/Build1
-rw-r--r--tools/perf/arch/xtensa/util/dwarf-regs.c25
4 files changed, 30 insertions, 0 deletions
diff --git a/tools/perf/arch/xtensa/Build b/tools/perf/arch/xtensa/Build
new file mode 100644
index 000000000000..54afe4a467e7
--- /dev/null
+++ b/tools/perf/arch/xtensa/Build
@@ -0,0 +1 @@
libperf-y += util/
diff --git a/tools/perf/arch/xtensa/Makefile b/tools/perf/arch/xtensa/Makefile
new file mode 100644
index 000000000000..7fbca175099e
--- /dev/null
+++ b/tools/perf/arch/xtensa/Makefile
@@ -0,0 +1,3 @@
1ifndef NO_DWARF
2PERF_HAVE_DWARF_REGS := 1
3endif
diff --git a/tools/perf/arch/xtensa/util/Build b/tools/perf/arch/xtensa/util/Build
new file mode 100644
index 000000000000..954e287bbb89
--- /dev/null
+++ b/tools/perf/arch/xtensa/util/Build
@@ -0,0 +1 @@
libperf-$(CONFIG_DWARF) += dwarf-regs.o
diff --git a/tools/perf/arch/xtensa/util/dwarf-regs.c b/tools/perf/arch/xtensa/util/dwarf-regs.c
new file mode 100644
index 000000000000..4dba76bfb4ce
--- /dev/null
+++ b/tools/perf/arch/xtensa/util/dwarf-regs.c
@@ -0,0 +1,25 @@
1/*
2 * Mapping of DWARF debug register numbers into register names.
3 *
4 * Copyright (c) 2015 Cadence Design Systems Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11
12#include <stddef.h>
13#include <dwarf-regs.h>
14
15#define XTENSA_MAX_REGS 16
16
17const char *xtensa_regs_table[XTENSA_MAX_REGS] = {
18 "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7",
19 "a8", "a9", "a10", "a11", "a12", "a13", "a14", "a15",
20};
21
22const char *get_arch_regstr(unsigned int n)
23{
24 return n < XTENSA_MAX_REGS ? xtensa_regs_table[n] : NULL;
25}