From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752636AbbJFHPd (ORCPT ); Tue, 6 Oct 2015 03:15:33 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55870 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750986AbbJFHP3 (ORCPT ); Tue, 6 Oct 2015 03:15:29 -0400 Date: Tue, 6 Oct 2015 00:15:13 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: hpa@zytor.com, dzickus@redhat.com, dsahern@gmail.com, kan.liang@intel.com, namhyung@kernel.org, mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, dsahern@gmail.com, dzickus@redhat.com, kan.liang@intel.com, namhyung@kernel.org, mingo@kernel.org, a.p.zijlstra@chello.nl, jolsa@kernel.org, acme@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de In-Reply-To: <1444068369-20978-9-git-send-email-jolsa@kernel.org> References: <1444068369-20978-9-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf tools: Setup proper width for symbol_iaddr field Git-Commit-ID: b34b3bf0798633cc248b682f5b4f6509739ce234 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b34b3bf0798633cc248b682f5b4f6509739ce234 Gitweb: http://git.kernel.org/tip/b34b3bf0798633cc248b682f5b4f6509739ce234 Author: Jiri Olsa AuthorDate: Mon, 5 Oct 2015 20:06:08 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 5 Oct 2015 16:33:41 -0300 perf tools: Setup proper width for symbol_iaddr field We need to properly initialize column width for symbol_iaddr field, so all symbols could fit in the column. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Don Zickus Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1444068369-20978-9-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/hist.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index c346b33..4fd37d6 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -132,6 +132,18 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, symlen); } + + if (h->mem_info->iaddr.sym) { + symlen = (int)h->mem_info->iaddr.sym->namelen + 4 + + unresolved_col_width + 2; + hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, + symlen); + } else { + symlen = unresolved_col_width + 4 + 2; + hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, + symlen); + } + if (h->mem_info->daddr.map) { symlen = dso__name_len(h->mem_info->daddr.map->dso); hists__new_col_len(hists, HISTC_MEM_DADDR_DSO, @@ -143,6 +155,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) } else { symlen = unresolved_col_width + 4 + 2; hists__new_col_len(hists, HISTC_MEM_DADDR_SYMBOL, symlen); + hists__new_col_len(hists, HISTC_MEM_IADDR_SYMBOL, symlen); hists__set_unres_dso_col_len(hists, HISTC_MEM_DADDR_DSO); }