Skip to content

Commit a47e843

Browse files
committed
perf annotate: Move disassembler_style global to annotation_options
Continuing to group annotation specific stuff into a 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-p3cdhltj58jt0byjzg3g7obx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 1eddd9e commit a47e843

5 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎tools/perf/builtin-annotate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ int cmd_annotate(int argc, const char **argv)
519519
"Interleave source code with assembly code (default)"),
520520
OPT_BOOLEAN(0, "asm-raw", &annotate.opts.show_asm_raw,
521521
"Display raw encoding of assembly instructions (default)"),
522-
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
522+
OPT_STRING('M', "disassembler-style", &annotate.opts.disassembler_style, "disassembler style",
523523
"Specify disassembler style (e.g. -M intel for intel syntax)"),
524524
OPT_STRING(0, "objdump", &objdump_path, "path",
525525
"objdump binary to use for disassembly and annotations"),

‎tools/perf/builtin-report.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ int cmd_report(int argc, const char **argv)
10831083
"Interleave source code with assembly code (default)"),
10841084
OPT_BOOLEAN(0, "asm-raw", &report.annotation_opts.show_asm_raw,
10851085
"Display raw encoding of assembly instructions (default)"),
1086-
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
1086+
OPT_STRING('M', "disassembler-style", &report.annotation_opts.disassembler_style, "disassembler style",
10871087
"Specify disassembler style (e.g. -M intel for intel syntax)"),
10881088
OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period,
10891089
"Show a column with the sum of periods"),

‎tools/perf/builtin-top.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ int cmd_top(int argc, const char **argv)
13481348
"Enable kernel symbol demangling"),
13491349
OPT_STRING(0, "objdump", &objdump_path, "path",
13501350
"objdump binary to use for disassembly and annotations"),
1351-
OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style",
1351+
OPT_STRING('M', "disassembler-style", &top.annotation_opts.disassembler_style, "disassembler style",
13521352
"Specify disassembler style (e.g. -M intel for intel syntax)"),
13531353
OPT_STRING('u', "uid", &target->uid_str, "user", "user to profile"),
13541354
OPT_CALLBACK(0, "percent-limit", &top, "percent",

‎tools/perf/util/annotate.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ struct annotation_options annotation__default_options = {
5151
.offset_level = ANNOTATION__OFFSET_JUMP_TARGETS,
5252
};
5353

54-
const char *disassembler_style;
5554
const char *objdump_path;
5655
static regex_t file_lineno;
5756

@@ -1659,8 +1658,8 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args)
16591658
" --stop-address=0x%016" PRIx64
16601659
" -l -d %s %s -C \"%s\" 2>/dev/null|grep -v \"%s:\"|expand",
16611660
objdump_path ? objdump_path : "objdump",
1662-
disassembler_style ? "-M " : "",
1663-
disassembler_style ? disassembler_style : "",
1661+
opts->disassembler_style ? "-M " : "",
1662+
opts->disassembler_style ?: "",
16641663
map__rip_2objdump(map, sym->start),
16651664
map__rip_2objdump(map, sym->end),
16661665
opts->show_asm_raw ? "" : "--no-show-raw",

‎tools/perf/util/annotate.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct annotation_options {
8080
int min_pcnt;
8181
int max_lines;
8282
int context;
83+
const char *disassembler_style;
8384
};
8485

8586
enum {
@@ -368,8 +369,6 @@ static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused,
368369
}
369370
#endif
370371

371-
extern const char *disassembler_style;
372-
373372
void annotation_config__init(void);
374373

375374
#endif /* __PERF_ANNOTATE_H */

0 commit comments

Comments
 (0)