diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-28 10:42:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-06-04 09:28:53 -0400 |
commit | 1eddd9e4101d21709c453d80a42d2efc4277cb27 (patch) | |
tree | f18a6e71c69edcfaff6e9e9449162c8eb00268c5 /tools/perf | |
parent | 380195e2b07b123fb2cd701bd60e78a31fbf3b25 (diff) |
perf annotate: Adopt anotation options from symbol_conf
Continuing to group annotation options in an annotation specific struct.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-astei92tzxp4yccag5pxb2h7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-annotate.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 6 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/util/annotate.c | 6 | ||||
-rw-r--r-- | tools/perf/util/annotate.h | 4 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 1 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 2 |
7 files changed, 15 insertions, 12 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 7238010f28d4..2ca7172f0780 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -515,9 +515,9 @@ int cmd_annotate(int argc, const char **argv) | |||
515 | OPT_CALLBACK(0, "symfs", NULL, "directory", | 515 | OPT_CALLBACK(0, "symfs", NULL, "directory", |
516 | "Look for files with symbols relative to this directory", | 516 | "Look for files with symbols relative to this directory", |
517 | symbol__config_symfs), | 517 | symbol__config_symfs), |
518 | OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src, | 518 | OPT_BOOLEAN(0, "source", &annotate.opts.annotate_src, |
519 | "Interleave source code with assembly code (default)"), | 519 | "Interleave source code with assembly code (default)"), |
520 | OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw, | 520 | OPT_BOOLEAN(0, "asm-raw", &annotate.opts.show_asm_raw, |
521 | "Display raw encoding of assembly instructions (default)"), | 521 | "Display raw encoding of assembly instructions (default)"), |
522 | OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", | 522 | OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", |
523 | "Specify disassembler style (e.g. -M intel for intel syntax)"), | 523 | "Specify disassembler style (e.g. -M intel for intel syntax)"), |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 7a689c933f04..bee6dbfbf11e 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -71,6 +71,7 @@ struct report { | |||
71 | bool group_set; | 71 | bool group_set; |
72 | int max_stack; | 72 | int max_stack; |
73 | struct perf_read_values show_threads_values; | 73 | struct perf_read_values show_threads_values; |
74 | struct annotation_options annotation_opts; | ||
74 | const char *pretty_printing_style; | 75 | const char *pretty_printing_style; |
75 | const char *cpu_list; | 76 | const char *cpu_list; |
76 | const char *symbol_filter_str; | 77 | const char *symbol_filter_str; |
@@ -988,6 +989,7 @@ int cmd_report(int argc, const char **argv) | |||
988 | .max_stack = PERF_MAX_STACK_DEPTH, | 989 | .max_stack = PERF_MAX_STACK_DEPTH, |
989 | .pretty_printing_style = "normal", | 990 | .pretty_printing_style = "normal", |
990 | .socket_filter = -1, | 991 | .socket_filter = -1, |
992 | .annotation_opts = annotation__default_options, | ||
991 | }; | 993 | }; |
992 | const struct option options[] = { | 994 | const struct option options[] = { |
993 | OPT_STRING('i', "input", &input_name, "file", | 995 | OPT_STRING('i', "input", &input_name, "file", |
@@ -1077,9 +1079,9 @@ int cmd_report(int argc, const char **argv) | |||
1077 | "list of cpus to profile"), | 1079 | "list of cpus to profile"), |
1078 | OPT_BOOLEAN('I', "show-info", &report.show_full_info, | 1080 | OPT_BOOLEAN('I', "show-info", &report.show_full_info, |
1079 | "Display extended information about perf.data file"), | 1081 | "Display extended information about perf.data file"), |
1080 | OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src, | 1082 | OPT_BOOLEAN(0, "source", &report.annotation_opts.annotate_src, |
1081 | "Interleave source code with assembly code (default)"), | 1083 | "Interleave source code with assembly code (default)"), |
1082 | OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw, | 1084 | OPT_BOOLEAN(0, "asm-raw", &report.annotation_opts.show_asm_raw, |
1083 | "Display raw encoding of assembly instructions (default)"), | 1085 | "Display raw encoding of assembly instructions (default)"), |
1084 | OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", | 1086 | OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", |
1085 | "Specify disassembler style (e.g. -M intel for intel syntax)"), | 1087 | "Specify disassembler style (e.g. -M intel for intel syntax)"), |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 2c14ca61c657..e65e72c06a01 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -1340,9 +1340,9 @@ int cmd_top(int argc, const char **argv) | |||
1340 | "only consider symbols in these comms"), | 1340 | "only consider symbols in these comms"), |
1341 | OPT_STRING(0, "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]", | 1341 | OPT_STRING(0, "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]", |
1342 | "only consider these symbols"), | 1342 | "only consider these symbols"), |
1343 | OPT_BOOLEAN(0, "source", &symbol_conf.annotate_src, | 1343 | OPT_BOOLEAN(0, "source", &top.annotation_opts.annotate_src, |
1344 | "Interleave source code with assembly code (default)"), | 1344 | "Interleave source code with assembly code (default)"), |
1345 | OPT_BOOLEAN(0, "asm-raw", &symbol_conf.annotate_asm_raw, | 1345 | OPT_BOOLEAN(0, "asm-raw", &top.annotation_opts.show_asm_raw, |
1346 | "Display raw encoding of assembly instructions (default)"), | 1346 | "Display raw encoding of assembly instructions (default)"), |
1347 | OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, | 1347 | OPT_BOOLEAN(0, "demangle-kernel", &symbol_conf.demangle_kernel, |
1348 | "Enable kernel symbol demangling"), | 1348 | "Enable kernel symbol demangling"), |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 502f9d124a44..ff8f4f474b22 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -47,6 +47,7 @@ | |||
47 | struct annotation_options annotation__default_options = { | 47 | struct annotation_options annotation__default_options = { |
48 | .use_offset = true, | 48 | .use_offset = true, |
49 | .jump_arrows = true, | 49 | .jump_arrows = true, |
50 | .annotate_src = true, | ||
50 | .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS, | 51 | .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS, |
51 | }; | 52 | }; |
52 | 53 | ||
@@ -1609,6 +1610,7 @@ fallback: | |||
1609 | 1610 | ||
1610 | static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) | 1611 | static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) |
1611 | { | 1612 | { |
1613 | struct annotation_options *opts = args->options; | ||
1612 | struct map *map = args->ms.map; | 1614 | struct map *map = args->ms.map; |
1613 | struct dso *dso = map->dso; | 1615 | struct dso *dso = map->dso; |
1614 | char *command; | 1616 | char *command; |
@@ -1661,8 +1663,8 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) | |||
1661 | disassembler_style ? disassembler_style : "", | 1663 | disassembler_style ? disassembler_style : "", |
1662 | map__rip_2objdump(map, sym->start), | 1664 | map__rip_2objdump(map, sym->start), |
1663 | map__rip_2objdump(map, sym->end), | 1665 | map__rip_2objdump(map, sym->end), |
1664 | symbol_conf.annotate_asm_raw ? "" : "--no-show-raw", | 1666 | opts->show_asm_raw ? "" : "--no-show-raw", |
1665 | symbol_conf.annotate_src ? "-S" : "", | 1667 | opts->annotate_src ? "-S" : "", |
1666 | symfs_filename, symfs_filename); | 1668 | symfs_filename, symfs_filename); |
1667 | 1669 | ||
1668 | if (err < 0) { | 1670 | if (err < 0) { |
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 013d414b0e57..476ea2a25649 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -73,7 +73,9 @@ struct annotation_options { | |||
73 | show_nr_jumps, | 73 | show_nr_jumps, |
74 | show_nr_samples, | 74 | show_nr_samples, |
75 | show_total_period, | 75 | show_total_period, |
76 | show_minmax_cycle; | 76 | show_minmax_cycle, |
77 | show_asm_raw, | ||
78 | annotate_src; | ||
77 | u8 offset_level; | 79 | u8 offset_level; |
78 | int min_pcnt; | 80 | int min_pcnt; |
79 | int max_lines; | 81 | int max_lines; |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 8c84437f2a10..3f632c60888f 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -40,7 +40,6 @@ char **vmlinux_path; | |||
40 | struct symbol_conf symbol_conf = { | 40 | struct symbol_conf symbol_conf = { |
41 | .use_modules = true, | 41 | .use_modules = true, |
42 | .try_vmlinux_path = true, | 42 | .try_vmlinux_path = true, |
43 | .annotate_src = true, | ||
44 | .demangle = true, | 43 | .demangle = true, |
45 | .demangle_kernel = false, | 44 | .demangle_kernel = false, |
46 | .cumulate_callchain = true, | 45 | .cumulate_callchain = true, |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 1be9a6bad967..f25fae4b5743 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -108,8 +108,6 @@ struct symbol_conf { | |||
108 | show_cpu_utilization, | 108 | show_cpu_utilization, |
109 | initialized, | 109 | initialized, |
110 | kptr_restrict, | 110 | kptr_restrict, |
111 | annotate_asm_raw, | ||
112 | annotate_src, | ||
113 | event_group, | 111 | event_group, |
114 | demangle, | 112 | demangle, |
115 | demangle_kernel, | 113 | demangle_kernel, |