From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Dave Jones <davej@codemonkey.org.uk>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
linux-perf-users@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] perf hists: Do column alignment on the format iterator
Date: Fri, 12 Feb 2016 13:57:56 +0100 [thread overview]
Message-ID: <20160212125756.GC16190@krava.redhat.com> (raw)
In-Reply-To: <20160211202718.GD32168@kernel.org>
On Thu, Feb 11, 2016 at 05:27:18PM -0300, Arnaldo Carvalho de Melo wrote:
> We were doing column alignment in the format function for each cell,
> returning a string padded with spaces so that when the next column is
> printed the cursor is at its column alignment.
>
> This ends up needlessly printing trailing spaces, do it at the format
> iterator, that is where we know if it is needed, i.e. if there is more
> columns to be printed.
>
> This eliminates the need for triming lines when doing a dump using 'P'
> in the TUI browser and also produces far saner results with things like
> piping 'perf report' to 'less'.
>
> Right now only the formatters for sym->name and the 'locked' column
> (perf mem report), that are the ones that end up at the end of lines
> in the default 'perf report', 'perf top' and 'perf mem report' tools,
> the others will be done in a subsequent patch.
>
> In the end the 'width' parameter for the formatters now mean, in
> 'printf' terms, the 'precision', where before it was the field 'width'.
>
> Reported-by: Dave Jones <davej@codemonkey.org.uk>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Link: http://lkml.kernel.org/n/tip-s7iwl2gj23w92l6tibnrcqzr@git.kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/perf/ui/browsers/hists.c | 17 ++++++++++-------
> tools/perf/ui/stdio/hist.c | 1 +
> tools/perf/util/hist.c | 21 +++++++++++++++++++++
> tools/perf/util/hist.h | 5 +++++
> tools/perf/util/sort.c | 13 +++----------
> 5 files changed, 40 insertions(+), 17 deletions(-)
>
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index a5a5390476ac..af608d5da17d 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -1086,16 +1086,17 @@ static int hist_browser__show_entry(struct hist_browser *browser,
> .folded_sign = folded_sign,
> .current_entry = current_entry,
> };
> - struct perf_hpp hpp = {
> - .buf = s,
> - .size = sizeof(s),
> - .ptr = &arg,
> - };
if you're moving this, you can move the 's' buffer as well
jirka
prev parent reply other threads:[~2016-02-12 12:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 20:27 [RFC PATCH] perf hists: Do column alignment on the format iterator Arnaldo Carvalho de Melo
2016-02-12 12:56 ` Jiri Olsa
2016-02-12 13:26 ` Arnaldo Carvalho de Melo
2016-02-12 15:50 ` Arnaldo Carvalho de Melo
2016-02-12 12:57 ` Jiri Olsa [this message]
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=20160212125756.GC16190@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=davej@codemonkey.org.uk \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).