162306a36Sopenharmony_ciresctrl_tests - resctrl file system test suit 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciAuthors: 462306a36Sopenharmony_ci Fenghua Yu <fenghua.yu@intel.com> 562306a36Sopenharmony_ci Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>, 662306a36Sopenharmony_ci 762306a36Sopenharmony_ciresctrl_tests tests various resctrl functionalities and interfaces including 862306a36Sopenharmony_ciboth software and hardware. 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ciCurrently it supports Memory Bandwidth Monitoring test and Memory Bandwidth 1162306a36Sopenharmony_ciAllocation test on Intel RDT hardware. More tests will be added in the future. 1262306a36Sopenharmony_ciAnd the test suit can be extended to cover AMD QoS and ARM MPAM hardware 1362306a36Sopenharmony_cias well. 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciresctrl_tests can be run with or without kselftest framework. 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ciWITH KSELFTEST FRAMEWORK 1862306a36Sopenharmony_ci======================= 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ciBUILD 2162306a36Sopenharmony_ci----- 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ciBuild executable file "resctrl_tests" from top level directory of the kernel source: 2462306a36Sopenharmony_ci $ make -C tools/testing/selftests TARGETS=resctrl 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ciRUN 2762306a36Sopenharmony_ci--- 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ciRun resctrl_tests as sudo or root since the test needs to mount resctrl file 3062306a36Sopenharmony_cisystem and change contents in the file system. 3162306a36Sopenharmony_ciUsing kselftest framework will run all supported tests within resctrl_tests: 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci $ sudo make -C tools/testing/selftests TARGETS=resctrl run_tests 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ciMore details about kselftest framework can be found in 3662306a36Sopenharmony_ciDocumentation/dev-tools/kselftest.rst. 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ciWITHOUT KSELFTEST FRAMEWORK 3962306a36Sopenharmony_ci=========================== 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ciBUILD 4262306a36Sopenharmony_ci----- 4362306a36Sopenharmony_ci 4462306a36Sopenharmony_ciBuild executable file "resctrl_tests" from this directory(tools/testing/selftests/resctrl/): 4562306a36Sopenharmony_ci $ make 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ciRUN 4862306a36Sopenharmony_ci--- 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ciRun resctrl_tests as sudo or root since the test needs to mount resctrl file 5162306a36Sopenharmony_cisystem and change contents in the file system. 5262306a36Sopenharmony_ciExecuting the test without any parameter will run all supported tests: 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci $ sudo ./resctrl_tests 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ciOVERVIEW OF EXECUTION 5762306a36Sopenharmony_ci===================== 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ciA test case has four stages: 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci - setup: mount resctrl file system, create group, setup schemata, move test 6262306a36Sopenharmony_ci process pids to tasks, start benchmark. 6362306a36Sopenharmony_ci - execute: let benchmark run 6462306a36Sopenharmony_ci - verify: get resctrl data and verify the data with another source, e.g. 6562306a36Sopenharmony_ci perf event. 6662306a36Sopenharmony_ci - teardown: umount resctrl and clear temporary files. 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciARGUMENTS 6962306a36Sopenharmony_ci========= 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ciParameter '-h' shows usage information. 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ciusage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits] 7462306a36Sopenharmony_ci -b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT default benchmark is builtin fill_buf 7562306a36Sopenharmony_ci -t test list: run tests specified in the test list, e.g. -t mbm,mba,cmt,cat 7662306a36Sopenharmony_ci -n no_of_bits: run cache tests using specified no of bits in cache bit mask 7762306a36Sopenharmony_ci -p cpu_no: specify CPU number to run the test. 1 is default 7862306a36Sopenharmony_ci -h: help 79