[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160220231856.GB17925@krava.homerouter.cpe>
Date: Sun, 21 Feb 2016 00:18:56 +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 16/25] perf ui/stdio: Implement hierarchy output mode
On Tue, Feb 16, 2016 at 11:08:34PM +0900, Namhyung Kim wrote:
SNIP
> +static int hist_entry__hierarchy_fprintf(struct hist_entry *he,
> + struct perf_hpp *hpp,
> + int nr_sort_key, struct hists *hists,
> + FILE *fp)
> +{
> + const char *sep = symbol_conf.field_sep;
> + struct perf_hpp_fmt *fmt;
> + char *buf = hpp->buf;
> + int ret, printed = 0;
> + bool first = true;
> +
> + if (symbol_conf.exclude_other && !he->parent)
> + return 0;
> +
> + ret = scnprintf(hpp->buf, hpp->size, "%*s", he->depth * HIERARCHY_INDENT, "");
> + advance_hpp(hpp, ret);
> +
> + hists__for_each_format(he->hists, fmt) {
> + if (perf_hpp__is_sort_entry(fmt) || perf_hpp__is_dynamic_entry(fmt))
> + break;
> +
> + /*
> + * If there's no field_sep, we still need
> + * to display initial ' '.
> + */
> + if (!sep || !first) {
> + ret = scnprintf(hpp->buf, hpp->size, "%s", sep ?: " ");
> + advance_hpp(hpp, ret);
> + } else
> + first = false;
> +
> + if (perf_hpp__use_color() && fmt->color)
> + ret = fmt->color(fmt, hpp, he);
> + else
> + ret = fmt->entry(fmt, hpp, he);
> +
> + advance_hpp(hpp, ret);
there's new hist_entry__snprintf_alignment function for
proper alignment now used in hist_entry__hierarchy_fprintf
you might wat to use it in here as well
jirka
Powered by blists - more mailing lists