[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250529123456.1801-4-ravi.bangoria@amd.com>
Date: Thu, 29 May 2025 12:34:55 +0000
From: Ravi Bangoria <ravi.bangoria@....com>
To: Peter Zijlstra <peterz@...radead.org>, Arnaldo Carvalho de Melo
<acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>
CC: Ravi Bangoria <ravi.bangoria@....com>, Ingo Molnar <mingo@...hat.com>,
Stephane Eranian <eranian@...gle.com>, Ian Rogers <irogers@...gle.com>, "Kan
Liang" <kan.liang@...ux.intel.com>, James Clark <james.clark@...aro.org>,
"Leo Yan" <leo.yan@....com>, Joe Mario <jmario@...hat.com>,
<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>, "Santosh
Shukla" <santosh.shukla@....com>, Ananth Narayan <ananth.narayan@....com>,
Sandipan Das <sandipan.das@....com>
Subject: [PATCH 3/4] perf test amd: Add IBS load/store swfilt tests
Add basic sanity tests for load-only, store-only and load-store-only
sampling with IBS OP PMU.
Signed-off-by: Ravi Bangoria <ravi.bangoria@....com>
---
tools/perf/tests/shell/amd-ibs-swfilt.sh | 26 ++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/tools/perf/tests/shell/amd-ibs-swfilt.sh b/tools/perf/tests/shell/amd-ibs-swfilt.sh
index 83937aa687cc..bc052a36a9b4 100755
--- a/tools/perf/tests/shell/amd-ibs-swfilt.sh
+++ b/tools/perf/tests/shell/amd-ibs-swfilt.sh
@@ -65,3 +65,29 @@ if [ ${user_sample} -ne 0 ]; then
echo "[FAIL] unexpected user samples: " ${user_sample}
exit 1
fi
+
+echo "test load/store swfilt"
+
+# load/store swfil
+if [ -f /sys/bus/event_source/devices/ibs_op/caps/swfilt_ldst ]; then
+ # test load only sampling
+ non_load_sample=$(perf record -e ibs_op/swfilt=1,ldop=1/ --raw-samples -o- perf test -w sqrtloop | perf script -D -i- | grep -c "LdOp 0")
+ if [ ${non_load_sample} -ne 0 ]; then
+ echo "[FAIL] unexpected non-load samples: " ${non_load_sample}
+ exit 1;
+ fi
+
+ # test store only sampling
+ non_store_sample=$(perf record -e ibs_op/swfilt=1,stop=1/ --raw-samples -o- perf test -w sqrtloop | perf script -D -i- | grep -c "StOp 0")
+ if [ ${non_store_sample} -ne 0 ]; then
+ echo "[FAIL] unexpected non-store samples: " ${non_store_sample}
+ exit 1;
+ fi
+
+ # test load/store only sampling
+ non_load_store_sample=$(perf record -e ibs_op/swfilt=1,ldop=1,stop=1/ --raw-samples -o- perf test -w sqrtloop | perf script -D -i- | grep -c "LdOp 0 StOp 0")
+ if [ ${non_load_store_sample} -ne 0 ]; then
+ echo "[FAIL] unexpected non-load/store samples: " ${non_load_store_sample}
+ exit 1;
+ fi
+fi
--
2.43.0
Powered by blists - more mailing lists