lkml.org 
[lkml]   [2022]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH v3] perf test: Introduce script for data symbol testing
Hi Leo,

On 24-Sep-22 7:04 PM, Leo Yan wrote:
> This commit introduces a shell script for data symbol testing.
>
> The testing is designed a data structure with 64-byte alignment, it has
> two fields "data1" and "data2", and other fields are reserved.
>
> Using "perf mem" command, we can record and report memory samples for a
> self-contained workload with 1 second duration. If have no any memory
> sample for the data structure "buf1", it reports failure; and by
> checking the offset in structure "buf1", if any memory accessing is not
> for "data1" and "data2" fields, it means wrong data symbol parsing and
> returns failure.

I'm working on adding support for perf mem/c2c on AMD:
https://lore.kernel.org/lkml/20220928095805.596-1-ravi.bangoria%40amd.com

And this test fails on AMD because perf mem/c2c internally use IBS pmu
which does not support user/kernel filtering and per-process monitoring.
Would it be possible for you to add below (ugly) hunk to this patch:

---
diff --git a/tools/perf/tests/shell/test_data_symbol.sh b/tools/perf/tests/shell/test_data_symbol.sh
index a153b0d84dc0..212082951b12 100755
--- a/tools/perf/tests/shell/test_data_symbol.sh
+++ b/tools/perf/tests/shell/test_data_symbol.sh
@@ -71,7 +71,12 @@ int main(void) {
EOF

echo "Recording workload..."
-perf mem record --all-user -o ${PERF_DATA} -- $TEST_PROGRAM &
+is_amd=$(egrep -c 'vendor_id.*AuthenticAMD' /proc/cpuinfo)
+if (($is_amd >= 1)); then
+ perf mem record -o ${PERF_DATA} -- -C 0 -- taskset -c 0 $TEST_PROGRAM &
+else
+ perf mem record --all-user -o ${PERF_DATA} -- $TEST_PROGRAM &
+fi
PERFPID=$!

sleep 1
---
Thanks,
Ravi

\
 
 \ /
  Last update: 2022-09-30 08:58    [W:0.057 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site