Received: by 10.223.176.5 with SMTP id f5csp2696821wra; Mon, 29 Jan 2018 02:28:10 -0800 (PST) X-Google-Smtp-Source: AH8x226xGTjTQm1beXme/ni1e5Vmm9ksUJXjN/bLzDHFjArKRsXeAQ0N8qMZJ67N3t6RQPVgPIKB X-Received: by 2002:a17:902:9a8b:: with SMTP id w11-v6mr15757673plp.118.1517221690776; Mon, 29 Jan 2018 02:28:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517221690; cv=none; d=google.com; s=arc-20160816; b=ttR5qDg9TcElvna0svWcTG8/7dXWixE6q7u0f9VjTtKPgc3kJi/mv2bhnETIfjMOyc OTvXgIRRkx0SIl+650LZ+czJBFJf0uhZIARDttIo2DVOIaoIR6HJrkAnjfNmyKofxThV PLB1Q6eMBBf0VOVv5Ct+VqtlNeUpvn4yzKdjCvAR++Hp6xAfT3URFlBSXK8zz2FBNTHG JVbwBTzIE66BZu9XbNcp2a0oO4JEhd58jo4sJ6psRUpS4Q/pnaksEDl+lumS7neBN5kp TzMd80YEL0fDwcXvq/QIutWyHVnWItyO/rJhDkky3dPLPUVKa9qYnoiV5R8gPi3mJIiU kwGQ== 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:from:date:arc-authentication-results; bh=XIRrb6ZiFUKpFJHZYU3p0qqVUSzjwmT+KIU0cksJjrY=; b=HshntyJrAg00ak6ifwKGLUTVq717+3e+ACtaz2CCUyOvoKAx1vzbQhMdMTR7E/5yhp oi15nzSij1r3iCLct9O9GoUEJUK4viKmIh18k20gMlp9CZrQ6GJSfwzs1NKevTlNfahn CK3REDdGx91lu0XlcTv0cNYCxFW05iESJ3DxKM79zsQIcxTXh+nfD60dGqKgKPeRqDWg WEzAP61P/BlcaC3AzFC2MCOEa9w2jijNSpsR21BndEmgQZoa4GcdAtL0DWOgyEOrY2un 74jpgqVh+64V/dzCkohCEoX2SW+TgREewRyINXctKjbYM5M30rJz34t2bL+l+8wPQkvT VYJQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33-v6si9047265plb.786.2018.01.29.02.27.56; Mon, 29 Jan 2018 02:28:10 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751759AbeA2K0F (ORCPT + 99 others); Mon, 29 Jan 2018 05:26:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57502 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751679AbeA2K0D (ORCPT ); Mon, 29 Jan 2018 05:26:03 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 206BE28203; Mon, 29 Jan 2018 10:26:03 +0000 (UTC) Received: from krava (unknown [10.43.17.162]) by smtp.corp.redhat.com (Postfix) with SMTP id EA00362675; Mon, 29 Jan 2018 10:25:58 +0000 (UTC) Date: Mon, 29 Jan 2018 11:25:58 +0100 From: Jiri Olsa To: ufo19890607 Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, dsahern@gmail.com, namhyung@kernel.org, milian.wolff@kdab.com, arnaldo.melo@gmail.com, yuzhoujian@didichuxing.com, adrian.hunter@intel.com, wangnan0@huawei.com, Kan.liang@intel.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com Subject: Re: [PATCH v4 0/2] perf stat: Add interval-count and time support Message-ID: <20180129102558.GA14925@krava> References: <1517217923-8302-1-git-send-email-ufo19890607@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517217923-8302-1-git-send-email-ufo19890607@gmail.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 29 Jan 2018 10:26:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 29, 2018 at 10:25:21AM +0100, ufo19890607 wrote: > From: yuzhoujian > > Introduce two new options for perf stat and update perf-stat documentation > accordingly. > > The interval-count option can be used to print counts for fixed number of > times, and it should be used specifically with "-I" option. > > Show below is the output of the interval-count option for perf stat. > > $ perf stat -I 1000 --interval-count 2 -e cycles -a > # time counts unit events > 1.002827089 93,884,870 cycles > 2.004231506 56,573,446 cycles > > The time option can be used to print counts after a period of time, and it > should not be used with "-I" option. > > Show below is the output of the time option for perf stat. > > $ perf stat --time 2000 -e cycles -a > Performance counter stats for 'system wide': > > 157,260,423 cycles > > 2.003060766 seconds time elapsed > > yuzhoujian (2): > perf stat: Add support to print counts for fixed times > perf stat: Add support to print counts after a period of time > > Changes since v3: > - merge interval_count check and times check to one line. > - fix the wrong indent in stat.h > - use stat_config.times instead of 'times' in cmd_stat function. Acked-by: Jiri Olsa thanks, jirka > > Changes since v2: > - modify the time check in __run_perf_stat func to keep some consistency > with the workload case. > - add the warning when the time is set between 10ms to 100ms. > - add the pr_err when the time is set below 10ms. > > Changes since v1: > - change the name of the new option "times-print" to "interval-count". > - keep the interval-count option interval specifically. > > > tools/perf/Documentation/perf-stat.txt | 10 +++++++ > tools/perf/builtin-stat.c | 53 ++++++++++++++++++++++++++++++++-- > tools/perf/util/stat.h | 2 ++ > 3 files changed, 62 insertions(+), 3 deletions(-) > > -- > 2.14.1 >