* [PATCH v4 4/9] perf annotate browser: Show the proper header when using --show-total-period
@ 2017-07-27 16:16 Taeung Song
2017-07-30 9:41 ` [tip:perf/core] perf annotate TUI: Fix column header when toggling period/percent tip-bot for Taeung Song
0 siblings, 1 reply; 2+ messages in thread
From: Taeung Song @ 2017-07-27 16:16 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: linux-kernel, Milian Wolff, Namhyung Kim, Jiri Olsa
Currently a first column is only "Percent",
so fix it to show correct column name based on given options.
(e.g. if using --show-total-period or a 't' hotkey,
show "Event count" as a first column)
Reported-by: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
tools/perf/ui/browsers/annotate.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 87b0395..9fd4413 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -165,8 +165,12 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
if (!show_title)
ui_browser__write_nstring(browser, " ", pcnt_width);
- else
- ui_browser__printf(browser, "%*s", 7, "Percent");
+ else {
+ if (annotate_browser__opts.show_total_period)
+ ui_browser__printf(browser, "%*s", 11, "Event count");
+ else
+ ui_browser__printf(browser, "%*s", 7, "Percent");
+ }
}
if (ab->have_cycles) {
if (dl->ipc)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:perf/core] perf annotate TUI: Fix column header when toggling period/percent
2017-07-27 16:16 [PATCH v4 4/9] perf annotate browser: Show the proper header when using --show-total-period Taeung Song
@ 2017-07-30 9:41 ` tip-bot for Taeung Song
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Taeung Song @ 2017-07-30 9:41 UTC (permalink / raw)
To: linux-tip-commits
Cc: acme, tglx, mingo, dsahern, wangnan0, jolsa, hpa, adrian.hunter,
treeze.taeung, namhyung, linux-kernel
Commit-ID: f67d395c6e3895c3c8c67c8f7523f6a94d61a82d
Gitweb: http://git.kernel.org/tip/f67d395c6e3895c3c8c67c8f7523f6a94d61a82d
Author: Taeung Song <treeze.taeung@gmail.com>
AuthorDate: Fri, 28 Jul 2017 12:04:32 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 28 Jul 2017 12:53:08 -0300
perf annotate TUI: Fix column header when toggling period/percent
We have the 't' hotkey to toggle showing either the total period or the
percentage of samples for a given line, but we forgot to toggle as well
the column header, always showing "Percent", even when showing the
period, fix it.
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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: http://lkml.kernel.org/r/1501172169-6761-1-git-send-email-treeze.taeung@gmail.com
[ Extracted from a larger patch, s/Event count/Period/g ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/browsers/annotate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 0f4bcc0..46f297a 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -166,7 +166,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
if (!show_title)
ui_browser__write_nstring(browser, " ", pcnt_width);
else
- ui_browser__printf(browser, "%*s", 7, "Percent");
+ ui_browser__printf(browser, "%*s", 7, annotate_browser__opts.show_total_period ? "Period" : "Percent");
}
if (ab->have_cycles) {
if (dl->ipc)
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-30 9:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 16:16 [PATCH v4 4/9] perf annotate browser: Show the proper header when using --show-total-period Taeung Song
2017-07-30 9:41 ` [tip:perf/core] perf annotate TUI: Fix column header when toggling period/percent tip-bot for Taeung Song
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.