Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8240385rwb; Tue, 13 Dec 2022 04:09:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf7GtibWjFpaUxCFXlu8wS1Ey3NCwwpLPfSR+TmqbaEPFonXjnrQcpoOUf24P8+xPyYvhEBd X-Received: by 2002:a17:906:2554:b0:7c0:db53:c599 with SMTP id j20-20020a170906255400b007c0db53c599mr16802921ejb.22.1670933341460; Tue, 13 Dec 2022 04:09:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670933341; cv=none; d=google.com; s=arc-20160816; b=nkW9+g6coZMYn3wM/rTi8mcFkbb5E7o5J2zJz56RpkbvDRhfRCS5NFs/VrUwkRUQB7 q3/JJOlsOcFe5xyb0JH7aBa3cQmuRKRc+8GDtogjbyx6w0dWHJ+UvGm025jLjGy+uzdi E+FzZYH9nX/wkn4IG21MpQ463wX481jrlcdbYTzevzdexljtG+fjg6kV7LYsw+C0nB8q c9vN77lb2dqt4bTJ/N98IvaPkIy+wk86eZJE0aV/sYnjfSUw42Brbfh29Mp6tsOTkwxi 6yGpF6zl3JFvCpOL4IX5UB6nb/CGS/8ylPwrDMYoVOT1dy+VHnN4drfdfRNyFps00nB3 ss+A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=iPXrI6wqcifxFihFsjxp2jiWct4a5R8F6ZfsZ/ihcVY=; b=zE5My5EAcMOpVU96U841H4K3t+dkO9oyabLasBHBtFE2aI17DHhOT4Uw08gBDaVgSx 2RitPUoNDIVz/ptveqcK2IbXhKFUrUuayXdb2Hw5fqcCfYosSu+JcLm79TKAnQA5g2rA PhZwu7xdPhLYrQDkQQ0kDBSsWCeK0vWwhgltd9Vc+NbDZLGMJFVRFp3ybvwo00NgJDEt JFHToyiH/Cci1bRIzBrzRKvu+l3Ap663TR5te5bcl4akXq2mV6UxHvgxi4FTmxf/69lA 0QBF6EhM+8HloNjxIp7eC50aH+vf9nAGHtc49SQ7G4KIAKzDnweb1bARM4RN4iQ2WvxR frlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq15-20020a1709073f0f00b007c15653692csi5338108ejc.287.2022.12.13.04.08.43; Tue, 13 Dec 2022 04:09:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235355AbiLMLvA (ORCPT + 74 others); Tue, 13 Dec 2022 06:51:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235361AbiLMLud (ORCPT ); Tue, 13 Dec 2022 06:50:33 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B922813E37; Tue, 13 Dec 2022 03:50:31 -0800 (PST) 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 1CFBE2F4; Tue, 13 Dec 2022 03:51:12 -0800 (PST) Received: from e126815.warwick.arm.com (e126815.arm.com [10.32.32.26]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id EE4863F5A1; Tue, 13 Dec 2022 03:50:29 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v2 4/4] perf test arm64: Add attr tests for new VG register Date: Tue, 13 Dec 2022 11:47:39 +0000 Message-Id: <20221213114739.2312862-5-james.clark@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221213114739.2312862-1-james.clark@arm.com> References: <20221213114739.2312862-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 Ensure that the availability of the VG register behaves as expected depending on the kernel version and SVE support. Signed-off-by: James Clark --- .../attr/test-record-user-regs-no-sve-aarch64 | 9 +++++++++ .../attr/test-record-user-regs-old-sve-aarch64 | 10 ++++++++++ .../tests/attr/test-record-user-regs-sve-aarch64 | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 create mode 100644 tools/perf/tests/attr/test-record-user-regs-old-sve-aarch64 create mode 100644 tools/perf/tests/attr/test-record-user-regs-sve-aarch64 diff --git a/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 new file mode 100644 index 000000000000..fbb065842880 --- /dev/null +++ b/tools/perf/tests/attr/test-record-user-regs-no-sve-aarch64 @@ -0,0 +1,9 @@ +# Test that asking for VG fails if the system doesn't support SVE. This +# applies both before and after the feature was added in 6.1 +[config] +command = record +args = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1 +ret = 129 +test_ret = true +arch = aarch64 +auxv = auxv["AT_HWCAP"] & 0x200000 == 0 diff --git a/tools/perf/tests/attr/test-record-user-regs-old-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-old-sve-aarch64 new file mode 100644 index 000000000000..15ebfc3418e3 --- /dev/null +++ b/tools/perf/tests/attr/test-record-user-regs-old-sve-aarch64 @@ -0,0 +1,10 @@ +# Test that asking for VG always fails on old kernels because it was +# added in 6.1. This applies to systems that either support or don't +# support SVE. +[config] +command = record +args = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1 +ret = 129 +test_ret = true +arch = aarch64 +kernel_until = 6.1 diff --git a/tools/perf/tests/attr/test-record-user-regs-sve-aarch64 b/tools/perf/tests/attr/test-record-user-regs-sve-aarch64 new file mode 100644 index 000000000000..c598c803221d --- /dev/null +++ b/tools/perf/tests/attr/test-record-user-regs-sve-aarch64 @@ -0,0 +1,14 @@ +# Test that asking for VG works if the system has SVE and after the +# feature was added in 6.1 +[config] +command = record +args = --no-bpf-event --user-regs=vg kill >/dev/null 2>&1 +ret = 1 +test_ret = true +arch = aarch64 +auxv = auxv["AT_HWCAP"] & 0x200000 == 0x200000 +kernel_since = 6.1 + +[event:base-record] +sample_type=4359 +sample_regs_user=70368744177664 -- 2.25.1