From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992878AbbHIDdb (ORCPT ); Sat, 8 Aug 2015 23:33:31 -0400 Received: from mail-pd0-f180.google.com ([209.85.192.180]:35159 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbbHIDda (ORCPT ); Sat, 8 Aug 2015 23:33:30 -0400 Date: Sun, 9 Aug 2015 12:30:49 +0900 From: Namhyung Kim To: Andi Kleen Cc: Arnaldo Carvalho de Melo , jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH] perf, tools, report: Add support for srcfile sort key Message-ID: <20150809033049.GE29295@danjae.kornet> References: <1438988064-21834-1-git-send-email-andi@firstfloor.org> <20150807235145.GD3583@kernel.org> <20150808000215.GE3583@kernel.org> <20150808022735.GC1747@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150808022735.GC1747@two.firstfloor.org> User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andi, On Sat, Aug 08, 2015 at 04:27:35AM +0200, Andi Kleen wrote: > On Fri, Aug 07, 2015 at 09:02:15PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Fri, Aug 07, 2015 at 08:51:45PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Fri, Aug 07, 2015 at 03:54:24PM -0700, Andi Kleen escreveu: > > > > From: Andi Kleen > > > > > > > > In some cases it's useful to characterize samples by file. This is useful > > > > to get a higher level categorization, for example to map cost to > > > > subsystems. > > > > > > > > Add a srcfile sort key to perf report. It builds on top of the existing > > > > srcline support. > > > > > > Applied > > > > Humm, holding this up a bit, further testing showed some oddities, > > fedora21, the width of the column is being limited to the lenght of the > > header > > Yes I've seen that, I just use -w normally. It also happens with --sort > srcline. The column sizing code could probably be somewhat smarter and > always allow the last column to become as wide as needed. But that's > something that should be done separately; I don't think it belongs > into this patch. Maybe something like this? >>From c052d17ae45ac08a381192191473ed3c4308c0c5 Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Sun, 9 Aug 2015 12:28:01 +0900 Subject: [PATCH] perf tools: Update srcline column length It didn't calculate the column length so the default of header length used only. Update the length when we get the srcline actually. Cc: Andi Kleen Signed-off-by: Namhyung Kim --- tools/perf/util/sort.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 5177088a71d3..85e7e3e75d39 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -291,6 +291,8 @@ sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right) left->srcline = get_srcline(map->dso, map__rip_2objdump(map, left->ip), left->ms.sym, true); + hists__new_col_len(left->hists, HISTC_SRCLINE, + strlen(left->srcline)); } } if (!right->srcline) { @@ -301,6 +303,8 @@ sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right) right->srcline = get_srcline(map->dso, map__rip_2objdump(map, right->ip), right->ms.sym, true); + hists__new_col_len(right->hists, HISTC_SRCLINE, + strlen(right->srcline)); } } return strcmp(right->srcline, left->srcline); -- 2.5.0