From patchwork Fri Jun 28 06:51:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 13715540 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 3BEFAC2BBCA for ; Fri, 28 Jun 2024 06:52:15 +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=OY2rQc20z69la8/vcJmRNyrJ0pTIaoKf7Hw2E/9DNaI=; b=F/zltNTP3YOSjeV4wD1IRhfvZX tsqszZVVy/R+zn6Bfs94gXx+tmUvgza4nG8+oaV/i3ub5n/h4W4v7/wl98JpaexivGGYsWkzm7mTw n4GHZzHemB5s8XJhd2FcsFOzIMeoXZ+/cAf3+u/Uj37rhBP+e9wXvUDONnM6Lw/4J+Ujxt+7vJI78 IVNP0Y+ndZF25HiTCaVGojAfXHXxlMdmUnt3bitBNl0UntJprUbqrVUaKPnIZwriQRkY7iTdnTt3r o8gKSILnxhTrxTaawz1QWk3lz3JI7A89WDyU/WFay9D5IeUhj1/gKATFagC4MxPuO1NX3u1kg0vf+ Nu4K2JPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sN5Sl-0000000Cntx-1i0r; Fri, 28 Jun 2024 06:52:03 +0000 Received: from mgamail.intel.com ([198.175.65.16]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sN5SZ-0000000Cnij-0jcc for linux-arm-kernel@lists.infradead.org; Fri, 28 Jun 2024 06:51:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719557512; x=1751093512; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c+UKVFhB6ulvXkirzdRM40HZQlz9VyxBX6vSZHqaga8=; b=A5UD1EmREPCgK9yGyyFFkwFXpf4GyLQcsW5xlaxFLosLhCU3HuB/Wlm1 xoGEwXHyxDWrqcRvDuP6W+bHdabbhT2CsvPwX4w4MQMFQaktYUyKb1QPm tKJl/u+Nj6gXRfpoppyedUougE9tJLMpRKZnn9nQLVTz9ZdJ00q9qRMar WIXfOALOEcnAsS1Kydqu4GzDSnzCdv2CYg0/pFgJjW/TVaZidid0+MDZm eYd+OcwQk9UemVNmbPdEJ8p9XVqU1AfZikuzGSaYEA6Tudk2tzvSfsRpd 3S1kT3vysydK78f60lRSfL1Rm/O8Va12WzyC6lTHAAuuBWCo30wnF/OMD w==; X-CSE-ConnectionGUID: +G1WDw/jTwWlbzQZ3k3keg== X-CSE-MsgGUID: eY4yJY5tTJSCED4VLJv+4Q== X-IronPort-AV: E=McAfee;i="6700,10204,11116"; a="16857152" X-IronPort-AV: E=Sophos;i="6.09,168,1716274800"; d="scan'208";a="16857152" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2024 23:51:51 -0700 X-CSE-ConnectionGUID: uh/DaPHNQ9GRGLwue7jyFg== X-CSE-MsgGUID: kxQh0WldR5S6CeOUP48oog== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,168,1716274800"; d="scan'208";a="75386688" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.246.49.253]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2024 23:51:45 -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 V8 03/12] perf/x86/intel: Do not enable large PEBS for events with aux actions or aux sampling Date: Fri, 28 Jun 2024 09:51:02 +0300 Message-Id: <20240628065111.59718-4-adrian.hunter@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240628065111.59718-1-adrian.hunter@intel.com> References: <20240628065111.59718-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-20240627_235151_412889_E96BA76B X-CRM114-Status: GOOD ( 12.57 ) 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 0e835dc134a5..7bc3762af271 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; }