From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423292AbcBQT1w (ORCPT ); Wed, 17 Feb 2016 14:27:52 -0500 Received: from one.firstfloor.org ([193.170.194.197]:42005 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423172AbcBQT1v (ORCPT ); Wed, 17 Feb 2016 14:27:51 -0500 Date: Wed, 17 Feb 2016 20:27:49 +0100 From: Andi Kleen To: Arnaldo Carvalho de Melo Cc: Andi Kleen , jolsa@kernel.org, eranian@google.com, mingo@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 3/8] perf, tools, stat: Move noise/running printing into printout Message-ID: <20160217192749.GB5083@two.firstfloor.org> References: <1454173616-17710-1-git-send-email-andi@firstfloor.org> <1454173616-17710-4-git-send-email-andi@firstfloor.org> <20160216200256.GI17690@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160216200256.GI17690@kernel.org> 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 On Tue, Feb 16, 2016 at 05:02:56PM -0300, Arnaldo Carvalho de Melo wrote: > Em Sat, Jan 30, 2016 at 09:06:51AM -0800, Andi Kleen escreveu: > > From: Andi Kleen > > > > Move the running/noise printing into printout to avoid > > duplicated code in the callers. > > > > v2: Merged with other patches. Remove unnecessary hunk. > > Readd hunk that ended in earlier patch. > > v3: Fix noise/running output in CSV mode > > v4: Merge with later patch that also moves not supported printing. > > Acked-by: Jiri Olsa > > So, the description makes it look like this is just elliminating code > duplication, but then, before we had: Thanks. Here's a patch to fix it. ---- perf, tools, stat: Handled scaled == -1 case for counters Arnaldo pointed out that the earlier "Move noise/running printing into printout" change changed behavior for not counted counters. This patch fixes it again. Signed-off-by: Andi Kleen diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 15e4fcf..86289df 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -860,7 +860,7 @@ static void printout(int id, int nr, struct perf_evsel *counter, double uval, nl = new_line_std; - if (run == 0 || ena == 0) { + if (run == 0 || ena == 0 || counter->counts->scaled == -1) { aggr_printout(counter, id, nr); fprintf(stat_config.output, "%*s%s",