diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-05-17 22:26:53 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-05-18 00:35:23 -0400 |
commit | f0218b3e9974f06014b61be8987159f4a20e011e (patch) | |
tree | 29a593c4d71ab18cb0c450a34e79bf6bea66877e /tools/perf/arch/powerpc | |
parent | 1eaa4787a774c4896518c81f24e8bccaa2244924 (diff) | |
parent | 9d192e118a094087494997ea1c8a2faf39af38c5 (diff) |
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip into trace/tip/tracing/core-6
Conflicts:
include/trace/ftrace.h
kernel/trace/trace_kprobe.c
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/perf/arch/powerpc')
-rw-r--r-- | tools/perf/arch/powerpc/Makefile | 4 | ||||
-rw-r--r-- | tools/perf/arch/powerpc/util/dwarf-regs.c | 88 |
2 files changed, 92 insertions, 0 deletions
diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile new file mode 100644 index 000000000000..15130b50dfe3 --- /dev/null +++ b/tools/perf/arch/powerpc/Makefile | |||
@@ -0,0 +1,4 @@ | |||
1 | ifndef NO_DWARF | ||
2 | PERF_HAVE_DWARF_REGS := 1 | ||
3 | LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/dwarf-regs.o | ||
4 | endif | ||
diff --git a/tools/perf/arch/powerpc/util/dwarf-regs.c b/tools/perf/arch/powerpc/util/dwarf-regs.c new file mode 100644 index 000000000000..48ae0c5e3f73 --- /dev/null +++ b/tools/perf/arch/powerpc/util/dwarf-regs.c | |||
@@ -0,0 +1,88 @@ | |||
1 | /* | ||
2 | * Mapping of DWARF debug register numbers into register names. | ||
3 | * | ||
4 | * Copyright (C) 2010 Ian Munsie, IBM Corporation. | ||
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 <libio.h> | ||
13 | #include <dwarf-regs.h> | ||
14 | |||
15 | |||
16 | struct pt_regs_dwarfnum { | ||
17 | const char *name; | ||
18 | unsigned int dwarfnum; | ||
19 | }; | ||
20 | |||
21 | #define STR(s) #s | ||
22 | #define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num} | ||
23 | #define GPR_DWARFNUM_NAME(num) \ | ||
24 | {.name = STR(%gpr##num), .dwarfnum = num} | ||
25 | #define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0} | ||
26 | |||
27 | /* | ||
28 | * Reference: | ||
29 | * http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html | ||
30 | */ | ||
31 | static const struct pt_regs_dwarfnum regdwarfnum_table[] = { | ||
32 | GPR_DWARFNUM_NAME(0), | ||
33 | GPR_DWARFNUM_NAME(1), | ||
34 | GPR_DWARFNUM_NAME(2), | ||
35 | GPR_DWARFNUM_NAME(3), | ||
36 | GPR_DWARFNUM_NAME(4), | ||
37 | GPR_DWARFNUM_NAME(5), | ||
38 | GPR_DWARFNUM_NAME(6), | ||
39 | GPR_DWARFNUM_NAME(7), | ||
40 | GPR_DWARFNUM_NAME(8), | ||
41 | GPR_DWARFNUM_NAME(9), | ||
42 | GPR_DWARFNUM_NAME(10), | ||
43 | GPR_DWARFNUM_NAME(11), | ||
44 | GPR_DWARFNUM_NAME(12), | ||
45 | GPR_DWARFNUM_NAME(13), | ||
46 | GPR_DWARFNUM_NAME(14), | ||
47 | GPR_DWARFNUM_NAME(15), | ||
48 | GPR_DWARFNUM_NAME(16), | ||
49 | GPR_DWARFNUM_NAME(17), | ||
50 | GPR_DWARFNUM_NAME(18), | ||
51 | GPR_DWARFNUM_NAME(19), | ||
52 | GPR_DWARFNUM_NAME(20), | ||
53 | GPR_DWARFNUM_NAME(21), | ||
54 | GPR_DWARFNUM_NAME(22), | ||
55 | GPR_DWARFNUM_NAME(23), | ||
56 | GPR_DWARFNUM_NAME(24), | ||
57 | GPR_DWARFNUM_NAME(25), | ||
58 | GPR_DWARFNUM_NAME(26), | ||
59 | GPR_DWARFNUM_NAME(27), | ||
60 | GPR_DWARFNUM_NAME(28), | ||
61 | GPR_DWARFNUM_NAME(29), | ||
62 | GPR_DWARFNUM_NAME(30), | ||
63 | GPR_DWARFNUM_NAME(31), | ||
64 | REG_DWARFNUM_NAME("%msr", 66), | ||
65 | REG_DWARFNUM_NAME("%ctr", 109), | ||
66 | REG_DWARFNUM_NAME("%link", 108), | ||
67 | REG_DWARFNUM_NAME("%xer", 101), | ||
68 | REG_DWARFNUM_NAME("%dar", 119), | ||
69 | REG_DWARFNUM_NAME("%dsisr", 118), | ||
70 | REG_DWARFNUM_END, | ||
71 | }; | ||
72 | |||
73 | /** | ||
74 | * get_arch_regstr() - lookup register name from it's DWARF register number | ||
75 | * @n: the DWARF register number | ||
76 | * | ||
77 | * get_arch_regstr() returns the name of the register in struct | ||
78 | * regdwarfnum_table from it's DWARF register number. If the register is not | ||
79 | * found in the table, this returns NULL; | ||
80 | */ | ||
81 | const char *get_arch_regstr(unsigned int n) | ||
82 | { | ||
83 | const struct pt_regs_dwarfnum *roff; | ||
84 | for (roff = regdwarfnum_table; roff->name != NULL; roff++) | ||
85 | if (roff->dwarfnum == n) | ||
86 | return roff->name; | ||
87 | return NULL; | ||
88 | } | ||