From: Catalin Marinas <catalin.marinas@arm.com>
To: Jeremy Szu <jszu@nvidia.com>
Cc: will@kernel.org, linux-arm-kernel@lists.infradead.org,
james.clark@arm.com, bwicaksono@nvidia.com,
Suzuki K Poulose <Suzuki.Poulose@arm.com>
Subject: Re: [PATCH] kselftest/arm64: Add coresight test
Date: Thu, 11 Jul 2024 19:03:18 +0100 [thread overview]
Message-ID: <ZpAeZjNJLesSJqm1@arm.com> (raw)
In-Reply-To: <20240710062732.18999-1-jszu@nvidia.com>
On Wed, Jul 10, 2024 at 02:27:32PM +0800, Jeremy Szu wrote:
> Add a script to test the coresight functionalities by performing the
> perf test 'coresight'.
>
> The script checks the prerequisites and launches a bundle of
> Coresight-related tests with a 180-second timeout.
>
> Signed-off-by: Jeremy Szu <jszu@nvidia.com>
I have not idea how to test coresight, so adding Suzuki as well.
> ---
> tools/testing/selftests/arm64/Makefile | 2 +-
> .../selftests/arm64/coresight/Makefile | 5 +++
> .../selftests/arm64/coresight/coresight.sh | 40 +++++++++++++++++++
> .../selftests/arm64/coresight/settings | 1 +
> 4 files changed, 47 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/arm64/coresight/Makefile
> create mode 100755 tools/testing/selftests/arm64/coresight/coresight.sh
> create mode 100644 tools/testing/selftests/arm64/coresight/settings
>
> diff --git a/tools/testing/selftests/arm64/Makefile b/tools/testing/selftests/arm64/Makefile
> index 28b93cab8c0dd..2b788d7bab22d 100644
> --- a/tools/testing/selftests/arm64/Makefile
> +++ b/tools/testing/selftests/arm64/Makefile
> @@ -4,7 +4,7 @@
> ARCH ?= $(shell uname -m 2>/dev/null || echo not)
>
> ifneq (,$(filter $(ARCH),aarch64 arm64))
> -ARM64_SUBTARGETS ?= tags signal pauth fp mte bti abi
> +ARM64_SUBTARGETS ?= tags signal pauth fp mte bti abi coresight
> else
> ARM64_SUBTARGETS :=
> endif
> diff --git a/tools/testing/selftests/arm64/coresight/Makefile b/tools/testing/selftests/arm64/coresight/Makefile
> new file mode 100644
> index 0000000000000..1cc8c1f2a997e
> --- /dev/null
> +++ b/tools/testing/selftests/arm64/coresight/Makefile
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +TEST_PROGS := coresight.sh
> +
> +include ../../lib.mk
> diff --git a/tools/testing/selftests/arm64/coresight/coresight.sh b/tools/testing/selftests/arm64/coresight/coresight.sh
> new file mode 100755
> index 0000000000000..e550957cf593b
> --- /dev/null
> +++ b/tools/testing/selftests/arm64/coresight/coresight.sh
> @@ -0,0 +1,40 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +
> +skip() {
> + echo "SKIP: $1"
> + exit 4
> +}
> +
> +fail() {
> + echo "FAIL: $1"
> + exit 255
> +}
> +
> +is_coresight_supported() {
> + if [ -d "/sys/bus/coresight/devices" ]; then
> + return 0
> + fi
> + return 255
> +}
> +
> +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
> + [ "$(id -u)" -ne 0 ] && \
> + skip "this test must be run as root."
> + which perf >/dev/null 2>&1 || \
> + skip "perf is not installed."
> + perf test list 2>&1 | grep -qi 'coresight' || \
> + skip "perf doesn't support testing coresight."
> + is_coresight_supported || \
> + skip "coresight is not supported."
> +
> + cmd_output=$(perf test -vv 'coresight' 2>&1)
> + perf_ret=$?
> +
> + if [ $perf_ret -ne 0 ]; then
> + fail "perf command returns non-zero."
> + elif [[ $cmd_output == *"FAILED!"* ]]; then
> + echo $cmd_output
> + fail "perf test 'arm coresight' test failed!"
> + fi
> +fi
> diff --git a/tools/testing/selftests/arm64/coresight/settings b/tools/testing/selftests/arm64/coresight/settings
> new file mode 100644
> index 0000000000000..a953c96aa16e1
> --- /dev/null
> +++ b/tools/testing/selftests/arm64/coresight/settings
> @@ -0,0 +1 @@
> +timeout=180
> --
> 2.34.1
--
Catalin
next prev parent reply other threads:[~2024-07-11 18:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 6:27 [PATCH] kselftest/arm64: Add coresight test Jeremy Szu
2024-07-11 18:03 ` Catalin Marinas [this message]
2024-07-12 9:01 ` James Clark
2024-07-16 2:06 ` Jeremy Szu
2024-07-17 14:48 ` James Clark
2024-07-19 10:21 ` Jeremy Szu
2024-07-19 10:59 ` James Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZpAeZjNJLesSJqm1@arm.com \
--to=catalin.marinas@arm.com \
--cc=Suzuki.Poulose@arm.com \
--cc=bwicaksono@nvidia.com \
--cc=james.clark@arm.com \
--cc=jszu@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).