summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2013-05-15 07:56:51 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-07-12 18:45:46 +0200
commit0d3942dbcf7f7e8955ba89deed4749b0ad64d721 (patch)
tree188e7a090238221855e3efe02e38466adcbcd922 /tools/perf/builtin-top.c
parentperf tools: Rename cpu_map__all() to cpu_map__empty() (diff)
downloadlinux-0d3942dbcf7f7e8955ba89deed4749b0ad64d721.tar.xz
linux-0d3942dbcf7f7e8955ba89deed4749b0ad64d721.zip
perf top: Add --objdump option
perf: Add objdump option to 'perf top' Like with 'perf annotate' add the --objdump option to perf top so users can specify an alternate path to the /usr/bin/objdump binary. Reported-by: David A. Gilbert <DavidAGilbert@uk.ibm.com> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Cc: DavidAGilbert@uk.ibm.com Cc: Jiri Olsa <jolsa@redhat.com> Cc: Maynard Johnson <mpjohn@us.ibm.com> Link: http://lkml.kernel.org/r/20130515055651.GA9985@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index e06c4f869330..a237059f51cf 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -40,6 +40,7 @@
#include "util/xyarray.h"
#include "util/sort.h"
#include "util/intlist.h"
+#include "arch/common.h"
#include "util/debug.h"
@@ -939,6 +940,12 @@ static int __cmd_top(struct perf_top *top)
if (top->session == NULL)
return -ENOMEM;
+ if (!objdump_path) {
+ ret = perf_session_env__lookup_objdump(&top->session->header.env);
+ if (ret)
+ goto out_delete;
+ }
+
ret = perf_top__setup_sample_type(top);
if (ret)
goto out_delete;
@@ -1114,6 +1121,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
"Interleave source code with assembly code (default)"),
OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw,
"Display raw encoding of assembly instructions (default)"),
+ OPT_STRING(0, "objdump", &objdump_path, "path",
+ "objdump binary to use for disassembly and annotations"),
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
"Specify disassembler style (e.g. -M intel for intel syntax)"),
OPT_STRING('u', "uid", &target->uid_str, "user", "user to profile"),