lkml.org 
[lkml]   [2014]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/7] perf report: Honor column width setting
Date
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


\
 
 \ /
  Last update: 2014-07-28 03:21    [W:0.091 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site