From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422722AbbD2J2J (ORCPT ); Wed, 29 Apr 2015 05:28:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:56123 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031679AbbD2J2G (ORCPT ); Wed, 29 Apr 2015 05:28:06 -0400 Date: Wed, 29 Apr 2015 11:27:51 +0200 From: Peter Zijlstra To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Jiri Olsa , LKML , David Ahern , Stephane Eranian , Andi Kleen , Minchan Kim Subject: Re: [RFC/PATCH] perf stat: Show sample events stat for a data file Message-ID: <20150429092751.GR5029@twins.programming.kicks-ass.net> References: <1430292465-8863-1-git-send-email-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1430292465-8863-1-git-send-email-namhyung@kernel.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 29, 2015 at 04:27:45PM +0900, Namhyung Kim wrote: > Add --input option to 'perf stat' so that it can show event stats of the > file. I would like to use a short '-i' option to be compatible with > other commands but it was already taken by '--no-inherit' option, so it > only supports the long option. > > The example output looks like below: > > $ perf record -a sleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.635 MB perf.data (1946 samples) ] > > $ perf stat --input perf.data > > Total event stats for 'perf.data' file: > > TOTAL events: 6837 > MMAP events: 116 > COMM events: 375 > EXIT events: 2 > THROTTLE events: 12 > UNTHROTTLE events: 11 > FORK events: 374 > SAMPLE events: 1946 > MMAP2 events: 3999 > FINISHED_ROUND events: 2 > > Sample event stats: > > 361,255,234 cycles > 1,946 samples # sampling ratio 12.162% (486/4000) > > 0.998581085 second time sampled It would be nice if this thing could support 'perf record -s' which enables perf_event_attr::inherit_stat, which in turn results in PERF_RECORD_READ entries after every PERF_RECORD_EXIT which give the total number of events for each recorded task.