Re: [PATCH v1 2/2] perf test: Add set of perf record LBR tests
From: Arnaldo Carvalho de Melo
Date: Thu Aug 08 2024 - 16:28:34 EST
On Thu, Aug 08, 2024 at 09:00:49AM -0700, Ian Rogers wrote:
> On Thu, Aug 8, 2024 at 7:34 AM Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
> [snip]
> > -if [ ! -f /sys/devices/cpu/caps/branches ]
> > +if [ ! -f /sys/devices/cpu/caps/branches -a ! -f /sys/devices/cpu_core/caps/branches ]
>
> Adding this lgtm, thanks for testing.
Changed to the one below to address a ShellCheck warning/suggestion.
diff --git a/tools/perf/tests/shell/record_lbr.sh b/tools/perf/tests/shell/record_lbr.sh
index ead87b731898d70b..32314641217e6db9 100755
--- a/tools/perf/tests/shell/record_lbr.sh
+++ b/tools/perf/tests/shell/record_lbr.sh
@@ -4,7 +4,7 @@
set -e
-if [ ! -f /sys/devices/cpu/caps/branches -a ! -f /sys/devices/cpu_core/caps/branches ]
+if [ ! -f /sys/devices/cpu/caps/branches ] && [ ! -f /sys/devices/cpu_core/caps/branches ]
then
echo "Skip: only x86 CPUs support LBR"
exit 2