From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932617AbcASIQa (ORCPT ); Tue, 19 Jan 2016 03:16:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57164 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757294AbcASIQ0 (ORCPT ); Tue, 19 Jan 2016 03:16:26 -0500 Date: Tue, 19 Jan 2016 09:16:23 +0100 From: Jiri Olsa To: Mel Gorman Cc: Jiri Olsa , Arnaldo Carvalho de Melo , LKML Subject: Re: perf stat stddev reporting broken since "perf stat: Introduce read_counters function" Message-ID: <20160119081623.GC20358@krava.brq.redhat.com> References: <20160118175946.GC10802@techsingularity.net> <20160119074228.GB20358@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160119074228.GB20358@krava.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2016 at 08:42:28AM +0100, Jiri Olsa wrote: SNIP > > > > Performance counter stats for 'sleep 1' (5 runs): > > > > 0.583178 task-clock (msec) # 0.001 CPUs utilized > > 1 context-switches # 0.002 M/sec > > 0 cpu-migrations # 0.000 K/sec > > 67 page-faults # 0.141 M/sec > > 1,224,416 cycles # 2.585 GHz > > stalled-cycles-frontend > > stalled-cycles-backend > > 892,568 instructions # 0.68 insns per cycle > > 184,975 branches # 390.554 M/sec > > 8,512 branch-misses # 4.57% of all branches > > > > 1.000889249 seconds time elapsed ( +- 0.01% ) > > > > I checked and current master in Linus' tree is also broken. Is this > > change in documented perf stat behaviour intentional? > > nope, not intentional.. I'll check on that, thanks for reporting for some reason we initialized the stat every iteration, (the call is also wrong because it's called only over the first res_stats[0]) attached patch works for me, could you please test? I'll run more tests and put it in my queue thanks, jirka --- diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 2f901d15e063..2b58edccd56f 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -310,7 +310,6 @@ int perf_stat_process_counter(struct perf_stat_config *config, int i, ret; aggr->val = aggr->ena = aggr->run = 0; - init_stats(ps->res_stats); if (counter->per_pkg) zero_per_pkg(counter);