From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755629AbbG1OVi (ORCPT ); Tue, 28 Jul 2015 10:21:38 -0400 Received: from mail.kernel.org ([198.145.29.136]:51342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386AbbG1OVg (ORCPT ); Tue, 28 Jul 2015 10:21:36 -0400 Date: Tue, 28 Jul 2015 11:21:32 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Andi Kleen , linux-kernel@vger.kernel.org, Andi Kleen , jolsa@kernel.org Subject: Re: [PATCH] perf, tools, stat: Fix perf stat -T Message-ID: <20150728142132.GB575@kernel.org> References: <1438039491-22091-1-git-send-email-andi@firstfloor.org> <20150728141006.GE28175@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150728141006.GE28175@krava.brq.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Jul 28, 2015 at 04:10:06PM +0200, Jiri Olsa escreveu: > On Mon, Jul 27, 2015 at 04:24:51PM -0700, Andi Kleen wrote: > > From: Andi Kleen > > > > The transaction length metrics in perf stat -T broke recently. > > It would not match the metric correctly and always print K/sec. > > This was caused by a incorrect update of the cycles_in_tx statistics. > > Update the correct variable. > > > > Also the check for zero division was reversed, which resulted > > in K/sec being printed for no transactions. Fix this also up. > > > > Cc: jolsa@kernel.org > > Signed-off-by: Andi Kleen > > --- > > tools/perf/util/stat-shadow.c | 8 +++----- > > 1 file changed, 3 insertions(+), 5 deletions(-) > > > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c > > index 53e8bb7..2a5d8d7 100644 > > --- a/tools/perf/util/stat-shadow.c > > +++ b/tools/perf/util/stat-shadow.c > > @@ -85,7 +85,7 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 *count, > > else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES)) > > update_stats(&runtime_cycles_stats[ctx][cpu], count[0]); > > else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) > > - update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); > > + update_stats(&runtime_cycles_in_tx_stats[ctx][cpu], count[0]); > > oops, looks like copy&paste issue.. thanks > > > we now print comment line if the avg is 0, but I think it's ok > > Acked-by: Jiri Olsa This affects just perf/core, right?