From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751351AbdBZX2H (ORCPT ); Sun, 26 Feb 2017 18:28:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48248 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbdBZX2F (ORCPT ); Sun, 26 Feb 2017 18:28:05 -0500 Date: Mon, 27 Feb 2017 00:28:01 +0100 From: Jiri Olsa To: Andi Kleen Cc: acme@kernel.org, jolsa@kernel.org, linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 01/10] perf, tools, stat: Factor out callback for collecting event values Message-ID: <20170226232801.GA15605@krava> References: <20170224001021.6723-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170224001021.6723-1-andi@firstfloor.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Sun, 26 Feb 2017 23:28:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 23, 2017 at 04:10:12PM -0800, Andi Kleen wrote: SNIP > +static void aggr_cb(struct perf_evsel *counter, void *data, bool first) > +{ > + struct aggr_data *ad = data; > + int cpu, cpu2, s2; > + > + for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { > + struct perf_counts_values *counts; > + > + cpu2 = perf_evsel__cpus(counter)->map[cpu]; > + s2 = aggr_get_id(evsel_list->cpus, cpu2); > + if (s2 != ad->id) > + continue; > + if (first) > + ad->nr++; > + counts = perf_counts(counter->counts, cpu, 0); > + /* > + * When any result is bad, make them all to give > + * consistent output in interval mode. > + */ > + if (counts->ena == 0 || counts->run == 0 || > + counter->counts->scaled == -1) { > + ad->ena = 0; > + ad->run = 0; > + break; > + } that's new, please make this a separate change thanks, jirka