Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4202415rwb; Tue, 6 Sep 2022 04:17:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Xq9p26j/KvNUm74EB9BC3cMvYujc1qgpL/qJsIvYzF/6ADJLZC8TFVHOO6BdU0VN0bhVo X-Received: by 2002:a17:907:868b:b0:741:8f8c:6ab5 with SMTP id qa11-20020a170907868b00b007418f8c6ab5mr28193496ejc.194.1662463066872; Tue, 06 Sep 2022 04:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662463066; cv=none; d=google.com; s=arc-20160816; b=JeA0KNjRlkiYwArR2nvv1CRgYbA9MCWjq42LCs8egvtyWw0HLvD9xioTj7D1mrz8x9 MY5PtFt4SoP7FfYO8tdx/wquV09jFvvWgl/PO5G8+G7Zl1Rrhe1ZJiSCkT4rwOil/KuR K71e1rYnxxmEPfxcA0fDRDkYrV3hd+TaLEHW7UwdShJYXlqn4dbl4Sy0CiCUBPEFc7qa TYqjCz1bjmMiPzb+GBL762nw9GyjbrLBTtG/PGO5CO+k4W7VkOt1YeXRgTC4oi0rm99D 56QNg6xW9u7hNBq0x8oAqyncpAkDJBtwtpzv/bJ8M6qeQgkWLiwYGBJxlwanNRsfU7sd 7GeQ== 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=N+e//jsKxPxo0Cu7nuDRy/mRkKkeA5OiipNbPtE+sjc=; b=tBiJuMHeqPwmNDG0MhkXbRIk5VxIiCGbIWkAmeE2oQ53Rdz/VeYQ4/7y5Z3A2KYh81 wRq7dYtc4qv3CHUxzamD2D+/7jVgUcD6NQGpR/riv6EIx0mfj6WpBxmYr4EI3Et+4O9V DM0i1920WYj/C6cy40c3x2C0QLNeKInRGgwhWEAMI8W3mXXE75BKqdohxcXtqToE8+Cq a8Q8Ac5I9wwjd3LeuhmNUC77eyDn9G31q72vKhd57WSVVydGGgFGeuSXG3zRz2MLF+wv CYd672zXrVKFVn2DKYM6FoefKf1pse3vV7fnO1Gxxe/+FFHx5revKiKXC4Xx61/8OPVA hktg== 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 g9-20020a056402090900b00442296a8407si10295337edz.629.2022.09.06.04.17.20; Tue, 06 Sep 2022 04:17:46 -0700 (PDT) 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 S239847AbiIFKyq (ORCPT + 99 others); Tue, 6 Sep 2022 06:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239833AbiIFKx4 (ORCPT ); Tue, 6 Sep 2022 06:53:56 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B44AEE2; Tue, 6 Sep 2022 03:53:53 -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 03F99176C; Tue, 6 Sep 2022 03:44:00 -0700 (PDT) Received: from e126387.arm.com (unknown [10.57.15.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 845CB3F534; Tue, 6 Sep 2022 03:43:52 -0700 (PDT) From: carsten.haitzler@foss.arm.com To: linux-kernel@vger.kernel.org Cc: coresight@lists.linaro.org, suzuki.poulose@arm.com, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, linux-perf-users@vger.kernel.org, acme@kernel.org Subject: [PATCH v8 03/13] perf test: Add asm pureloop test tool Date: Tue, 6 Sep 2022 11:30:34 +0100 Message-Id: <20220906103044.761250-4-carsten.haitzler@foss.arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220906103044.761250-1-carsten.haitzler@foss.arm.com> References: <20220906103044.761250-1-carsten.haitzler@foss.arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 From: Carsten Haitzler Add test tool to be driven by further test scripts. This tool is pure arm64 ASM with no libc usage to ensure it is the same exact binary/code every time so it can also be re-used for many uses. It just loops for a given fixed number of loops. Signed-off-by: Carsten Haitzler --- tools/perf/tests/shell/coresight/Makefile | 3 +- .../shell/coresight/asm_pure_loop/.gitignore | 1 + .../shell/coresight/asm_pure_loop/Makefile | 34 +++++++++++++++++++ .../coresight/asm_pure_loop/asm_pure_loop.S | 28 +++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 tools/perf/tests/shell/coresight/asm_pure_loop/.gitignore create mode 100644 tools/perf/tests/shell/coresight/asm_pure_loop/Makefile create mode 100644 tools/perf/tests/shell/coresight/asm_pure_loop/asm_pure_loop.S diff --git a/tools/perf/tests/shell/coresight/Makefile b/tools/perf/tests/shell/coresight/Makefile index 3b816bb4ced3..d4f868d55773 100644 --- a/tools/perf/tests/shell/coresight/Makefile +++ b/tools/perf/tests/shell/coresight/Makefile @@ -4,7 +4,8 @@ include ../../../../../tools/scripts/Makefile.include include ../../../../../tools/scripts/Makefile.arch include ../../../../../tools/scripts/utilities.mak -SUBDIRS = +SUBDIRS = \ + asm_pure_loop all: $(SUBDIRS) $(SUBDIRS): diff --git a/tools/perf/tests/shell/coresight/asm_pure_loop/.gitignore b/tools/perf/tests/shell/coresight/asm_pure_loop/.gitignore new file mode 100644 index 000000000000..468673ac32e8 --- /dev/null +++ b/tools/perf/tests/shell/coresight/asm_pure_loop/.gitignore @@ -0,0 +1 @@ +asm_pure_loop diff --git a/tools/perf/tests/shell/coresight/asm_pure_loop/Makefile b/tools/perf/tests/shell/coresight/asm_pure_loop/Makefile new file mode 100644 index 000000000000..206849e92bc9 --- /dev/null +++ b/tools/perf/tests/shell/coresight/asm_pure_loop/Makefile @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: GPL-2.0 +# Carsten Haitzler , 2021 + +include ../Makefile.miniconfig + +# Binary to produce +BIN=asm_pure_loop +# Any linking/libraries needed for the binary - empty if none needed +LIB= + +all: $(BIN) + +$(BIN): $(BIN).S +ifdef CORESIGHT +ifeq ($(ARCH),arm64) +# Build line - this is raw asm with no libc to have an always exact binary + $(Q)$(CC) $(BIN).S -nostdlib -static -o $(BIN) $(LIB) +endif +endif + +install-tests: all +ifdef CORESIGHT +ifeq ($(ARCH),arm64) +# Install the test tool in the right place + $(call QUIET_INSTALL, tests) \ + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$(INSTDIR_SUB)/$(BIN)'; \ + $(INSTALL) $(BIN) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/$(INSTDIR_SUB)/$(BIN)/$(BIN)' +endif +endif + +clean: + $(Q)$(RM) -f $(BIN) + +.PHONY: all clean install-tests diff --git a/tools/perf/tests/shell/coresight/asm_pure_loop/asm_pure_loop.S b/tools/perf/tests/shell/coresight/asm_pure_loop/asm_pure_loop.S new file mode 100644 index 000000000000..75cf084a927d --- /dev/null +++ b/tools/perf/tests/shell/coresight/asm_pure_loop/asm_pure_loop.S @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Tamas Zsoldos , 2021 */ + +.globl _start +_start: + mov x0, 0x0000ffff + mov x1, xzr +loop: + nop + nop + cbnz x1, noskip + nop + nop + adrp x2, skip + add x2, x2, :lo12:skip + br x2 + nop + nop +noskip: + nop + nop +skip: + sub x0, x0, 1 + cbnz x0, loop + + mov x0, #0 + mov x8, #93 // __NR_exit syscall + svc #0 -- 2.32.0