-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf test: Add asm pureloop test tool
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. Reviewed-by: James Clark <james.clark@arm.com> Signed-off-by: Carsten Haitzler <carsten.haitzler@arm.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: Mike Leach <mike.leach@linaro.org> Cc: Suzuki Poulouse <suzuki.poulose@arm.com> Cc: coresight@lists.linaro.org Link: https://lore.kernel.org/r/20220909152803.2317006-4-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Loading branch information
Carsten Haitzler
authored and
Arnaldo Carvalho de Melo
committed
Oct 6, 2022
1 parent
34bec35
commit 8b97519
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
asm_pure_loop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# Carsten Haitzler <carsten.haitzler@arm.com>, 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 |
28 changes: 28 additions & 0 deletions
28
tools/perf/tests/shell/coresight/asm_pure_loop/asm_pure_loop.S
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* Tamas Zsoldos <tamas.zsoldos@arm.com>, 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 |