aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2011-09-15 17:31:41 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-09-29 16:10:00 -0400
commitf69b64f73e1d7f47a9205c1cd46e0e1c3c65e1cd (patch)
treed524df90f8f78da2feebf63619101512d088a27c /tools
parent33e49ea70df066651a17061c62118fc3f075d21f (diff)
perf: Support setting the disassembler style
Add -M option to report/annotate to pass directly to objdump. This allows to use -M intel for intel style disassembler syntax, which is useful for people who are very used to the Intel syntax. Link: http://lkml.kernel.org/r/1316122302-24306-2-git-send-email-andi@firstfloor.org [committer note: Add missing Documentation bits, fixup conflicts with 3e6a2a7] Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Stephane Eranian <eranian@google.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/Documentation/perf-annotate.txt3
-rw-r--r--tools/perf/Documentation/perf-report.txt3
-rw-r--r--tools/perf/builtin-annotate.c2
-rw-r--r--tools/perf/builtin-report.c2
-rw-r--r--tools/perf/util/annotate.c6
-rw-r--r--tools/perf/util/annotate.h2
6 files changed, 17 insertions, 1 deletions
diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 98a31e3181a5..0102d83600db 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -83,6 +83,9 @@ OPTIONS
83--symfs=<directory>:: 83--symfs=<directory>::
84 Look for files with symbols relative to this directory. 84 Look for files with symbols relative to this directory.
85 85
86-M::
87--disassembler-style=:: Set disassembler style for objdump.
88
86SEE ALSO 89SEE ALSO
87-------- 90--------
88linkperf:perf-record[1], linkperf:perf-report[1] 91linkperf:perf-record[1], linkperf:perf-report[1]
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 04253c07d19a..6349b6c0e3ec 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -134,6 +134,9 @@ OPTIONS
134 CPUs are specified with -: 0-2. Default is to report samples on all 134 CPUs are specified with -: 0-2. Default is to report samples on all
135 CPUs. 135 CPUs.
136 136
137-M::
138--disassembler-style=:: Set disassembler style for objdump.
139
137SEE ALSO 140SEE ALSO
138-------- 141--------
139linkperf:perf-stat[1] 142linkperf:perf-stat[1]
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index c5be28851f01..cf68819f7453 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -273,6 +273,8 @@ static const struct option options[] = {
273 "Interleave source code with assembly code (default)"), 273 "Interleave source code with assembly code (default)"),
274 OPT_BOOLEAN('0', "asm-raw", &symbol_conf.annotate_asm_raw, 274 OPT_BOOLEAN('0', "asm-raw", &symbol_conf.annotate_asm_raw,
275 "Display raw encoding of assembly instructions (default)"), 275 "Display raw encoding of assembly instructions (default)"),
276 OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
277 "Specify disassembler style (e.g. -M intel for intel syntax)"),
276 OPT_END() 278 OPT_END()
277}; 279};
278 280
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index d7ff277bdb78..a0673eeeae8d 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -487,6 +487,8 @@ static const struct option options[] = {
487 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", 487 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory",
488 "Look for files with symbols relative to this directory"), 488 "Look for files with symbols relative to this directory"),
489 OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"), 489 OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
490 OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
491 "Specify disassembler style (e.g. -M intel for intel syntax)"),
490 OPT_END() 492 OPT_END()
491}; 493};
492 494
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 01d36ba54053..bc8f4773d4d8 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -16,6 +16,8 @@
16#include "annotate.h" 16#include "annotate.h"
17#include <pthread.h> 17#include <pthread.h>
18 18
19const char *disassembler_style;
20
19int symbol__annotate_init(struct map *map __used, struct symbol *sym) 21int symbol__annotate_init(struct map *map __used, struct symbol *sym)
20{ 22{
21 struct annotation *notes = symbol__annotation(sym); 23 struct annotation *notes = symbol__annotation(sym);
@@ -323,9 +325,11 @@ fallback:
323 dso, dso->long_name, sym, sym->name); 325 dso, dso->long_name, sym, sym->name);
324 326
325 snprintf(command, sizeof(command), 327 snprintf(command, sizeof(command),
326 "objdump --start-address=0x%016" PRIx64 328 "objdump %s%s --start-address=0x%016" PRIx64
327 " --stop-address=0x%016" PRIx64 329 " --stop-address=0x%016" PRIx64
328 " -d %s %s -C %s|grep -v %s|expand", 330 " -d %s %s -C %s|grep -v %s|expand",
331 disassembler_style ? "-M " : "",
332 disassembler_style ? disassembler_style : "",
329 map__rip_2objdump(map, sym->start), 333 map__rip_2objdump(map, sym->start),
330 map__rip_2objdump(map, sym->end), 334 map__rip_2objdump(map, sym->end),
331 symbol_conf.annotate_asm_raw ? "" : "--no-show-raw", 335 symbol_conf.annotate_asm_raw ? "" : "--no-show-raw",
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index c2c286896801..6ede1286ee71 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -100,4 +100,6 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx,
100 int refresh); 100 int refresh);
101#endif 101#endif
102 102
103extern const char *disassembler_style;
104
103#endif /* __PERF_ANNOTATE_H */ 105#endif /* __PERF_ANNOTATE_H */