From patchwork Mon Jul 15 16:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13733627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8155DC3DA4B for ; Mon, 15 Jul 2024 16:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=XAwXWkSxM3vGoWC3429TC2cjljh7lbSMlyKQkfLCrPo=; b=Uwx4xPkFedfaF0Dbfl6fY+ZKs5 8LhRc0BvoRARCSMARekf7xIVXm0G2ldxVYQdjr/PcQrsJEn1xvo2VKQ0c+lSpm8qIoYl0ezNcOH/w a/nTxup6UJo63n+UiZrExTyxbQIzeY/bPV4SwwvTcUNPf1AW2mwgK16apXmHZf6i+BI74eZp8Nyma lPyVwK8E4idBBDVOxkTnI/PYESlvxLZxKpwBuW+/uBJFTLXug8WUQ6MQS+ijuauzsyd/5UumDKDXL ybIS0VJUYR2b0VWwUI7jGrUPRghwMGq6dJKQ7MESKtUCeMcLJljiFc85ecxJEQ1Ra/DNexoFj15VM bZb9e6GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTOG7-00000007fJM-3CFJ; Mon, 15 Jul 2024 16:09:03 +0000 Received: from mgamail.intel.com ([192.198.163.13]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTOF1-00000007ejl-1dJi for linux-arm-kernel@lists.infradead.org; Mon, 15 Jul 2024 16:07:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721059675; x=1752595675; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+hq3P0AGBGCKyL0Jx2ImBjyEI0MYBUh9fT5KNpqUMVE=; b=SCQzzkkxPN4Q7c75JBDjTPol2IyAR3yGDJJY4MBKkGHDuBIRoXjmG+wG pdcPicBqtoOPdRhpE23aV+CpFFeBk2YeY+8YmvXAni7maje/7o8yjjRbU b0Ip8CuscXjEkjwaPSGLMW8HdcAPUylTaDmAsk4T1x3MZHJmEvcoswyg2 0Yi4CQV3VAKP9Hnl8B64hejW1C7je0cymPXM6bJ46C5FWeqhknglZtIGb q6Rvd5SIik+IbFE3G1DIMVe3NfzvwSj/CvUaZF9TU94q77xn8txYTrSyD 4QJ47/KGFStjV20f7jsxrur4aFNCxX286NlNfDfP3Mlq7GNytatRSUVHF w==; X-CSE-ConnectionGUID: z1a8Pf9SQ0aCubLcYd+DGg== X-CSE-MsgGUID: BUXOsV0YRHmsM4Z7bZbkYw== X-IronPort-AV: E=McAfee;i="6700,10204,11134"; a="21361214" X-IronPort-AV: E=Sophos;i="6.09,210,1716274800"; d="scan'208";a="21361214" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2024 09:07:50 -0700 X-CSE-ConnectionGUID: iSpZrdC3RxeeL9BSIM7XDw== X-CSE-MsgGUID: eKrJuMWLT+ybp7w/xXss+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,210,1716274800"; d="scan'208";a="49413538" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.246.49.253]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2024 09:07:44 -0700 From: Adrian Hunter To: Peter Zijlstra Cc: Ingo Molnar , Mark Rutland , Alexander Shishkin , Heiko Carstens , Thomas Richter , Hendrik Brueckner , Suzuki K Poulose , Mike Leach , James Clark , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Yicong Yang , Jonathan Cameron , Will Deacon , Arnaldo Carvalho de Melo , Jiri Olsa , Namhyung Kim , Ian Rogers , Andi Kleen , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: [PATCH V9 04/13] perf/x86/intel: Do not enable large PEBS for events with aux actions or aux sampling Date: Mon, 15 Jul 2024 19:07:03 +0300 Message-Id: <20240715160712.127117-5-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240715160712.127117-1-adrian.hunter@intel.com> References: <20240715160712.127117-1-adrian.hunter@intel.com> MIME-Version: 1.0 Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240715_090755_768675_FB83A139 X-CRM114-Status: GOOD ( 12.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Events with aux actions or aux sampling expect the PMI to coincide with the event, which does not happen for large PEBS, so do not enable large PEBS in that case. Signed-off-by: Adrian Hunter Reviewed-by: Andi Kleen --- arch/x86/events/intel/core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 38c1b1f1deaa..3de40cb823c9 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3886,6 +3886,12 @@ static inline bool intel_pmu_has_cap(struct perf_event *event, int idx) return test_bit(idx, (unsigned long *)&intel_cap->capabilities); } +static inline bool has_aux_action(struct perf_event *event) +{ + return event->attr.aux_pause || event->attr.aux_resume || + event->attr.aux_sample_size; +} + static int intel_pmu_hw_config(struct perf_event *event) { int ret = x86_pmu_hw_config(event); @@ -3903,8 +3909,8 @@ static int intel_pmu_hw_config(struct perf_event *event) if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; - if (!(event->attr.sample_type & - ~intel_pmu_large_pebs_flags(event))) { + if (!(event->attr.sample_type & ~intel_pmu_large_pebs_flags(event)) && + !has_aux_action(event)) { event->hw.flags |= PERF_X86_EVENT_LARGE_PEBS; event->attach_state |= PERF_ATTACH_SCHED_CB; }