Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3048526ybl; Sun, 25 Aug 2019 07:32:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwi0Z23XO2DLkTu7GgNj2mFNscX6YG9pvgk6+Y0CHK+GS89Ng4ZVJ9Iq/3nQ1mjrHOA4ZVm X-Received: by 2002:a17:90a:3847:: with SMTP id l7mr14483096pjf.99.1566743545747; Sun, 25 Aug 2019 07:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566743545; cv=none; d=google.com; s=arc-20160816; b=aT1RyXDsjcEezEVYigrg9gWzOgBGG4CUzv490AQ92+dzVlC+sPvL7g655CWjkmb9sw X2Obp8xh7kAEN0YO00iQZCltS0KsG2QpOtI8d9np6UGHowGfp+GZW4zzsNW4n1Ob/9+5 oRj/7fXr70Cdg2o+SBsiNmCnsGrJHaO+9q9ZPOeQKe4c+ZmtovjhiPC4auLoMSg1Ln6W xM0RX44Zg8wVdkMj/nbuHMUP4L12ihPN5X2ZlfRA9i3TInyW2QnHdB6mHnfOpZqhRzzY M/yRqpC9kyqaWj6ElP8BUqaZ+vC25rZeZ5oAXU9sdBEFg4G1XEhBTgbB8GeSmOxYwcTh UbVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=+fgqAm1h08BgghmcydOpUO4IRP3gRWmzjl2DDbpqLCU=; b=kB15EvnN5px52mlPNyMOOI9nx/54fdkTZtq1R8d+h3/0LwmjEfSXsQiQeYNnU+EiIC CJtW1apUcHHPKCK50hOob3U1Bn9o/d4IT+Aze+tkopOam3TnK7Qj1kzgqnz8bFBcolsc ENGda+DSb0vNOoFHd+pTSVs3c884yBCSHN1jyP+kEHfKZvPJPD/kEfJUZZrmG2WGfNIp zQcz0pMRcIEWFXYEfjnDBLynXBdVFKpyUGD8tRDvoVmLsR0cikbrUVckoA8Ub+mOVfWQ l+8Y7b6/QbqsWb/LaFfrunycUrO2RABr6kzyr7Dp+zlHX9+NdT6nql83haa8kEiUK1z3 v9mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XvQW9+kE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k142si7708001pfd.217.2019.08.25.07.32.09; Sun, 25 Aug 2019 07:32:25 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XvQW9+kE; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728510AbfHYObS (ORCPT + 99 others); Sun, 25 Aug 2019 10:31:18 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:34844 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbfHYObS (ORCPT ); Sun, 25 Aug 2019 10:31:18 -0400 Received: by mail-qk1-f195.google.com with SMTP id r21so12183773qke.2 for ; Sun, 25 Aug 2019 07:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+fgqAm1h08BgghmcydOpUO4IRP3gRWmzjl2DDbpqLCU=; b=XvQW9+kEdUJQ18ninWksU3hZp8i/tzTErdBPgjlEWFZ6ol/pRCTaEp3H5GLH+ogj0Z /L1zup08wjx5m3GjGpgVan7V3EfOCLMcGu/VAGHbmgw0gRcWLER3Z8mL5r5s0hlV0ijh Bichz78Of3hil8toaXQeDUfCarngMCJaiETMEl7vtRqHgzhpzx+Qsy36Dzu3gyCM+G7P EElXqH1buirsBLbamULJRQUN02BagMXFC0Ckt9/3MwEI1c5wPK9cDc+g2f+QWNtQQHdK 9s/nucrMnyOY/D+s8BBRoWKQ0hlP/2GSVSKN1QDanlbLNdixm3V0aADa2jYjStrjD777 LHsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+fgqAm1h08BgghmcydOpUO4IRP3gRWmzjl2DDbpqLCU=; b=pcOC5lpc8MhSgCwV/ARfgSbBofWCLewOPeOYca+wSecXF70RN+MqWIuJ/uBwQR98Ey 1pECCrdpASJccZwomBFhkLdghB7D/zI5dLC6JJxn9MkRp+uVl+0wsbNnX6+sBFLL8a23 4JSRxFUmi05FFGdje5oMjN7MPVgfkd/qelrl9yT7yBizRzFtZzUH2JXWmxgSyO23hFL1 EkSdhs+CdL75amOwllVAZgQ9tLyWAAsci/QcMWQySWztpCDIHQq8jJ+JADMjN9WywlcY BpzbFQOkTGvuIHqNxtHx/WjqhPadfVgMhkB832ngKJltjyq4NSpiHhi/1crwaEjhFey1 LfxQ== X-Gm-Message-State: APjAAAWHS/ilvTFoqwAGrM1mntGKQHDZyFXgUFbwV89tZSU0OskHUTtl SzqvHidtAzXesgfYDFoP+Ihduayn X-Received: by 2002:a05:620a:4:: with SMTP id j4mr11574756qki.181.1566743476919; Sun, 25 Aug 2019 07:31:16 -0700 (PDT) Received: from quaco.ghostprotocols.net (user.186-235-140-211.acesso10.net.br. [186.235.140.211]) by smtp.gmail.com with ESMTPSA id s58sm5753805qth.59.2019.08.25.07.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2019 07:31:16 -0700 (PDT) From: Arnaldo Carvalho de Melo X-Google-Original-From: Arnaldo Carvalho de Melo Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id F3D9D40340; Sun, 25 Aug 2019 11:31:13 -0300 (-03) Date: Sun, 25 Aug 2019 11:31:13 -0300 To: Andi Kleen Cc: jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 1/2] perf report: Use timestamp__scnprintf_nsec for time sort key Message-ID: <20190825143113.GD26569@kernel.org> References: <20190823210338.12360-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190823210338.12360-1-andi@firstfloor.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Aug 23, 2019 at 02:03:37PM -0700, Andi Kleen escreveu: > From: Andi Kleen > > Use timestamp__scnprintf_nsec to print nanoseconds for the time > sort key, instead of open coding. Thanks, tested and applied. - Arnaldo > Signed-off-by: Andi Kleen > --- > 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 f9a38a1dd4d1..0985e9072db0 100644 > --- a/tools/perf/util/sort.c > +++ b/tools/perf/util/sort.c > @@ -668,17 +668,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)); > -- > 2.20.1 -- - Arnaldo