Skip to content

Commit 812b0f5

Browse files
Ravi Bangoriaacmel
authored andcommitted
perf annotate: Prefer cmdline option over default config
For all the perf-config options that can also be set from command line option, the preference is given to command line version in case of any conflict. But that's opposite in case of perf annotate. i.e. the more preference is given to default option rather than command line option. Fix it. Before: $ ./perf config annotate.show_nr_samples=false $ ./perf annotate shash --show-nr-samples Percent│ │24: mov -0xc(%rbp),%eax 49.19 │ imul $0x1003f,%eax,%ecx │ mov -0x18(%rbp),%rax After: Samples│ │24: mov -0xc(%rbp),%eax 1 │ imul $0x1003f,%eax,%ecx │ mov -0x18(%rbp),%rax Signed-off-by: Ravi Bangoria <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexey Budankov <[email protected]> Cc: Changbin Du <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jin Yao <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Leo Yan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Song Liu <[email protected]> Cc: Taeung Song <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Yisheng Xie <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 7384083 commit 812b0f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/perf/builtin-annotate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ int cmd_annotate(int argc, const char **argv)
566566
if (ret < 0)
567567
return ret;
568568

569+
annotation_config__init(&annotate.opts);
570+
569571
argc = parse_options(argc, argv, options, annotate_usage, 0);
570572
if (argc) {
571573
/*
@@ -605,8 +607,6 @@ int cmd_annotate(int argc, const char **argv)
605607
if (ret < 0)
606608
goto out_delete;
607609

608-
annotation_config__init(&annotate.opts);
609-
610610
symbol_conf.try_vmlinux_path = true;
611611

612612
ret = symbol__init(&annotate.session->header.env);

0 commit comments

Comments
 (0)