[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160220231908.GC17925@krava.homerouter.cpe>
Date: Sun, 21 Feb 2016 00:19:08 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
David Ahern <dsahern@...il.com>,
Andi Kleen <andi@...stfloor.org>,
Stephane Eranian <eranian@...gle.com>,
Wang Nan <wangnan0@...wei.com>
Subject: Re: [PATCH v6 20/25] perf hists browser: Implement hierarchy output
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@...nel.org>
> Signed-off-by: Namhyung Kim <namhyung@...nel.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
Powered by blists - more mailing lists