From: Ravi Bangoria <ravi.bangoria@amd.com>
To: Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@amd.com>,
Ingo Molnar <mingo@redhat.com>,
Stephane Eranian <eranian@google.com>,
Ian Rogers <irogers@google.com>,
"Kan Liang" <kan.liang@linux.intel.com>,
James Clark <james.clark@linaro.org>, "Leo Yan" <leo.yan@arm.com>,
Joe Mario <jmario@redhat.com>, <linux-kernel@vger.kernel.org>,
<linux-perf-users@vger.kernel.org>,
"Santosh Shukla" <santosh.shukla@amd.com>,
Ananth Narayan <ananth.narayan@amd.com>,
Sandipan Das <sandipan.das@amd.com>
Subject: [PATCH 3/4] perf test amd: Add IBS load/store swfilt tests
Date: Thu, 29 May 2025 12:34:55 +0000 [thread overview]
Message-ID: <20250529123456.1801-4-ravi.bangoria@amd.com> (raw)
In-Reply-To: <20250529123456.1801-1-ravi.bangoria@amd.com>
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@amd.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
next prev parent reply other threads:[~2025-05-29 12:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 12:34 [PATCH 0/4] perf/amd/ibs: Introduce load/store SW filter Ravi Bangoria
2025-05-29 12:34 ` [PATCH 1/4] perf/amd/ibs: Add load/store SW filters to IBS OP PMU Ravi Bangoria
2025-05-31 7:53 ` Ingo Molnar
2025-06-03 6:52 ` Namhyung Kim
2025-06-10 5:12 ` Ravi Bangoria
2025-05-29 12:34 ` [PATCH 2/4] perf mem/c2c amd: Wire IBS OP PMU load/store SW filter Ravi Bangoria
2025-05-29 12:34 ` Ravi Bangoria [this message]
2025-05-29 12:34 ` [PATCH 4/4] perf doc amd: Update perf-amd-ibs man page Ravi Bangoria
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=20250529123456.1801-4-ravi.bangoria@amd.com \
--to=ravi.bangoria@amd.com \
--cc=acme@kernel.org \
--cc=ananth.narayan@amd.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jmario@redhat.com \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=sandipan.das@amd.com \
--cc=santosh.shukla@amd.com \
/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
all inboxes | Powered by JetHome®