From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751693AbcELIDs (ORCPT ); Thu, 12 May 2016 04:03:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45516 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751338AbcELIDq (ORCPT ); Thu, 12 May 2016 04:03:46 -0400 Date: Thu, 12 May 2016 10:03:43 +0200 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, peterz@infradead.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 10/10] perf, tools, stat: Add extra output of counter values with -vv Message-ID: <20160512080343.GB14734@krava> References: <1462489447-31832-1-git-send-email-andi@firstfloor.org> <1462489447-31832-11-git-send-email-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1462489447-31832-11-git-send-email-andi@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.30]); Thu, 12 May 2016 08:03:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 05, 2016 at 04:04:07PM -0700, Andi Kleen wrote: > From: Andi Kleen > > Add debug output of raw counter values per CPU when > perf stat -v is specified, together with their cpu numbers. > This is very useful to debug problems with per core counters, > where we can normally only see aggregated values. > > v2: Make it depend on -vv, not -v > Signed-off-by: Andi Kleen > --- > tools/perf/builtin-stat.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c > index 707eef9314da..7c5c50b61b28 100644 > --- a/tools/perf/builtin-stat.c > +++ b/tools/perf/builtin-stat.c > @@ -313,6 +313,14 @@ static int read_counter(struct perf_evsel *counter) > return -1; > } > } > + > + if (verbose > 1) { > + fprintf(stat_config.output, > + "%s: %d: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", > + perf_evsel__name(counter), > + cpu, > + count->val, count->ena, count->run); > + } hi, we already have similar output for aggregated counters, could you please consider something like below to clearly separate them? [root@ibm-x3650m4-01 perf]# ./perf stat -e cycles -I 1000 -vv -a -C 0,1 ... cycles: CPU 0: 1298783264 1000126956 1000126956 cycles: CPU 1: 1298791660 1000134589 1000134589 cycles: AGGR: 2597574924 2000261545 2000261545 ... thanks, jirka --- diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 7c5c50b61b28..bd0d67ebb757 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -316,7 +316,7 @@ static int read_counter(struct perf_evsel *counter) if (verbose > 1) { fprintf(stat_config.output, - "%s: %d: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", + "%s: CPU %d: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", perf_evsel__name(counter), cpu, count->val, count->ena, count->run); diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index c1ba255f2abe..5ddeea1399ee 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -345,7 +345,7 @@ int perf_stat_process_counter(struct perf_stat_config *config, update_stats(&ps->res_stats[i], count[i]); if (verbose) { - fprintf(config->output, "%s: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", + fprintf(config->output, "%s: AGGR: %" PRIu64 " %" PRIu64 " %" PRIu64 "\n", perf_evsel__name(counter), count[0], count[1], count[2]); }