aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Documentation/perf-annotate.txt8
-rw-r--r--tools/perf/builtin-annotate.c4
-rw-r--r--tools/perf/util/annotate.c5
-rw-r--r--tools/perf/util/symbol.c2
-rw-r--r--tools/perf/util/symbol.h4
5 files changed, 21 insertions, 2 deletions
diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index 85c5f026930d..5bc06001557f 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -72,6 +72,14 @@ OPTIONS
72 CPUs are specified with -: 0-2. Default is to report samples on all 72 CPUs are specified with -: 0-2. Default is to report samples on all
73 CPUs. 73 CPUs.
74 74
75--asm-raw::
76 Show raw instruction encoding of assembly instructions. They
77 are displayed by default, disable with --no-asm-raw.
78
79--source::
80 Interleave source code with assembly code. Enabled by default,
81 disable with --no-source.
82
75SEE ALSO 83SEE ALSO
76-------- 84--------
77linkperf:perf-record[1], linkperf:perf-report[1] 85linkperf:perf-record[1], linkperf:perf-report[1]
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 555aefd7fe01..5015e04b8214 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -267,6 +267,10 @@ static const struct option options[] = {
267 OPT_BOOLEAN('P', "full-paths", &full_paths, 267 OPT_BOOLEAN('P', "full-paths", &full_paths,
268 "Don't shorten the displayed pathnames"), 268 "Don't shorten the displayed pathnames"),
269 OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"), 269 OPT_STRING('c', "cpu", &cpu_list, "cpu", "list of cpus to profile"),
270 OPT_BOOLEAN('0', "source", &symbol_conf.annotate_src,
271 "Interleave source code with assembly code (default)"),
272 OPT_BOOLEAN('0', "asm-raw", &symbol_conf.annotate_asm_raw,
273 "Display raw encoding of assembly instructions (default)"),
270 OPT_END() 274 OPT_END()
271}; 275};
272 276
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index e01af2b1a469..01d36ba54053 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -324,9 +324,12 @@ fallback:
324 324
325 snprintf(command, sizeof(command), 325 snprintf(command, sizeof(command),
326 "objdump --start-address=0x%016" PRIx64 326 "objdump --start-address=0x%016" PRIx64
327 " --stop-address=0x%016" PRIx64 " -dS -C %s|grep -v %s|expand", 327 " --stop-address=0x%016" PRIx64
328 " -d %s %s -C %s|grep -v %s|expand",
328 map__rip_2objdump(map, sym->start), 329 map__rip_2objdump(map, sym->start),
329 map__rip_2objdump(map, sym->end), 330 map__rip_2objdump(map, sym->end),
331 symbol_conf.annotate_asm_raw ? "" : "--no-show-raw",
332 symbol_conf.annotate_src ? "-S" : "",
330 symfs_filename, filename); 333 symfs_filename, filename);
331 334
332 pr_debug("Executing: %s\n", command); 335 pr_debug("Executing: %s\n", command);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 469c0264ed29..245e60d6b4e7 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -46,6 +46,8 @@ struct symbol_conf symbol_conf = {
46 .exclude_other = true, 46 .exclude_other = true,
47 .use_modules = true, 47 .use_modules = true,
48 .try_vmlinux_path = true, 48 .try_vmlinux_path = true,
49 .annotate_asm_raw = true,
50 .annotate_src = true,
49 .symfs = "", 51 .symfs = "",
50}; 52};
51 53
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 4f377d92e75a..7733f0b3cd41 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -76,7 +76,9 @@ struct symbol_conf {
76 exclude_other, 76 exclude_other,
77 show_cpu_utilization, 77 show_cpu_utilization,
78 initialized, 78 initialized,
79 kptr_restrict; 79 kptr_restrict,
80 annotate_asm_raw,
81 annotate_src;
80 const char *vmlinux_name, 82 const char *vmlinux_name,
81 *kallsyms_name, 83 *kallsyms_name,
82 *source_prefix, 84 *source_prefix,