Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965213AbbLRBzm (ORCPT ); Thu, 17 Dec 2015 20:55:42 -0500 Received: from one.firstfloor.org ([193.170.194.197]:51937 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964888AbbLRBzl (ORCPT ); Thu, 17 Dec 2015 20:55:41 -0500 Date: Fri, 18 Dec 2015 02:55:38 +0100 From: Andi Kleen To: Stephane Eranian Cc: Andi Kleen , Arnaldo Carvalho de Melo , Peter Zijlstra , Jiri Olsa , Ingo Molnar , LKML , Namhyung Kim Subject: Re: Add top down metrics to perf stat v2 Message-ID: <20151218015538.GC15533@two.firstfloor.org> References: <1450227266-2501-1-git-send-email-andi@firstfloor.org> <20151217140123.GA15533@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Content-Length: 2751 Lines: 76 Thanks for testing. On Thu, Dec 17, 2015 at 03:31:30PM -0800, Stephane Eranian wrote: > I would not add a --topdown option but instead a --metric option with arguments > such that other metrics could be added later: > > $ perf stat --metrics topdown -I 1000 -a sleep 100 > > If you do this, you do not need the --metric-only option The --metric-only option is useful with other metrics too. For example to get concise (and plottable) IPC or TSX abort statistics. See the examples in the original commit. However could make --topdown default to --metric-only and add an option to turn it off. Yes that's probably a better default for more people, although some people could be annoyed by the wide output. > The double --topdown is confusing. Ok. I was thinking of changing it and adding an extra argument for the "ignore threshold" behavior. That would also make it more extensible if we ever add Level 2. > > Why force --per-core when HT is on. I know you you need to aggregate > per core, but > you could still display globally. And then if user requests > --per-core, then display per core. Global TopDown doesn't make much sense. Suppose you have two programs running on different cores, one frontend bound and one backend bound. What would the union of the two mean? And you may well end up with sums of ratios which are >100%. The only exception where it's useful is for the single threaded case (like the toplev --single-thread) option. However it is something ugly and difficult because the user would need to ensure that there is nothing active on the sibling thread. So I left it out. > Same if user specifies --per-socket. I know this requires some more > plumbing inside perf > but it would be clearer and simpler to interpret to users. Same problem as above. > > One bug I found when testing is that if you do with HT-on: > > $ perf stat -a --topdown -I 1000 --metric-only sleep 100 > Then you get data for frontend and backend but nothing for retiring or > bad speculation. You see all the columns, but no data in some? That's intended: the percentage is only printed when it crosses a threshold. That's part of the top down specificatio. > I suspect it is because you expect --metric-only to be used only when > you have the > double --topdown. That's why I think this double topdown is confusing. If you do > as I suggest, it will be much simpler. It works fine with single topdown as far as I can tell. -Andi -- ak@linux.intel.com -- Speaking for myself only. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/