Received: by 10.223.176.46 with SMTP id f43csp418650wra; Tue, 23 Jan 2018 23:49:28 -0800 (PST) X-Google-Smtp-Source: AH8x226wyu+6NAPm/pdT/8cqcwqwUaoqXrseLHM1y7A6M9V3m0IsYV3dO5oC+0Za8c5JLvCbFOSZ X-Received: by 10.101.72.11 with SMTP id h11mr10141955pgs.386.1516780167974; Tue, 23 Jan 2018 23:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516780167; cv=none; d=google.com; s=arc-20160816; b=JYw1QVqZhV3uxH16sNVTgIMIBIuY/T2QmuavcUcSVYmi4fPQRUaApfLTuEYnHWHije NffnJwq7P/Ng21TgbrV5MjMC8aM19r9VawzmeLU0ryXtUfniogygUznfwp0QS/ZJKotX qusdZUALEtnCm5MR+B99HwvErm79FcayobmDOzlZv8MK7SGjvCjbHB9ts2ohPiRwf2jG GISWE7jc2tEVSoTYn2JRkdrgC+o6qbZsP6psn8PXN1psCcMjfPZgaIWhHl6QNBZ5dHHr SI7N2XwkHzzto6d3fPepoVIAILxGlTpq7orF0K63xHQ5Pl7CN5P2phjUWPGR3n/0NWy1 6euA== 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=tnJs8bHNLm1V8BpaLSonve2DTGGzmNKSUl4NWyeZ2Ig=; b=WsBRv6ovCeLDPUnzca1Z9UHQS2jzsIA1GaWdtV7uIYW9UIMirYV/SR80m3XKvcrpd8 Qe22mTT8J337qn2wy1jRqjOk5ryUtMxFJDPzYvGo39P4Wm3Ekna9QiqV12aGTeM78BWo sxhbAgBKR7U7rAeUF9y6qqsIfTdD2pgT/2XECHwBtxLs1OjC2UQINo2TZo2Zaqkw3qxS 5dI3PcFSqubKUbEUmdGawU8YSkgbLLiBg0ctlcpTyBjYaU7i2Go8F0vBOrTZJuPd+yPr 50zWuCB3X+5ZKL7QjGFFO6OsybW5aX4FFQ0Y5I+cNX3Dq1m5adhGMMlsbo6FfMO67dN5 /CJA== 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 p1si15850452pgc.593.2018.01.23.23.49.14; Tue, 23 Jan 2018 23:49:27 -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 S932190AbeAXHsT (ORCPT + 99 others); Wed, 24 Jan 2018 02:48:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58048 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399AbeAXHsR (ORCPT ); Wed, 24 Jan 2018 02:48:17 -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 C660A87623; Wed, 24 Jan 2018 07:48:17 +0000 (UTC) Received: from krava (unknown [10.43.17.249]) by smtp.corp.redhat.com (Postfix) with SMTP id 2B9E25D6A3; Wed, 24 Jan 2018 07:48:14 +0000 (UTC) Date: Wed, 24 Jan 2018 08:48:13 +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, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com Subject: Re: perf stat: Add support to print counts for fixed times Message-ID: <20180124074813.GC8473@krava> References: <1516761799-25350-1-git-send-email-ufo19890607@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1516761799-25350-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.26]); Wed, 24 Jan 2018 07:48:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 24, 2018 at 03:43:19AM +0100, ufo19890607 wrote: > From: yuzhoujian > > Hi Jirka > And how can you control the output for perf stat, if I don't want to use the > "sleep" workload, like some user programs. I want to check the "cycles" > for this program when it just begin to run. > > root@node10:/home$ gcc -g -o malloc malloc.c > root@node10:/home$ ./perf stat -e cycles -I 1000 --times-print 3 ./malloc & > [1] 32586 > # time counts unit events > 1.000094153 2,914,162,979 cycles > 2.000323667 3,062,832,799 cycles > 3.000443807 3,063,146,609 cycles yea, we can't do that now.. we have the exat oposit option in record, because sometimes you want to skip the initialization phase of the workload.. any special reason why you want to see just the begining? we can add this, but maybe change the option name a bit your code now allows this even if it's not in interval mode [jolsa@krava perf]$ sudo ./perf stat -e cycles -a --times-print 3 Performance counter stats for 'system wide': 1,469,288,467 cycles 3.000502814 seconds time elapsed I think we should either keep it interval specific: perf stat -e cycles -I 1000 --interval-count=3 or make the option general and time based: perf stat -e cycles --time=3000 or maybe both ;-) thanks, jirka