Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5247300ybl; Tue, 27 Aug 2019 01:31:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBpAVlQPU4gEjeDCnSBa7LP2/gRj1o8uuL1dERAAN9nlukcwRrjJpPuZlresCtOCsA5Vqd X-Received: by 2002:a63:5648:: with SMTP id g8mr19807131pgm.81.1566894677033; Tue, 27 Aug 2019 01:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566894677; cv=none; d=google.com; s=arc-20160816; b=K5MKiiGev4k4XsYXZpTGRk5tMaCiMFD0rurb++mMs94l67BBQk/6mYxWFq+z+M9NRu lIxWseITCiuOzAunjL9jgNBoKJOrON8YG5OV1iVafK/zZn1k5/3muA42Fq0eFg2WQPyv iRXFWl/m4zbGyFFvgfAUC5d/VfRUIE/i/Lpzg0V/S8xluF7x+mtSB2aj7nAghSQ5bnQS sbvpanY9//Zb3BXnNDdAX/9VokfID7xWGyBdvuNFXj/rXJ83DIiFBIxsGu18N3HWqYxX 8q63cbgHvYMMK8mCJ+Bk14Erx0CesmHWvlexupvzewbQQV/fVsgEJzLiEL8rNYGYZLRv eRjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:robot-unsubscribe:robot-id:message-id :mime-version:references:in-reply-to:cc:subject:to:reply-to:from :date; bh=mnJbyi+an0OcWpMg/C1rUmQvI+cIzRpbH8OOs78wzTs=; b=zAW8LrZm51YaNja/lur6TiKTw6gg11neOurOkMtvS9akDY90BI3DniHizDL0OKXTdi 5ViULRhEC84MuFSB5f9YcB4uVkWl2CP+dwa8aIv9xRbV/xUFk+LnSHQDIWcD0K+rmRKF fADROXQAZbqdYBnSNQYwx1kyHDxrjqjJtG4NZyfgNWDKh5aS8vxCgE3faSJKNb07ck84 Hooe10oXGvnNCD3vFJApG7wTNBvUkbsEGuTwCTjAku1pzpyad7Bt1rgT+8PM9UEkUAVB 7YXDq49aTRQo7qjItZdQEwNOixFYosfwUjry4gxPxM2m5n3p/SNsGJ7d7+yDTVTgysxx q8sA== 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 o3si1932100pjt.107.2019.08.27.01.31.01; Tue, 27 Aug 2019 01:31:17 -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 S1730232AbfH0I2R (ORCPT + 99 others); Tue, 27 Aug 2019 04:28:17 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42732 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729461AbfH0I0W (ORCPT ); Tue, 27 Aug 2019 04:26:22 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1i2Wnx-0007q2-Fe; Tue, 27 Aug 2019 10:26:17 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 15B3C1C0DDF; Tue, 27 Aug 2019 10:26:17 +0200 (CEST) Date: Tue, 27 Aug 2019 08:26:17 -0000 From: tip-bot2 for Andi Kleen Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf report: Use timestamp__scnprintf_nsec() for time sort key Cc: Andi Kleen , Jiri Olsa , Arnaldo Carvalho de Melo , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20190823210338.12360-1-andi@firstfloor.org> References: <20190823210338.12360-1-andi@firstfloor.org> MIME-Version: 1.0 Message-ID: <156689437701.24511.15888574333072459132.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 092804ae092fc6097348f5c09b62cde040717aa1 Gitweb: https://git.kernel.org/tip/092804ae092fc6097348f5c09b62cde040717aa1 Author: Andi Kleen AuthorDate: Fri, 23 Aug 2019 14:03:37 -07:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Mon, 26 Aug 2019 11:58:29 -03:00 perf report: Use timestamp__scnprintf_nsec() for time sort key Use timestamp__scnprintf_nsec() to print nanoseconds for the time sort key, instead of open coding. Signed-off-by: Andi Kleen Cc: Jiri Olsa Link: http://lkml.kernel.org/r/20190823210338.12360-1-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/sort.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index c522bdd..83eb3fa 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -670,17 +670,11 @@ sort__time_cmp(struct hist_entry *left, struct hist_entry *right) static int hist_entry__time_snprintf(struct hist_entry *he, char *bf, size_t size, unsigned int width) { - unsigned long secs; - unsigned long long nsecs; char he_time[32]; - nsecs = he->time; - secs = nsecs / NSEC_PER_SEC; - nsecs -= secs * NSEC_PER_SEC; - if (symbol_conf.nanosecs) - snprintf(he_time, sizeof he_time, "%5lu.%09llu: ", - secs, nsecs); + timestamp__scnprintf_nsec(he->time, he_time, + sizeof(he_time)); else timestamp__scnprintf_usec(he->time, he_time, sizeof(he_time));