From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757639AbaEPRLO (ORCPT ); Fri, 16 May 2014 13:11:14 -0400 Received: from mga03.intel.com ([143.182.124.21]:23280 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755956AbaEPRLN (ORCPT ); Fri, 16 May 2014 13:11:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,1068,1389772800"; d="scan'208";a="433137576" From: Andi Kleen To: jolsa@redhat.com Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org, acme@infradead.org, Andi Kleen Subject: [PATCH 6/9] perf, tools: Fix srcline sort key output to use width Date: Fri, 16 May 2014 10:05:35 -0700 Message-Id: <1400259938-3436-7-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1400259938-3436-1-git-send-email-andi@firstfloor.org> References: <1400259938-3436-1-git-send-email-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen The srcline sort output ignored the width, which caused various problems with displaying srcline in the tui browser. Just cut it off at width. Signed-off-by: Andi Kleen --- tools/perf/util/sort.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 635cd8f..d273cf2 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -284,7 +284,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width __maybe_unused) { - return repsep_snprintf(bf, size, "%s", he->srcline); + return repsep_snprintf(bf, size, "%.*s", width, he->srcline); } struct sort_entry sort_srcline = { -- 1.9.0