Commit f69b64f73e1d7f47a9205c1cd46e0e1c3c65e1cd
Committed by
Arnaldo Carvalho de Melo
1 parent
33e49ea70d
Exists in
master
and in
6 other branches
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>
Showing 6 changed files with 17 additions and 1 deletions Side-by-side Diff
tools/perf/Documentation/perf-annotate.txt
tools/perf/Documentation/perf-report.txt
tools/perf/builtin-annotate.c
... | ... | @@ -273,6 +273,8 @@ |
273 | 273 | "Interleave source code with assembly code (default)"), |
274 | 274 | OPT_BOOLEAN('0', "asm-raw", &symbol_conf.annotate_asm_raw, |
275 | 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 | 278 | OPT_END() |
277 | 279 | }; |
278 | 280 |
tools/perf/builtin-report.c
... | ... | @@ -487,6 +487,8 @@ |
487 | 487 | OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", |
488 | 488 | "Look for files with symbols relative to this directory"), |
489 | 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 | 492 | OPT_END() |
491 | 493 | }; |
492 | 494 |
tools/perf/util/annotate.c
... | ... | @@ -16,6 +16,8 @@ |
16 | 16 | #include "annotate.h" |
17 | 17 | #include <pthread.h> |
18 | 18 | |
19 | +const char *disassembler_style; | |
20 | + | |
19 | 21 | int symbol__annotate_init(struct map *map __used, struct symbol *sym) |
20 | 22 | { |
21 | 23 | struct annotation *notes = symbol__annotation(sym); |
22 | 24 | |
... | ... | @@ -323,9 +325,11 @@ |
323 | 325 | dso, dso->long_name, sym, sym->name); |
324 | 326 | |
325 | 327 | snprintf(command, sizeof(command), |
326 | - "objdump --start-address=0x%016" PRIx64 | |
328 | + "objdump %s%s --start-address=0x%016" PRIx64 | |
327 | 329 | " --stop-address=0x%016" PRIx64 |
328 | 330 | " -d %s %s -C %s|grep -v %s|expand", |
331 | + disassembler_style ? "-M " : "", | |
332 | + disassembler_style ? disassembler_style : "", | |
329 | 333 | map__rip_2objdump(map, sym->start), |
330 | 334 | map__rip_2objdump(map, sym->end), |
331 | 335 | symbol_conf.annotate_asm_raw ? "" : "--no-show-raw", |