From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
Namhyung Kim <namhyung.kim@lge.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/6] perf report: Honor column width setting
Date: Thu, 24 Jul 2014 16:49:06 +0200 [thread overview]
Message-ID: <20140724144906.GA25165@krava.brq.redhat.com> (raw)
In-Reply-To: <20140724135747.GS20303@kernel.org>
On Thu, Jul 24, 2014 at 10:57:47AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jul 24, 2014 at 02:57:51PM +0200, Jiri Olsa escreveu:
> > On Wed, Jul 09, 2014 at 02:28:12PM +0900, Namhyung Kim wrote:
> > > Set column width and do not change it if user gives -w/--column-widths
> > > option. It'll truncate longer symbols than the width if exists.
> >
> > SNIP
> >
> > > --- a/tools/perf/util/sort.c
> > > +++ b/tools/perf/util/sort.c
> > > @@ -70,7 +70,9 @@ static int hist_entry__thread_snprintf(struct hist_entry *he, char *bf,
> > > size_t size, unsigned int width)
> > > {
> > > const char *comm = thread__comm_str(he->thread);
> > > - return repsep_snprintf(bf, size, "%-*s:%5d", width - 6,
> > > +
> > > + width = max(7U, width) - 6;
> > > + return repsep_snprintf(bf, size, "%-*.*s:%5d", width, width,
> > > comm ?: "", he->thread->tid);
> > > }
> >
> > also we now print out all sort headers left alligned, which is wrong for
> > sort_thread header: "Command: Pid' that mirrors value strings with ':'
> > being aligned
> >
> > maybe something like in attached patch..?
> >
> > thanks,
> > jirka
> >
> >
> > ---
> > diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> > index f89714329c0f..fbbe86b7f63c 100644
> > --- a/tools/perf/util/sort.c
> > +++ b/tools/perf/util/sort.c
> > @@ -78,6 +78,7 @@ static int hist_entry__thread_snprintf(struct hist_entry *he, char *bf,
> >
> > struct sort_entry sort_thread = {
> > .se_header = "Command: Pid",
> > + .se_header_right= true,
>
> Is this just for the header? Perhaps its more clearly named .se_right_justify?
yep, it's just for header.. let's see Namhyung might have better
idea how to handle this problem
jirka
next prev parent reply other threads:[~2014-07-24 14:49 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-09 5:28 [PATCHSET 0/6] perf tools: " Namhyung Kim
2014-07-09 5:28 ` [PATCH 1/6] perf tools: Left-align output contents Namhyung Kim
2014-07-09 5:28 ` [PATCH 2/6] perf tools: Make __hpp__fmt() receive an additional len argument Namhyung Kim
2014-07-09 5:28 ` [PATCH 3/6] perf tools: Save column length in perf_hpp_fmt Namhyung Kim
2014-07-24 12:10 ` Jiri Olsa
2014-07-24 15:46 ` Namhyung Kim
2014-07-24 15:58 ` Jiri Olsa
2014-07-09 5:28 ` [PATCH 4/6] perf report: Honor column width setting Namhyung Kim
2014-07-24 12:47 ` Jiri Olsa
2014-07-24 15:51 ` Namhyung Kim
2014-07-24 12:57 ` Jiri Olsa
2014-07-24 13:57 ` Arnaldo Carvalho de Melo
2014-07-24 14:49 ` Jiri Olsa [this message]
2014-07-24 15:41 ` Namhyung Kim
2014-07-24 15:58 ` Jiri Olsa
2014-07-24 19:14 ` Arnaldo Carvalho de Melo
2014-07-09 5:28 ` [PATCH 5/6] perf top: Add -w option for setting column width Namhyung Kim
2014-07-09 5:28 ` [PATCH 6/6] perf tools: Add name field into perf_hpp_fmt Namhyung Kim
2014-07-21 9:07 ` [PATCHSET 0/6] perf tools: Honor column width setting Jiri Olsa
2014-07-23 7:40 ` Namhyung Kim
2014-07-24 13:11 ` Jiri Olsa
2014-07-24 13:59 ` Arnaldo Carvalho de Melo
2014-07-24 15:42 ` 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=20140724144906.GA25165@krava.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.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
Powered by JetHome