From: Jiri Olsa <jolsa@redhat.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>, Andi Kleen <andi@firstfloor.org>,
Stephane Eranian <eranian@google.com>,
Wang Nan <wangnan0@huawei.com>
Subject: Re: [PATCH v6 20/25] perf hists browser: Implement hierarchy output
Date: Sun, 21 Feb 2016 00:19:08 +0100 [thread overview]
Message-ID: <20160220231908.GC17925@krava.homerouter.cpe> (raw)
In-Reply-To: <1455631723-17345-21-git-send-email-namhyung@kernel.org>
On Tue, Feb 16, 2016 at 11:08:38PM +0900, Namhyung Kim wrote:
> Implement hierarchy mode in TUI. The output is look like stdio but it
> also supports to fold/unfold children dynamically.
>
> Acked-by: Pekka Enberg <penberg@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/ui/browsers/hists.c | 269 +++++++++++++++++++++++++++++++++++++----
> 1 file changed, 247 insertions(+), 22 deletions(-)
>
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index 857b9beb0aab..d209cf07bd12 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -1260,6 +1260,137 @@ static int hist_browser__show_entry(struct hist_browser *browser,
> return printed;
> }
>
> +static int hist_browser__show_hierarchy_entry(struct hist_browser *browser,
> + struct hist_entry *entry,
> + unsigned short row,
> + int level, int nr_sort_keys)
> +{
SNIP
> +
> + hists__for_each_format(entry->hists, fmt) {
> + if (perf_hpp__should_skip(fmt, entry->hists) ||
> + column++ < browser->b.horiz_scroll)
> + continue;
> +
> + if (perf_hpp__is_sort_entry(fmt) ||
> + perf_hpp__is_dynamic_entry(fmt))
> + break;
> +
> + if (current_entry && browser->b.navkeypressed) {
> + ui_browser__set_color(&browser->b,
> + HE_COLORSET_SELECTED);
> + } else {
> + ui_browser__set_color(&browser->b,
> + HE_COLORSET_NORMAL);
> + }
> +
> + if (first) {
> + ui_browser__printf(&browser->b, "%c", folded_sign);
> + width--;
> + first = false;
> + } else {
> + ui_browser__printf(&browser->b, " ");
> + width -= 2;
> + }
> +
> + if (fmt->color) {
> + width -= fmt->color(fmt, &hpp, entry);
> + } else {
> + width -= fmt->entry(fmt, &hpp, entry);
> + ui_browser__printf(&browser->b, "%s", s);
> + }
same as for stdio patch comment, you might want to use
hist_entry__snprintf_alignment in here
jirka
next prev parent reply other threads:[~2016-02-20 23:19 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 14:08 [PATCHSET 00/25] perf tools: Add support for hierachy view (v6) Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 01/25] perf hists browser: Fix percentage update on key press Namhyung Kim
2016-02-16 20:06 ` Arnaldo Carvalho de Melo
2016-02-16 20:53 ` Arnaldo Carvalho de Melo
2016-02-16 23:39 ` Namhyung Kim
2016-02-17 13:41 ` Arnaldo Carvalho de Melo
2016-02-20 11:39 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 02/25] perf callchain: Check return value of add_child() Namhyung Kim
2016-02-20 11:39 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 03/25] perf callchain: Check return value of fill_node() Namhyung Kim
2016-02-20 11:39 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 04/25] perf callchain: Add enum match_result for match_chain() Namhyung Kim
2016-02-20 11:40 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 05/25] perf callchain: Check return value of split_add_child() Namhyung Kim
2016-02-20 11:40 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 06/25] perf callchain: Check return value of append_chain_children() Namhyung Kim
2016-02-20 11:40 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 07/25] perf hists: Return error from hists__collapse_resort() Namhyung Kim
2016-02-20 11:41 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 08/25] perf report: Check error during report__collapse_hists() Namhyung Kim
2016-02-20 11:41 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 09/25] perf hists: Basic support of hierarchical report view Namhyung Kim
2016-02-20 23:18 ` Jiri Olsa
2016-02-21 8:32 ` Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 10/25] perf hists: Resort hist entries with hierarchy Namhyung Kim
2016-02-20 23:19 ` Jiri Olsa
2016-02-21 8:36 ` Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 11/25] perf hists: Add helper functions for hierarchy mode Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 12/25] perf hists: Introduce hist_entry__filter() Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 13/25] perf hists: Support filtering in hierarchy mode Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 14/25] perf hists: Resort after filtering hierarchy Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 15/25] perf hists: Count number of sort keys Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 16/25] perf ui/stdio: Implement hierarchy output mode Namhyung Kim
2016-02-20 23:18 ` Jiri Olsa
2016-02-21 8:43 ` Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 17/25] perf ui/stdio: Align column header for hierarchy output Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 18/25] perf hists browser: Count number of hierarchy entries Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 19/25] perf hists browser: Support collapsing/expanding whole entries in hierarchy Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 20/25] perf hists browser: Implement hierarchy output Namhyung Kim
2016-02-20 23:19 ` Jiri Olsa [this message]
2016-02-16 14:08 ` [PATCH v6 21/25] perf hists browser: Align column header in hierarchy mode Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 22/25] perf ui/gtk: Implement hierarchy output mode Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 23/25] perf report: Add --hierarchy option Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 24/25] perf hists: Support decaying in hierarchy mode Namhyung Kim
2016-02-16 14:08 ` [PATCH v6 25/25] perf top: Add --hierarchy option Namhyung Kim
2016-02-20 23:19 ` Jiri Olsa
2016-02-21 9:19 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160220231908.GC17925@krava.homerouter.cpe \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox