[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <158296780991.28353.14518438084692933878.tip-bot2@tip-bot2>
Date: Sat, 29 Feb 2020 09:16:49 -0000
From: "tip-bot2 for Ravi Bangoria" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexey Budankov <alexey.budankov@...ux.intel.com>,
Changbin Du <changbin.du@...el.com>,
Ian Rogers <irogers@...gle.com>,
Jin Yao <yao.jin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Leo Yan <leo.yan@...aro.org>,
Namhyung Kim <namhyung@...nel.org>,
Song Liu <songliubraving@...com>,
Taeung Song <treeze.taeung@...il.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Yisheng Xie <xieyisheng1@...wei.com>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/urgent] perf annotate: Fix --show-nr-samples for tui/stdio2
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: 46ccb44269665bba6a9bf0f77fe776421fc2304c
Gitweb: https://git.kernel.org/tip/46ccb44269665bba6a9bf0f77fe776421fc2304c
Author: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
AuthorDate: Thu, 13 Feb 2020 12:13:01 +05:30
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Thu, 27 Feb 2020 10:44:48 -03:00
perf annotate: Fix --show-nr-samples for tui/stdio2
perf annotate --show-nr-samples does not really show number of samples.
The reason is we have two separate variables for the same purpose.
One is in symbol_conf.show_nr_samples and another is
annotation_options.show_nr_samples.
We save command line option in symbol_conf.show_nr_samples but uses
annotation_option.show_nr_samples while rendering tui/stdio2 browser.
Though, we copy symbol_conf.show_nr_samples to
annotation__default_options.show_nr_samples but that is not really
effective as we don't use annotation__default_options once we copy
default options to dynamic variable annotate.opts in cmd_annotate().
Instead of all these complication, keep only one variable and use it all
over. symbol_conf.show_nr_samples is used by perf report/top as well. So
let's kill annotation_options.show_nr_samples.
On a side note, I've kept annotation_options.show_nr_samples definition
because it's still used by perf-config code. Follow up patch to fix
perf-config for annotate will remove annotation_options.show_nr_samples.
Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Changbin Du <changbin.du@...el.com>
Cc: Ian Rogers <irogers@...gle.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Leo Yan <leo.yan@...aro.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Song Liu <songliubraving@...com>
Cc: Taeung Song <treeze.taeung@...il.com>
Cc: Thomas Richter <tmricht@...ux.ibm.com>
Cc: Yisheng Xie <xieyisheng1@...wei.com>
Link: http://lore.kernel.org/lkml/20200213064306.160480-4-ravi.bangoria@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/ui/browsers/annotate.c | 6 +++---
tools/perf/util/annotate.c | 6 ++----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 7e5b44b..9023267 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -835,9 +835,9 @@ show_sup_ins:
case 't':
if (symbol_conf.show_total_period) {
symbol_conf.show_total_period = false;
- notes->options->show_nr_samples = true;
- } else if (notes->options->show_nr_samples)
- notes->options->show_nr_samples = false;
+ symbol_conf.show_nr_samples = true;
+ } else if (symbol_conf.show_nr_samples)
+ symbol_conf.show_nr_samples = false;
else
symbol_conf.show_total_period = true;
annotation__update_column_widths(notes);
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index fe4b44d..f0741da 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -2917,7 +2917,7 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati
obj__set_percent_color(obj, percent, current_entry);
if (symbol_conf.show_total_period) {
obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period);
- } else if (notes->options->show_nr_samples) {
+ } else if (symbol_conf.show_nr_samples) {
obj__printf(obj, "%6" PRIu64 " ",
al->data[i].he.nr_samples);
} else {
@@ -2932,7 +2932,7 @@ static void __annotation_line__write(struct annotation_line *al, struct annotati
else {
obj__printf(obj, "%-*s", pcnt_width,
symbol_conf.show_total_period ? "Period" :
- notes->options->show_nr_samples ? "Samples" : "Percent");
+ symbol_conf.show_nr_samples ? "Samples" : "Percent");
}
}
@@ -3154,8 +3154,6 @@ static int annotation__config(const char *var, const char *value,
void annotation_config__init(void)
{
perf_config(annotation__config, NULL);
-
- annotation__default_options.show_nr_samples = symbol_conf.show_nr_samples;
}
static unsigned int parse_percent_type(char *str1, char *str2)
Powered by blists - more mailing lists