Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4715804imu; Tue, 8 Jan 2019 05:11:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5s7UiQ6ZNJzGNOObajPFtajveXaZkl2RfHuzl44J08O5ckgoN7pnaN/e6loOPVkfsFs2uy X-Received: by 2002:a63:c64f:: with SMTP id x15mr1464034pgg.16.1546953064357; Tue, 08 Jan 2019 05:11:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546953064; cv=none; d=google.com; s=arc-20160816; b=dgJMibJkX05izEK64u+s3VKPSZkUwNzG+B0fa1XATvq1dzqbhGUXYyYwigfvZia/C/ z4OJwY1hnipKP8vz/XNYxaWgnSMJIuPDcL+96rWq/t3ra4V1gRf1K5dPmkcWZu3mbZtM G/UBoZESawqRnivgk6oHSm9sEPmh5QBTSq1DYfBEf5ntu1tXoZ2sBaAaScmhSc2qmv/R x+TmTljlVKHq8bfa1UHvSE5/uJ1r/x+aBXxzpJImW63FOQydLg+79yf2JcuT58+2wiMu jE+oBmjhYtWuwQ2PoD2asMG2ZloKQrc6dqY6erC4r77EAAEqVyIja+MFNZWBNuMsUyVi qrvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=+yUzRZb97+i6TJPdxkx997tqVtRJ9bjv2DU49d3XdbI=; b=FpcXG1bfWK9XMMzsQoRg7+qsMF8g0V+gFGuau4657m1JEVvPtPW2vUkrDse+DqdQfb mHtlM9U4UjP1k709WLjdlC44eRgZHNgYpUewCiuWvswgNa2blD9x6zyUIVaiulNNKCrO EDi7XuJbm0boNYOdQHFSozhHQizfrm5JljwnMCovwVqLD9reP9zmoH/SrfghZ2TnrhBn gomXZUvfdqFiw4mUuEn1dqOFTo4NrsWkCC3ZultqJELHO2uUhEyS+eGdfNJoBoskUefx kp8yAEuUorV5gHLthSmS5iHAMVF2222jZlwk/UoBR2yY84VnNiFbENp68YrrjyIxZClP bV8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si28728426plb.230.2019.01.08.05.10.48; Tue, 08 Jan 2019 05:11:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728500AbfAHNHo (ORCPT + 99 others); Tue, 8 Jan 2019 08:07:44 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50666 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbfAHNHo (ORCPT ); Tue, 8 Jan 2019 08:07:44 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6D6621596; Tue, 8 Jan 2019 05:07:43 -0800 (PST) Received: from localhost (unknown [10.37.6.11]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C84953F70D; Tue, 8 Jan 2019 05:07:42 -0800 (PST) Date: Tue, 8 Jan 2019 13:07:41 +0000 From: Andrew Murray To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Richard Henderson , Ivan Kokshaysky , Matt Turner , Will Deacon , Mark Rutland , Shawn Guo , Sascha Hauer , Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Borislav Petkov , Russell King , suzuki.poulose@arm.com, robin.murphy@arm.com, Michael Ellerman , x86@kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org Subject: Re: [PATCH v4 05/13] arm: perf: conditionally use PERF_PMU_CAP_NO_EXCLUDE Message-ID: <20190108130740.GC56789@e119886-lin.cambridge.arm.com> References: <1546878450-20341-1-git-send-email-andrew.murray@arm.com> <1546878450-20341-6-git-send-email-andrew.murray@arm.com> <20190108102802.GC6808@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190108102802.GC6808@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 08, 2019 at 11:28:02AM +0100, Peter Zijlstra wrote: > On Mon, Jan 07, 2019 at 04:27:22PM +0000, Andrew Murray wrote: > > @@ -393,9 +386,8 @@ __hw_perf_event_init(struct perf_event *event) > > /* > > * Check whether we need to exclude the counter from certain modes. > > */ > > + if (armpmu->set_event_filter && > > + armpmu->set_event_filter(hwc, &event->attr)) { > > pr_debug("ARM performance counters do not support " > > "mode exclusion\n"); > > return -EOPNOTSUPP; > > This then requires all set_event_filter() implementations to check all > the various exclude options; Yes but this isn't a new requirement, this hunk uses the absence of set_event_filter to blanket indicate that no exclusion flags are supported. > also, set_event_filter() failing then > returns with -EOPNOTSUPP instead of the -EINVAL the CAP_NO_EXCLUDE > generates, which is again inconsitent. Yes, it's not ideal - but a step in the right direction. I wanted to limit user visible changes as much as possible, where I've identified them I've noted it in the commit log. > > If I look at (the very first git-grep found me) > armv7pmu_set_event_filter(), then I find it returning -EPERM (again > inconsistent but irrelevant because the actual value is not preserved) > for exclude_idle. > > But it doesn't seem to check exclude_host at all for example. Yes I found lots of examples like this across the tree whilst doing this work. However I decided to initially start with simply removing duplicated code as a result of adding this flag and attempting to preserve existing functionality. I thought that if I add missing checks then the patchset will get much bigger and be harder to merge. I would like to do this though as another non-cross-arch series. Can we limit this patch series to the minimal changes required to fully use PERF_PMU_CAP_NO_EXCLUDE and then attempt to fix these existing problems in subsequent patch sets? Thanks, Andrew Murray > > > @@ -867,6 +859,9 @@ int armpmu_register(struct arm_pmu *pmu) > > if (ret) > > return ret; > > > > + if (!pmu->set_event_filter) > > + pmu->pmu.capabilities |= PERF_PMU_CAP_NO_EXCLUDE; > > + > > ret = perf_pmu_register(&pmu->pmu, pmu->name, -1); > > if (ret) > > goto out_destroy; > > -- > > 2.7.4 > >