Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1272441ybl; Fri, 23 Aug 2019 16:39:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2z2cX6eA/KQz+l03fVzXtaQ9LJwuEAxfXY4MsJAoeIggwY8LdXHyxUogEAc+/EsoN9G9J X-Received: by 2002:a17:902:33a5:: with SMTP id b34mr7448656plc.286.1566603582899; Fri, 23 Aug 2019 16:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566603582; cv=none; d=google.com; s=arc-20160816; b=0UiJk/Mec2H1xx2B+ftobJvlOyrlY0fOXAey5aX0pIkTK3B496dKTw+dfGnGvPystw vWeKVTdvD1kr6V7cm9ACnCmWM1uS0eJSj35bxpm69OFOk0oSEo4UaaRQct+kIjws/xva /MNExefxt/bDR91wjBKYWtKNT7bEkilBQqIFEYZhmDYzkhjhw+Co4O46IFu7le00duBK c3RLCOEaiT1n9rIpNcaJ2crCbNQX+Tr4iMgesP0RGPrYmo5z2Y0BjgoClDsgnKh5sIHG Z6QPWm7p8vzRcVGykJsYmGI6QCxjY+6L8Qcb4BOCQDgAO5PHwNJvAEPH5ygs8eaSi1A2 S5Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=RtfMgBnQibJ2QGGril22Lih4Nibzexaw2SBvEhbvJqA=; b=jBp4Eu3ZGiVF4ej1r3oCRpywUTy5R18l/chH/6v0Qd5tsr3RwM5aojyJSvWeqOWRnS 7SNorhdaSNTpICiHRBxRQCZlni2XPzrJUXFD6v8e34U4Rybx2lsXFahwd9XB9KtGPwOE PjNW0H68UbuyKhe0BckuRwIj7jPKwm1JHT39YOFskSoZ6IUfppN+jbXTDydEq6JRxZO2 oNWKBN4o4HKm+7MCab4PSeJRRdcI/xPKnoG9C7VQh77nbkBdeZOHWOHa6UCUp2F07UZR DVHb0f3PBpjclr7UAZLPnXXct1EW76ugChCYUocLZ2VHgR/f/8eKjg/IrwQS7CFv2I7z /r7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b22si3000951pgw.298.2019.08.23.16.39.27; Fri, 23 Aug 2019 16:39:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406175AbfHWVDo (ORCPT + 99 others); Fri, 23 Aug 2019 17:03:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:18378 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731003AbfHWVDo (ORCPT ); Fri, 23 Aug 2019 17:03:44 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2019 14:03:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,422,1559545200"; d="scan'208";a="208661163" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by fmsmga002.fm.intel.com with ESMTP; 23 Aug 2019 14:03:43 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 79354301C11; Fri, 23 Aug 2019 14:03:43 -0700 (PDT) From: Andi Kleen To: acme@kernel.org Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 2/2] perf report: Fix --ns time sort key output Date: Fri, 23 Aug 2019 14:03:38 -0700 Message-Id: <20190823210338.12360-2-andi@firstfloor.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190823210338.12360-1-andi@firstfloor.org> References: <20190823210338.12360-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen If the user specified --ns, the column to print the sort time stamp wasn't wide enough to actually print the full nanoseconds. Widen the time key column width when --ns is specified. Before: % perf record -a sleep 1 % perf report --sort time,overhead,symbol --stdio --ns ... 2.39% 187851.10000 [k] smp_call_function_single - - 1.53% 187851.10000 [k] intel_idle - - 0.59% 187851.10000 [.] __wcscmp_ifunc - - 0.33% 187851.10000 [.] 0000000000000000 - - 0.28% 187851.10000 [k] cpuidle_enter_state - - After: % perf report --sort time,overhead,symbol --stdio --ns ... 2.39% 187851.100000000 [k] smp_call_function_single - - 1.53% 187851.100000000 [k] intel_idle - - 0.59% 187851.100000000 [.] __wcscmp_ifunc - - 0.33% 187851.100000000 [.] 0000000000000000 - - 0.28% 187851.100000000 [k] cpuidle_enter_state - - Signed-off-by: Andi Kleen --- tools/perf/util/hist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 8efbf58dc3d0..33702675073c 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -193,7 +193,10 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h) hists__new_col_len(hists, HISTC_MEM_LVL, 21 + 3); hists__new_col_len(hists, HISTC_LOCAL_WEIGHT, 12); hists__new_col_len(hists, HISTC_GLOBAL_WEIGHT, 12); - hists__new_col_len(hists, HISTC_TIME, 12); + if (symbol_conf.nanosecs) + hists__new_col_len(hists, HISTC_TIME, 16); + else + hists__new_col_len(hists, HISTC_TIME, 12); if (h->srcline) { len = MAX(strlen(h->srcline), strlen(sort_srcline.se_header)); -- 2.20.1