Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp537112rdb; Tue, 19 Sep 2023 03:06:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF19b3HNpz09AWommqcQJQL0OdCeGmtc65ipeMcniCQaJYLLnGpSJEqd/eZXGCpa3LU3JO4 X-Received: by 2002:a05:6a20:748d:b0:137:74f8:62ee with SMTP id p13-20020a056a20748d00b0013774f862eemr14164804pzd.18.1695117986007; Tue, 19 Sep 2023 03:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695117985; cv=none; d=google.com; s=arc-20160816; b=tBEVMG/TReDGa0iCPwC6FDq/R2CZRTS7URrbewk9GTf0a0+1v5xohKrkLw+gG4n8hd 9gg5nEbCavSriv15gL6PkUhh9Zi+wDChqKjjJv6nHP/OGwqjJuWdUCow5cckSMX5f/as j3Z3rPzM3iBceqFnMBmSsmZ5SSGUWXbwTpNqGlYOUwWvBQJpNBsy6UzMpe4L7EgUh5Er uMi9+q7r4h5eDLGB+ScNdOm3+3OxqGLuA2+GagBFqrShMb3PtoT2Tx91oRBDydjYhBjR OkOJJHjHG8dHmSy+dK79/2HQ2soxbDYv2UdW3NkGEmi021a8RW+Ts6/vhlEojxSTt/XR dARw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YzRWyY3L3O30xB+Htl3CqvUIlvr6pJRGjJvUatL0E3Q=; fh=kpMt1P92oj7/lFbr2atP1nHinxCyAYPlv+CLhYt6qjE=; b=X2SlZmppBpW81+pd341jnHkuISl8ZBho1f8VaQDMSnlCKe4FpVubTj0w9XYYnuyVHW Qspv4TUDnXFKF6NsNo/44xXflwzZlNnFsRKU98VqcZaaxTEUJDUZypmhYBFR6qrlY7I+ CH+d/U8WtLEbdXAwnNAuvpmpUPGBwvFX4n7b5c5y0Fszun+HeM+AOfvirS9UxM8/HeJg iOI5orXaq4YLPAk06tOjVntoM+wnaBBqUCSa8f1vCccF3jmaTWLp2A86mLC5KpLv2xsn +WacxUYfgtFmxmYOwoc4vNYbbCMJ3tCmbnREaAzbPtIko90Yij6Hu+lcgEKOMalIMXrh Kygw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h8-20020a170902f54800b001c362510a4esi9975340plf.613.2023.09.19.03.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:06:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 30E2F8245A55; Tue, 19 Sep 2023 02:52:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231339AbjISJwE (ORCPT + 99 others); Tue, 19 Sep 2023 05:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjISJwC (ORCPT ); Tue, 19 Sep 2023 05:52:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5CB3CEA; Tue, 19 Sep 2023 02:51:57 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 718FE1FB; Tue, 19 Sep 2023 02:52:34 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8A9193F67D; Tue, 19 Sep 2023 02:51:55 -0700 (PDT) From: James Clark To: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org Cc: James Clark , Catalin Marinas , Will Deacon , Jonathan Corbet , Mark Rutland , Zaid Al-Bassam , Marc Zyngier , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 0/2] arm64: perf: Add support for event counting threshold Date: Tue, 19 Sep 2023 10:51:27 +0100 Message-Id: <20230919095137.360963-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Tue, 19 Sep 2023 02:52:05 -0700 (PDT) FEAT_PMUv3_TH (Armv8.8) is a new feature that allows conditional counting of PMU events depending on how much the event increments on a single cycle. Two new config fields for perf_event_open have been added, and a PMU cap file for reading the max_threshold. See the first commit message and the docs in the second commit for more details. The change has been validated on the Arm FVP model: # Zero values, works as expected (as before). $ perf stat -e dtlb_walk/threshold=0,threshold_control=0/ -- true 5962 dtlb_walk/threshold=0,threshold_control=0/ # Threshold >= 255 causes count to be 0 because dtlb_walk doesn't # increase by more than 1 per cycle. $ perf stat -e dtlb_walk/threshold=255,threshold_control=5/ -- true 0 dtlb_walk/threshold=255,threshold_control=5/ # Keeping comparison as >= but lowering the threshold to 1 makes the # count return. $ perf stat -e dtlb_walk/threshold=1,threshold_control=5/ -- true 6329 dtlb_walk/threshold=1,threshold_control=5/ James Clark (2): arm64: perf: Add support for event counting threshold Documentation: arm64: Document the PMU event counting threshold feature Documentation/arch/arm64/perf.rst | 58 ++++++++++++++++++++++++++++++ drivers/perf/arm_pmuv3.c | 59 ++++++++++++++++++++++++++++++- include/linux/perf/arm_pmuv3.h | 7 +++- 3 files changed, 122 insertions(+), 2 deletions(-) base-commit: 21b61fe48c2fc43d98ebb67a1f3832e0478fa523 -- 2.34.1