From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755401AbcETJ76 (ORCPT ); Fri, 20 May 2016 05:59:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51686 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753604AbcETJ75 (ORCPT ); Fri, 20 May 2016 05:59:57 -0400 Date: Fri, 20 May 2016 11:59:54 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, peterz@infradead.org, jolsa@kernel.org, mingo@kernel.org, linux-kernel@vger.kernel.org Subject: Re: Add top down metrics to perf stat Message-ID: <20160520095954.GA28818@krava> References: <1463190297-17408-1-git-send-email-andi@firstfloor.org> <20160516125838.GD10877@krava> <20160519235130.GO13997@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160519235130.GO13997@two.firstfloor.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 20 May 2016 09:59:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 19, 2016 at 04:51:30PM -0700, Andi Kleen wrote: > On Mon, May 16, 2016 at 02:58:38PM +0200, Jiri Olsa wrote: > > On Fri, May 13, 2016 at 06:44:49PM -0700, Andi Kleen wrote: > > > > SNIP > > > > > > > > The formulas to compute the metrics are generic, they > > > only change based on the availability on the abstracted > > > input values. > > > > > > The kernel declares the events supported by the current > > > CPU and perf stat then computes the formulas based on the > > > available metrics. > > > > > > > > > Example output: > > > > > > $ perf stat --topdown -I 1000 cmd > > > 1.000735655 frontend bound retiring bad speculation backend bound > > > 1.000735655 S0-C0 2 47.84% 11.69% 8.37% 32.10% > > > 1.000735655 S0-C1 2 45.53% 11.39% 8.52% 34.56% > > Hi Jiri, > > > > you've lost first 3 header lines (time/core/cpus): > > > > [jolsa@ibm-x3650m4-01 perf]$ sudo ./perf stat --per-core -e cycles -I 1000 -a > > # time core cpus counts unit events > > 1.000310344 S0-C0 2 3,764,470,414 cycles > > 1.000310344 S0-C1 2 3,764,445,293 cycles > > 1.000310344 S0-C2 2 3,764,428,422 cycles > > I can't reproduce that. > I can.. your latest code does not display headers: 'time' 'core' 'cpus' also the initial '#' [jolsa@ibm-x3650m4-01 perf]$ sudo ./perf stat --topdown -I 1000 -a nmi_watchdog enabled with topdown. May give wrong results. Disable with echo 0 > /proc/sys/kernel/nmi_watchdog 1.002097350 retiring bad speculation frontend bound backend bound 1.002097350 S0-C0 2 38.1% 0.0% 59.2% 2.7% 1.002097350 S0-C1 2 38.1% 0.1% 59.7% 2.1% thanks, jirka