[PATCH v2 4/4] perf tests: Remove dependency on lscpu
From: James Clark
Date: Wed Apr 10 2024 - 06:36:45 EST
This check can be done with uname which is more portable. At the same
time re-arrange it into a standard if statement so that it's more
readable.
Signed-off-by: James Clark <james.clark@xxxxxxx>
---
tools/perf/tests/shell/test_arm_callgraph_fp.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/tests/shell/test_arm_callgraph_fp.sh b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
index 83b53591b1ea..61898e256616 100755
--- a/tools/perf/tests/shell/test_arm_callgraph_fp.sh
+++ b/tools/perf/tests/shell/test_arm_callgraph_fp.sh
@@ -6,7 +6,9 @@ shelldir=$(dirname "$0")
# shellcheck source=lib/perf_has_symbol.sh
. "${shelldir}"/lib/perf_has_symbol.sh
-lscpu | grep -q "aarch64" || exit 2
+if [ "$(uname -m)" != "aarch64" ]; then
+ exit 2
+fi
if perf version --build-options | grep HAVE_DWARF_UNWIND_SUPPORT | grep -q OFF
then
--
2.34.1