Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3233847pxb; Tue, 20 Apr 2021 03:50:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGYXqcSGjZkvVDQ/7bmyPWsksuivgfpysBpqSlSWQUugRy22kEAqBbjsIrAiTlcr43qYq5 X-Received: by 2002:a17:906:5e15:: with SMTP id n21mr26619091eju.57.1618915827389; Tue, 20 Apr 2021 03:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618915827; cv=none; d=google.com; s=arc-20160816; b=mkmVaY8HdiXhM0PWhLoWH37DxJSIjO+W1c8evGIQQkZbgP5Q8GAaI1VSiH1liliWJ6 HreYFkiOLI8Dv9rpI4wqw/ymuwR80RdzvSR1Adsa//R77ITDupY1anRE62dEh1cy7BFL K9DBNhnnDBOqjyW0Nw7FNfKwfDgbiBGx9Hd1rcRJd5GWuKkoi8udedzTSlf2Dlz7yD1s YhATTLO/n7TUN0iUiQUUcaZMLWyfU51yftrIfx7T82nq92bLjr9Xb/klWG+vnRmhqrcb JNvnYN4GUKMxA33DHVajGqkwCFDvA8hx7sLpp80Rre52MQzK8Ms5Yk9Qogi2k+IuL863 HHhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=6XAob3vAhduNyORLGlSq3Q+X7Cb3Sfzw3RuTIN5onW0=; b=yclkoSKb/tOXnRqwUZ8JgZLUkxJS5cq1avkTq4gUSx7oVa6l69UdQ0QWSITkXh0Bi+ k9Q5tGyUHRLQSexfYSHS4V46HkTSGMX/y1eSEnbjY5mWkhbHG0DulqyUPFvN4BOjIfdo hC1rrErWRPSCGlwSmtRlbRk2B8ZjdI7fGvfWAAMxUY2tS5wAPxEv5iItmnaMuGZrY7Uk 3aeyv6K1sUeBdp25HM4qwp98lpvLOhTRsD3F24OeKI5TbDcb8IwvHNhXDXXZzTH1Aqm1 E1U8Bb8c6S7Y3svEcWRcb4jRLOtaWZDV4vq5/BSkVhQsjWDm66M/x1ca6yA2tnWJZX8a ggGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kKrSyZQY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=UkjTZKq0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz5si14695702ejc.532.2021.04.20.03.50.02; Tue, 20 Apr 2021 03:50:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=kKrSyZQY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=UkjTZKq0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231961AbhDTKr0 (ORCPT + 99 others); Tue, 20 Apr 2021 06:47:26 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51694 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231644AbhDTKrP (ORCPT ); Tue, 20 Apr 2021 06:47:15 -0400 Date: Tue, 20 Apr 2021 10:46:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1618915603; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6XAob3vAhduNyORLGlSq3Q+X7Cb3Sfzw3RuTIN5onW0=; b=kKrSyZQYy+aJ9j1GNTT1JoiNLVXJiAta54Gpykt9uyLX973ILQRREeRhD7GGVuD3CBGP17 2W+NiVodUTVU9Jh6QabOqeH9OXrrpgQtSh7hamBBHkfcp6Yu6XFrFZo3xdH4R97gakiPTR aHHxnRqzPr1VJuWY7I5kisDKQ4F2qlo78Q8U2kQeppSn2zAyUZOOkdbFzsBryadjbbvy1L SMgSV0sccEbWnFJ+fp/r0L97j1ARQ/NeavQGvfe8Me8CL0hJROPVv6tGb0p0uRs9y2zWIx biNsy8MXBiBltfKhdc32Ra2WSELHSAxXwLrBJUr4S+Lkw1zDMuwg7Hanft+dWQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1618915603; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6XAob3vAhduNyORLGlSq3Q+X7Cb3Sfzw3RuTIN5onW0=; b=UkjTZKq01TXtc6u/um5Y6uj7UmoXulBo/aqINf++JOOvZQkxWAlN1kkKRop9KmCsQpOLB3 QQDCGdDc1/nWw/CA== From: "tip-bot2 for Kan Liang" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86: Support filter_match callback Cc: Kan Liang , "Peter Zijlstra (Intel)" , Andi Kleen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1618237865-33448-20-git-send-email-kan.liang@linux.intel.com> References: <1618237865-33448-20-git-send-email-kan.liang@linux.intel.com> MIME-Version: 1.0 Message-ID: <161891560282.29796.9965092803424778731.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: 3e9a8b219e4cc897dba20e19185d0471f129f6f3 Gitweb: https://git.kernel.org/tip/3e9a8b219e4cc897dba20e19185d0471f129f6f3 Author: Kan Liang AuthorDate: Mon, 12 Apr 2021 07:30:59 -07:00 Committer: Peter Zijlstra CommitterDate: Mon, 19 Apr 2021 20:03:28 +02:00 perf/x86: Support filter_match callback Implement filter_match callback for X86, which check whether an event is schedulable on the current CPU. Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Andi Kleen Link: https://lkml.kernel.org/r/1618237865-33448-20-git-send-email-kan.liang@linux.intel.com --- arch/x86/events/core.c | 10 ++++++++++ arch/x86/events/perf_event.h | 1 + 2 files changed, 11 insertions(+) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 37ab109..4f6595e 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2641,6 +2641,14 @@ static int x86_pmu_aux_output_match(struct perf_event *event) return 0; } +static int x86_pmu_filter_match(struct perf_event *event) +{ + if (x86_pmu.filter_match) + return x86_pmu.filter_match(event); + + return 1; +} + static struct pmu pmu = { .pmu_enable = x86_pmu_enable, .pmu_disable = x86_pmu_disable, @@ -2668,6 +2676,8 @@ static struct pmu pmu = { .check_period = x86_pmu_check_period, .aux_output_match = x86_pmu_aux_output_match, + + .filter_match = x86_pmu_filter_match, }; void arch_perf_update_userpage(struct perf_event *event, diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h index e2be927..606fb6e 100644 --- a/arch/x86/events/perf_event.h +++ b/arch/x86/events/perf_event.h @@ -879,6 +879,7 @@ struct x86_pmu { int (*aux_output_match) (struct perf_event *event); + int (*filter_match)(struct perf_event *event); /* * Hybrid support *