mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@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/7] perf report: Honor column width setting
Date: Mon, 28 Jul 2014 09:43:37 +0900	[thread overview]
Message-ID: <87k36yia86.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <20140725111302.GB1214@krava.brq.redhat.com> (Jiri Olsa's message of "Fri, 25 Jul 2014 13:13:02 +0200")

On Fri, 25 Jul 2014 13:13:02 +0200, Jiri Olsa wrote:
> On Fri, Jul 25, 2014 at 10:18:55AM +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.
>> 
>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>> ---
>
> SNIP
>
>>  
>>  __HPP_COLOR_PERCENT_FN(overhead, period)
>> @@ -797,8 +798,11 @@ static int hist_browser__show_entry(struct hist_browser *browser,
>>  			if (fmt->color) {
>>  				width -= fmt->color(fmt, &hpp, entry);
>>  			} else {
>> -				width -= fmt->entry(fmt, &hpp, entry);
>> +				int ret = fmt->entry(fmt, &hpp, entry);
>> +				s[ret] = '\0';
>>  				slsmg_printf("%s", s);
>
> from quick check it seems like all entry callback functions
> use some sort of snprint which should already handle the string
> length properly.. if not, we should fix that instead, no?

It was 'symbol' sort entry (_hist_entry__sym_snprintf) which has several
snprint calls in it.  So I changed here rather than adding complexity
the print function.  I can change it if you want. ;)

Thanks,
Namhyung

  reply	other threads:[~2014-07-28  0:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  1:18 [PATCHSET 0/7] perf tools: Honor column width setting (v2) Namhyung Kim
2014-07-25  1:18 ` [PATCH 1/7] perf tools: Left-align output contents Namhyung Kim
2014-07-25  1:18 ` [PATCH 2/7] perf tools: Make __hpp__fmt() receive an additional len argument Namhyung Kim
2014-07-25  1:18 ` [PATCH 3/7] perf tools: Save column length in perf_hpp_fmt Namhyung Kim
2014-07-25  1:18 ` [PATCH 4/7] perf report: Honor column width setting Namhyung Kim
2014-07-25 11:13   ` Jiri Olsa
2014-07-28  0:43     ` Namhyung Kim [this message]
2014-07-28 11:17       ` Jiri Olsa
2014-07-25  1:18 ` [PATCH 5/7] perf top: Add -w option for setting column width Namhyung Kim
2014-07-25  1:18 ` [PATCH 6/7] perf tools: Add name field into perf_hpp_fmt Namhyung Kim
2014-07-25 11:12   ` Jiri Olsa
2014-07-28  0:35     ` Namhyung Kim
2014-07-25  1:18 ` [PATCH 7/7] perf tools: Fix column alignment when headers aren't shown on TUI 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=87k36yia86.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --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