From patchwork Fri May 31 05:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13681151 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 540B1C25B7E for ; Fri, 31 May 2024 05:58:49 +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=VXlUw6UZZiG452CDmT/M12bD5dzHzuGqkIJ7l8vHWw0=; b=0n7r9XcHRXowGs QXJk8zh92mFMoOoMn/7FjL7G8LwutyFPDA0WAUOFAJmMI28H7zT8m1CTw240EkTYMd3GtI81RKX6Z 2Sx1A3P2eFLm5YutaRs4yDfpnEelGFqRcaZV5KBvhI6ufUp1XKGItn/J4ZjffBUp+LaPEbMev6D3g voIPN5wAxUqF2jt8Q7w07ay9zOyMnh87nldzBtOJl9bqLkUiNtddkkc8OZDAKvdXbcuUAxQFywLS5 ZIZqnLrANnYq8giwi5c5rlVJZmfVC4zJfX0krtwSXaKuKCrYYgnviapz58hTQraAOzUmUwta4nMab ZPrnWmlAK6BeHcYvhtQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCvHj-00000009K3D-4Bs2; Fri, 31 May 2024 05:58:40 +0000 Received: from mgamail.intel.com ([192.198.163.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sCvHR-00000009Js5-0AQn for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 05:58:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717135101; x=1748671101; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+hq3P0AGBGCKyL0Jx2ImBjyEI0MYBUh9fT5KNpqUMVE=; b=LEKkQ22zy4HHMr1Bnzjw6yh4AY+u+BZQFkPP5nN0lPLWANmfR/5Q0FGk Bs+1xlZNtvX708G1PVC/wnH7lNuDeL4vB+Z29qYbr4An1bMqkrvIJj7LX UqLjQ52GnT05En9MMhghRJKFaX317t4JXoOE2aLPq118evrkqxCuk1PGC sSg5fXmguriCHfIO54+YGaJTkxnD36PUHspn4Q/MIrdUvcs+5KWoJ5edc RXtaFra8FJsY+OgB/L8qRU7P9FENZ378EITtKgzs4PFhQpVEIL7krCFtN y8496F0/H8wGE7elBqYTLcP05Mqcb7BRgkbzu5D7EnON27LE8vs87zyQb w==; X-CSE-ConnectionGUID: ISUNMVm4QgWT5JqncwCoIw== X-CSE-MsgGUID: mFKslgSaRty61WllyFGZPw== X-IronPort-AV: E=McAfee;i="6600,9927,11088"; a="25068149" X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="25068149" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 22:58:07 -0700 X-CSE-ConnectionGUID: HpAEITS6Q+eAz+LgRHOezQ== X-CSE-MsgGUID: 26SdUhHATC6C79VVubQv/g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,203,1712646000"; d="scan'208";a="40510868" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.246.41.28]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 May 2024 22:58:03 -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 V7 03/12] perf/x86/intel: Do not enable large PEBS for events with aux actions or aux sampling Date: Fri, 31 May 2024 08:57:22 +0300 Message-Id: <20240531055731.12541-4-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531055731.12541-1-adrian.hunter@intel.com> References: <20240531055731.12541-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-20240530_225821_282239_5F75E4FF X-CRM114-Status: GOOD ( 12.45 ) 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; }