diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-08-19 06:48:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-08-19 06:48:09 -0400 |
commit | c8710ad38900153af7a3e6762e99c062cfa46443 (patch) | |
tree | a0c0632274c4eb72f51e99a5861f71cffe65ea60 /tools/perf | |
parent | 6016ee13db518ab1cd0cbf43fc2ad5712021e338 (diff) | |
parent | 86397dc3ccfc0e17b7550d05eaf15fe91f6498dd (diff) |
Merge branch 'tip/perf/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/Makefile | 16 | ||||
-rw-r--r-- | tools/perf/arch/arm/Makefile | 4 | ||||
-rw-r--r-- | tools/perf/arch/arm/util/dwarf-regs.c | 64 | ||||
-rw-r--r-- | tools/perf/util/include/linux/types.h | 12 | ||||
-rw-r--r-- | tools/perf/util/ui/browsers/annotate.c | 3 |
5 files changed, 92 insertions, 7 deletions
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 41abb90df50d..dcb9700b88d2 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
@@ -157,10 +157,6 @@ all:: | |||
157 | # | 157 | # |
158 | # Define NO_DWARF if you do not want debug-info analysis feature at all. | 158 | # Define NO_DWARF if you do not want debug-info analysis feature at all. |
159 | 159 | ||
160 | $(shell sh -c 'mkdir -p $(OUTPUT)scripts/{perl,python}/Perf-Trace-Util/' 2> /dev/null) | ||
161 | $(shell sh -c 'mkdir -p $(OUTPUT)util/{ui/browsers,scripting-engines}/' 2> /dev/null) | ||
162 | $(shell sh -c 'mkdir $(OUTPUT)bench' 2> /dev/null) | ||
163 | |||
164 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE | 160 | $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE |
165 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) | 161 | @$(SHELL_PATH) util/PERF-VERSION-GEN $(OUTPUT) |
166 | -include $(OUTPUT)PERF-VERSION-FILE | 162 | -include $(OUTPUT)PERF-VERSION-FILE |
@@ -186,8 +182,6 @@ ifeq ($(ARCH),x86_64) | |||
186 | ARCH := x86 | 182 | ARCH := x86 |
187 | endif | 183 | endif |
188 | 184 | ||
189 | $(shell sh -c 'mkdir -p $(OUTPUT)arch/$(ARCH)/util/' 2> /dev/null) | ||
190 | |||
191 | # CFLAGS and LDFLAGS are for the users to override from the command line. | 185 | # CFLAGS and LDFLAGS are for the users to override from the command line. |
192 | 186 | ||
193 | # | 187 | # |
@@ -268,6 +262,7 @@ export prefix bindir sharedir sysconfdir | |||
268 | CC = $(CROSS_COMPILE)gcc | 262 | CC = $(CROSS_COMPILE)gcc |
269 | AR = $(CROSS_COMPILE)ar | 263 | AR = $(CROSS_COMPILE)ar |
270 | RM = rm -f | 264 | RM = rm -f |
265 | MKDIR = mkdir | ||
271 | TAR = tar | 266 | TAR = tar |
272 | FIND = find | 267 | FIND = find |
273 | INSTALL = install | 268 | INSTALL = install |
@@ -838,6 +833,7 @@ ifndef V | |||
838 | QUIET_CC = @echo ' ' CC $@; | 833 | QUIET_CC = @echo ' ' CC $@; |
839 | QUIET_AR = @echo ' ' AR $@; | 834 | QUIET_AR = @echo ' ' AR $@; |
840 | QUIET_LINK = @echo ' ' LINK $@; | 835 | QUIET_LINK = @echo ' ' LINK $@; |
836 | QUIET_MKDIR = @echo ' ' MKDIR $@; | ||
841 | QUIET_BUILT_IN = @echo ' ' BUILTIN $@; | 837 | QUIET_BUILT_IN = @echo ' ' BUILTIN $@; |
842 | QUIET_GEN = @echo ' ' GEN $@; | 838 | QUIET_GEN = @echo ' ' GEN $@; |
843 | QUIET_SUBDIR0 = +@subdir= | 839 | QUIET_SUBDIR0 = +@subdir= |
@@ -1012,6 +1008,14 @@ $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H) | |||
1012 | $(patsubst perf-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) | 1008 | $(patsubst perf-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h) |
1013 | builtin-revert.o wt-status.o: wt-status.h | 1009 | builtin-revert.o wt-status.o: wt-status.h |
1014 | 1010 | ||
1011 | # we compile into subdirectories. if the target directory is not the source directory, they might not exists. So | ||
1012 | # we depend the various files onto their directories. | ||
1013 | DIRECTORY_DEPS = $(LIB_OBJS) $(BUILTIN_OBJS) $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h | ||
1014 | $(DIRECTORY_DEPS): $(sort $(dir $(DIRECTORY_DEPS))) | ||
1015 | # In the second step, we make a rule to actually create these directories | ||
1016 | $(sort $(dir $(DIRECTORY_DEPS))): | ||
1017 | $(QUIET_MKDIR)$(MKDIR) -p $@ 2>/dev/null | ||
1018 | |||
1015 | $(LIB_FILE): $(LIB_OBJS) | 1019 | $(LIB_FILE): $(LIB_OBJS) |
1016 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) | 1020 | $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) |
1017 | 1021 | ||
diff --git a/tools/perf/arch/arm/Makefile b/tools/perf/arch/arm/Makefile new file mode 100644 index 000000000000..15130b50dfe3 --- /dev/null +++ b/tools/perf/arch/arm/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/arm/util/dwarf-regs.c b/tools/perf/arch/arm/util/dwarf-regs.c new file mode 100644 index 000000000000..fff6450c8c99 --- /dev/null +++ b/tools/perf/arch/arm/util/dwarf-regs.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * Mapping of DWARF debug register numbers into register names. | ||
3 | * | ||
4 | * Copyright (C) 2010 Will Deacon, ARM Ltd. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <libio.h> | ||
12 | #include <dwarf-regs.h> | ||
13 | |||
14 | struct pt_regs_dwarfnum { | ||
15 | const char *name; | ||
16 | unsigned int dwarfnum; | ||
17 | }; | ||
18 | |||
19 | #define STR(s) #s | ||
20 | #define REG_DWARFNUM_NAME(r, num) {.name = r, .dwarfnum = num} | ||
21 | #define GPR_DWARFNUM_NAME(num) \ | ||
22 | {.name = STR(%r##num), .dwarfnum = num} | ||
23 | #define REG_DWARFNUM_END {.name = NULL, .dwarfnum = 0} | ||
24 | |||
25 | /* | ||
26 | * Reference: | ||
27 | * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040a/IHI0040A_aadwarf.pdf | ||
28 | */ | ||
29 | static const struct pt_regs_dwarfnum regdwarfnum_table[] = { | ||
30 | GPR_DWARFNUM_NAME(0), | ||
31 | GPR_DWARFNUM_NAME(1), | ||
32 | GPR_DWARFNUM_NAME(2), | ||
33 | GPR_DWARFNUM_NAME(3), | ||
34 | GPR_DWARFNUM_NAME(4), | ||
35 | GPR_DWARFNUM_NAME(5), | ||
36 | GPR_DWARFNUM_NAME(6), | ||
37 | GPR_DWARFNUM_NAME(7), | ||
38 | GPR_DWARFNUM_NAME(8), | ||
39 | GPR_DWARFNUM_NAME(9), | ||
40 | GPR_DWARFNUM_NAME(10), | ||
41 | REG_DWARFNUM_NAME("%fp", 11), | ||
42 | REG_DWARFNUM_NAME("%ip", 12), | ||
43 | REG_DWARFNUM_NAME("%sp", 13), | ||
44 | REG_DWARFNUM_NAME("%lr", 14), | ||
45 | REG_DWARFNUM_NAME("%pc", 15), | ||
46 | REG_DWARFNUM_END, | ||
47 | }; | ||
48 | |||
49 | /** | ||
50 | * get_arch_regstr() - lookup register name from it's DWARF register number | ||
51 | * @n: the DWARF register number | ||
52 | * | ||
53 | * get_arch_regstr() returns the name of the register in struct | ||
54 | * regdwarfnum_table from it's DWARF register number. If the register is not | ||
55 | * found in the table, this returns NULL; | ||
56 | */ | ||
57 | const char *get_arch_regstr(unsigned int n) | ||
58 | { | ||
59 | const struct pt_regs_dwarfnum *roff; | ||
60 | for (roff = regdwarfnum_table; roff->name != NULL; roff++) | ||
61 | if (roff->dwarfnum == n) | ||
62 | return roff->name; | ||
63 | return NULL; | ||
64 | } | ||
diff --git a/tools/perf/util/include/linux/types.h b/tools/perf/util/include/linux/types.h index 196862a81a21..12de3b8112f9 100644 --- a/tools/perf/util/include/linux/types.h +++ b/tools/perf/util/include/linux/types.h | |||
@@ -6,4 +6,16 @@ | |||
6 | #define DECLARE_BITMAP(name,bits) \ | 6 | #define DECLARE_BITMAP(name,bits) \ |
7 | unsigned long name[BITS_TO_LONGS(bits)] | 7 | unsigned long name[BITS_TO_LONGS(bits)] |
8 | 8 | ||
9 | struct list_head { | ||
10 | struct list_head *next, *prev; | ||
11 | }; | ||
12 | |||
13 | struct hlist_head { | ||
14 | struct hlist_node *first; | ||
15 | }; | ||
16 | |||
17 | struct hlist_node { | ||
18 | struct hlist_node *next, **pprev; | ||
19 | }; | ||
20 | |||
9 | #endif | 21 | #endif |
diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c index 55ff792459ac..a90273e63f4f 100644 --- a/tools/perf/util/ui/browsers/annotate.c +++ b/tools/perf/util/ui/browsers/annotate.c | |||
@@ -146,6 +146,7 @@ static int annotate_browser__run(struct annotate_browser *self, | |||
146 | return -1; | 146 | return -1; |
147 | 147 | ||
148 | newtFormAddHotKey(self->b.form, NEWT_KEY_LEFT); | 148 | newtFormAddHotKey(self->b.form, NEWT_KEY_LEFT); |
149 | newtFormAddHotKey(self->b.form, NEWT_KEY_RIGHT); | ||
149 | 150 | ||
150 | nd = self->curr_hot; | 151 | nd = self->curr_hot; |
151 | if (nd) { | 152 | if (nd) { |
@@ -178,7 +179,7 @@ static int annotate_browser__run(struct annotate_browser *self, | |||
178 | } | 179 | } |
179 | out: | 180 | out: |
180 | ui_browser__hide(&self->b); | 181 | ui_browser__hide(&self->b); |
181 | return 0; | 182 | return es->u.key; |
182 | } | 183 | } |
183 | 184 | ||
184 | int hist_entry__tui_annotate(struct hist_entry *self) | 185 | int hist_entry__tui_annotate(struct hist_entry *self) |