From patchwork Thu Feb 8 11:31:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13549673 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 153A8C4828F for ; Thu, 8 Feb 2024 11:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=08xxHn4GbkD/RuqFESWbL9POFmV+1ehZ4yuBAxeNNp8=; b=gGtHyWtnNt4kJG pZgQT7I8uQtkc1drV+rodUPsxWrqgW1VJYeJcbtztGeS2zWKAx6QKt9RpbQQcFDnigHH/xMvpp1VP 6rcUA6uoNLdcFh0voVr1Bh+hn4vTQ+9ibASap5VeKwbJYfrCnHp5ye3bXu1Zf0f4nmg4ee4kKXVQe x2YNWv3h7mXUWCcScyRDaFZfnF/tyfmDGk/9f8oJuFPvciqZ0dGR2VN9/ElDsHgjMbQtyTd6h9Uk5 1b/feherlrB9Vad3u068vX4r8F3JneJipqXaHBO5L27cl0qLDQJZRIDmeG8OwYUm/Xv7XagU/TJuX nW7c/gveK1oiuV5qT+Mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY2dQ-0000000DZfC-3iOw; Thu, 08 Feb 2024 11:32:04 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY2dO-0000000DZag-0jpe for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 11:32:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707391922; x=1738927922; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ymurIB97b11IqH9GZGJPPvkYT9r0Cf4QevmMQfDhVpY=; b=D62t7LGa9N0K+F0wcJd4ODuFK/MEnTHl0uPu0KZ9a3yncD9w1lz4EJqm v7j/40xw3urcKmpboVssaTxnUOxyr2FBUPAoSOpeLD6ZRxrtSRnIcS9ZR Ak5RxOlT61ATNpFXTp00TaWrEiEn+BfhUm0ekJzpsDx880MgwTaGsTFhL vK34Fs3WM2V0bcAQ43AV9Ufqb046SdvdQoiOCdcmW61bQloKN/mQh5BKl U4xZoRAOvOVxDog+niLfa4So6tXd3d5OkNmYsaO1j2dcAPuCyE6/7xiiw H2Z+QQMa4ezdUSA4z6Ira0eLnLjjEj8+D+gN6tNSlLsr7ydBiZCrlyzoo Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="1345502" X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1345502" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:32:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,253,1701158400"; d="scan'208";a="1957470" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO ahunter-VirtualBox.home\044ger.corp.intel.com) ([10.251.219.88]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2024 03:31:56 -0800 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 V5 03/12] perf/x86/intel: Do not enable large PEBS for events with aux actions or aux sampling Date: Thu, 8 Feb 2024 13:31:18 +0200 Message-Id: <20240208113127.22216-4-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240208113127.22216-1-adrian.hunter@intel.com> References: <20240208113127.22216-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-20240208_033202_327855_E28E6C86 X-CRM114-Status: GOOD ( 12.20 ) 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 --- 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 3804f21ab049..d50f4325d42a 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3885,6 +3885,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); @@ -3902,8 +3908,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; }