Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4571260imu; Tue, 8 Jan 2019 02:32:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN7qNeayl+SXbJGqG41A+P/b1mgJPMBvh8tnqwXjXdHN6NHOBa8E8hfwQvl9/gSVtYRu19/e X-Received: by 2002:a62:509b:: with SMTP id g27mr1206577pfj.48.1546943528061; Tue, 08 Jan 2019 02:32:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546943528; cv=none; d=google.com; s=arc-20160816; b=F3xXgm51Sz8tZ/AI0PazYQTu8ui+kl35rMt1XcpMa/RZRkZASS/UeYOAQWhIGcpu4f 20w1Ekh48GlZIhaDTFmdRNjt+a2nm1zuRla6BOvub6xYq7xsXBC4VIfWeUELUHyCwNZv DFMxELiq+l1Tl/Nl4OD7pEHGSmoH7epeGA7GcmXFWAT1UwG9X8Vc67IEMHqNAkpY46MG 6zhRL+caIz0fHpzjOJTDT174aOaU5+gprU0mSMRP3BDqDpOR97eLBflr7mB6UU2CfrFu 8rEhCON9HqEBPYyzTy2pOeFVvf4EVSHQG8s7xnwDe3Ik5ohT/ILQ0Gmrr/3mHKYDBThT Y6oQ== 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:dkim-signature; bh=a3kU5k+u673a2t4p3kZsUUxiSNyKyt8voZTb8FPfGoU=; b=SonsYTGjSzs/nWf3Ll0lirY/R6Hwu5XcDMISdBp9gi8irlDQzk6UCcz7mAcRkiUrmj f9skvvtiX4Xa0PujevwPkF9kPwoZ5gDTaohFQlvqtJGtnsxilF+DkXwLO2uzMf72+VAg azFFj0VRuYNLAMLu5R7IU+4O8IwxIsxLVzVWfxHysl858GSJE80FbtZm4p7QUmF+x+mK otc6soJOFIxoK5WtLNd1KxXYibrMzXiy0uOyEWtFoWyMcJckHR77zRR8790kr0YT5LSs Wl7F3rQHRm4lw+P3jSJeNBzQJO/KRkCdWHtza+FbeYI5xNvfn+8ykla/UyTFsqL5srZv 8L3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=KtPkx1Ci; 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 f1si65491855pld.92.2019.01.08.02.31.52; Tue, 08 Jan 2019 02:32:08 -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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=KtPkx1Ci; 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 S1728786AbfAHK32 (ORCPT + 99 others); Tue, 8 Jan 2019 05:29:28 -0500 Received: from merlin.infradead.org ([205.233.59.134]:48782 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbfAHK31 (ORCPT ); Tue, 8 Jan 2019 05:29:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=a3kU5k+u673a2t4p3kZsUUxiSNyKyt8voZTb8FPfGoU=; b=KtPkx1CiOsfJMDgrKwdFT06Wg RsxgG+HhPdWeZT2jQM2eF/RrXNalETBM4ZFaA9Xy6HS5tx8TknXTI7JkPDwPyc4ZoykiCuM6OwVDu c26g/Pna8g9b7AFhFeYOFo2ukav88impf1E5/f4d7VQwaZTuh7jVHc4jXGEb/Vvv3cY8ajOmEtH0y 2SZrEjNZ2fytGuPTc+WTgg0NywS0Gj50L6jsHOpV6/GeEiuDYHSUZ9ji+/Mp027aMTj2leFSsF7+U G5va0gYlsmkGWKPArWaKBMWLO2kI/qb25k/EdrXhEl8oE6q22epOoF2ZUVaKJvBPvWtqywRNO3PMf NLCUwZRng==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggoc8-0003ob-DZ; Tue, 08 Jan 2019 10:28:04 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 04C1D20268504; Tue, 8 Jan 2019 11:28:02 +0100 (CET) Date: Tue, 8 Jan 2019 11:28:02 +0100 From: Peter Zijlstra To: Andrew Murray 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: <20190108102802.GC6808@hirez.programming.kicks-ass.net> References: <1546878450-20341-1-git-send-email-andrew.murray@arm.com> <1546878450-20341-6-git-send-email-andrew.murray@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1546878450-20341-6-git-send-email-andrew.murray@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; also, set_event_filter() failing then returns with -EOPNOTSUPP instead of the -EINVAL the CAP_NO_EXCLUDE generates, which is again inconsitent. 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. > @@ -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 >