Messages in this thread Patch in this message | | | Date | Fri, 30 Sep 2022 12:27:22 +0530 | From | Ravi Bangoria <> | Subject | Re: [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
| |