aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-05-25 16:28:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-06-04 09:28:52 -0400
commit982d410bc6b405a75086236d3c1da1f18c40d6dd (patch)
tree79c972cc96866830d8bd0aa8778aeb24740094cb /tools/perf/builtin-annotate.c
parent9132d3d92d8953ee79690408a9a24d938be22cd8 (diff)
perf annotate stdio: Use annotation_options consistently
Accross all the routines, this way we can have eventually have a consistent set of defaults for all UIs. 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-6qgtixurjgdk5u0n3rw78ges@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 2b21bbcd70ea..7238010f28d4 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -40,9 +40,8 @@
40struct perf_annotate { 40struct perf_annotate {
41 struct perf_tool tool; 41 struct perf_tool tool;
42 struct perf_session *session; 42 struct perf_session *session;
43 struct annotation_options opts;
43 bool use_tui, use_stdio, use_stdio2, use_gtk; 44 bool use_tui, use_stdio, use_stdio2, use_gtk;
44 bool full_paths;
45 bool print_line;
46 bool skip_missing; 45 bool skip_missing;
47 bool has_br_stack; 46 bool has_br_stack;
48 bool group_set; 47 bool group_set;
@@ -289,10 +288,9 @@ static int hist_entry__tty_annotate(struct hist_entry *he,
289 struct perf_annotate *ann) 288 struct perf_annotate *ann)
290{ 289{
291 if (!ann->use_stdio2) 290 if (!ann->use_stdio2)
292 return symbol__tty_annotate(he->ms.sym, he->ms.map, evsel, 291 return symbol__tty_annotate(he->ms.sym, he->ms.map, evsel, &ann->opts);
293 ann->print_line, ann->full_paths, 0, 0); 292
294 return symbol__tty_annotate2(he->ms.sym, he->ms.map, evsel, 293 return symbol__tty_annotate2(he->ms.sym, he->ms.map, evsel, &ann->opts);
295 ann->print_line, ann->full_paths);
296} 294}
297 295
298static void hists__find_annotations(struct hists *hists, 296static void hists__find_annotations(struct hists *hists,
@@ -476,6 +474,7 @@ int cmd_annotate(int argc, const char **argv)
476 .ordered_events = true, 474 .ordered_events = true,
477 .ordering_requires_timestamps = true, 475 .ordering_requires_timestamps = true,
478 }, 476 },
477 .opts = annotation__default_options,
479 }; 478 };
480 struct perf_data data = { 479 struct perf_data data = {
481 .mode = PERF_DATA_MODE_READ, 480 .mode = PERF_DATA_MODE_READ,
@@ -503,9 +502,9 @@ int cmd_annotate(int argc, const char **argv)
503 "file", "vmlinux pathname"), 502 "file", "vmlinux pathname"),
504 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules, 503 OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,
505 "load module symbols - WARNING: use only with -k and LIVE kernel"), 504 "load module symbols - WARNING: use only with -k and LIVE kernel"),
506 OPT_BOOLEAN('l', "print-line", &annotate.print_line, 505 OPT_BOOLEAN('l', "print-line", &annotate.opts.print_lines,
507 "print matching source lines (may be slow)"), 506 "print matching source lines (may be slow)"),
508 OPT_BOOLEAN('P', "full-paths", &annotate.full_paths, 507 OPT_BOOLEAN('P', "full-paths", &annotate.opts.full_path,
509 "Don't shorten the displayed pathnames"), 508 "Don't shorten the displayed pathnames"),
510 OPT_BOOLEAN(0, "skip-missing", &annotate.skip_missing, 509 OPT_BOOLEAN(0, "skip-missing", &annotate.skip_missing,
511 "Skip symbols that cannot be annotated"), 510 "Skip symbols that cannot be annotated"),