From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752965Ab3LBSvb (ORCPT ); Mon, 2 Dec 2013 13:51:31 -0500 Received: from mail-qe0-f53.google.com ([209.85.128.53]:34529 "EHLO mail-qe0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028Ab3LBSv0 (ORCPT ); Mon, 2 Dec 2013 13:51:26 -0500 Date: Mon, 2 Dec 2013 15:51:16 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Stephane Eranian , Peter Zijlstra , Paul Mackerras , Namhyung Kim , LKML , Jiri Olsa , David Ahern , Andi Kleen , Pekka Enberg , Frederic Weisbecker Subject: Re: [PATCH 1/3] perf tools: Record total sampling time Message-ID: <20131202185116.GB14254@ghostprotocols.net> References: <1385967199-3759-1-git-send-email-namhyung@kernel.org> <1385967199-3759-2-git-send-email-namhyung@kernel.org> <20131202124527.GB22212@gmail.com> <1385996749.1710.34.camel@leonhard> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1385996749.1710.34.camel@leonhard> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Dec 03, 2013 at 12:05:49AM +0900, Namhyung Kim escreveu: > Hi Ingo, > > 2013-12-02 (월), 13:45 +0100, Ingo Molnar: > > * Namhyung Kim wrote: > > > > > From: Namhyung Kim > > > > > > It's sometimes useful to see total sampling or elapsed time with > > > normal performance result. To do that, record first and last sample > > > time for each evsel and to display it in the header (--stdio only for > > > now). > > > > > > $ perf record -a sleep 1 > > > $ perf report --stdio > > > ... > > > # Samples: 4K of event 'cycles' > > > # Event count (approx.): 4087481688 > > > # Total sampling time : 1.001260 (sec) > > > > Btw., would it make sense to output it using the 'perf stat' print-out > > machinery? > > > > If the 'count' of every event sampled is saved in the perf.data, > > including elapsed time, at the beginning and at the end, then all > > information is there to output things in perf stat style. > > Yeah, it'd be great if we can share same code in the end. I guess we'll basically just process all samples, accumulating stuff where the builtin-stat code finds them, in struct perf_evsel, then just hand it to that code. - Arnaldo