2020-01-16 13:32:34 -08:00
|
|
|
resctrl_tests - resctrl file system test suit
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
Fenghua Yu <fenghua.yu@intel.com>
|
|
|
|
Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
|
|
|
|
|
|
|
|
resctrl_tests tests various resctrl functionalities and interfaces including
|
|
|
|
both software and hardware.
|
|
|
|
|
|
|
|
Currently it supports Memory Bandwidth Monitoring test and Memory Bandwidth
|
|
|
|
Allocation test on Intel RDT hardware. More tests will be added in the future.
|
|
|
|
And the test suit can be extended to cover AMD QoS and ARM MPAM hardware
|
|
|
|
as well.
|
|
|
|
|
2022-03-23 17:12:26 +09:00
|
|
|
resctrl_tests can be run with or without kselftest framework.
|
|
|
|
|
|
|
|
WITH KSELFTEST FRAMEWORK
|
|
|
|
=======================
|
|
|
|
|
2020-01-16 13:32:34 -08:00
|
|
|
BUILD
|
|
|
|
-----
|
|
|
|
|
2022-03-23 17:12:26 +09:00
|
|
|
Build executable file "resctrl_tests" from top level directory of the kernel source:
|
|
|
|
$ make -C tools/testing/selftests TARGETS=resctrl
|
2020-01-16 13:32:34 -08:00
|
|
|
|
|
|
|
RUN
|
|
|
|
---
|
|
|
|
|
2022-03-23 17:12:26 +09:00
|
|
|
Run resctrl_tests as sudo or root since the test needs to mount resctrl file
|
|
|
|
system and change contents in the file system.
|
|
|
|
Using kselftest framework will run all supported tests within resctrl_tests:
|
|
|
|
|
|
|
|
$ sudo make -C tools/testing/selftests TARGETS=resctrl run_tests
|
|
|
|
|
|
|
|
More details about kselftest framework can be found in
|
|
|
|
Documentation/dev-tools/kselftest.rst.
|
|
|
|
|
|
|
|
WITHOUT KSELFTEST FRAMEWORK
|
|
|
|
===========================
|
|
|
|
|
|
|
|
BUILD
|
|
|
|
-----
|
|
|
|
|
|
|
|
Build executable file "resctrl_tests" from this directory(tools/testing/selftests/resctrl/):
|
|
|
|
$ make
|
|
|
|
|
|
|
|
RUN
|
|
|
|
---
|
2020-01-16 13:32:34 -08:00
|
|
|
|
2022-03-23 17:12:26 +09:00
|
|
|
Run resctrl_tests as sudo or root since the test needs to mount resctrl file
|
|
|
|
system and change contents in the file system.
|
2020-01-16 13:32:34 -08:00
|
|
|
Executing the test without any parameter will run all supported tests:
|
|
|
|
|
2022-03-23 17:12:26 +09:00
|
|
|
$ sudo ./resctrl_tests
|
2020-01-16 13:32:34 -08:00
|
|
|
|
|
|
|
OVERVIEW OF EXECUTION
|
2022-03-23 17:12:26 +09:00
|
|
|
=====================
|
2020-01-16 13:32:34 -08:00
|
|
|
|
|
|
|
A test case has four stages:
|
|
|
|
|
|
|
|
- setup: mount resctrl file system, create group, setup schemata, move test
|
|
|
|
process pids to tasks, start benchmark.
|
|
|
|
- execute: let benchmark run
|
|
|
|
- verify: get resctrl data and verify the data with another source, e.g.
|
|
|
|
perf event.
|
|
|
|
- teardown: umount resctrl and clear temporary files.
|
|
|
|
|
|
|
|
ARGUMENTS
|
2022-03-23 17:12:26 +09:00
|
|
|
=========
|
2020-01-16 13:32:34 -08:00
|
|
|
|
|
|
|
Parameter '-h' shows usage information.
|
|
|
|
|
|
|
|
usage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits]
|
selftests/resctrl: Rename CQM test as CMT test
CMT (Cache Monitoring Technology) [1] is a H/W feature that reports cache
occupancy of a process. resctrl selftest suite has a unit test to test CMT
for LLC but the test is named as CQM (Cache Quality Monitoring).
Furthermore, the unit test source file is named as cqm_test.c and several
functions, variables, comments, preprocessors and statements widely use
"cqm" as either suffix or prefix. This rampant misusage of CQM for CMT
might confuse someone who is newly looking at resctrl selftests because
this feature is named CMT in the Intel Software Developer's Manual.
Hence, rename all the occurrences (unit test source file name, functions,
variables, comments and preprocessors) of cqm with cmt.
[1] Please see Intel SDM, Volume 3, chapter 17 and section 18 for more
information on CMT: https://software.intel.com/content/www/us/en/develop/articles/intel-sdm.html
Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-03-17 02:22:41 +00:00
|
|
|
-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT default benchmark is builtin fill_buf
|
selftests/resctrl: Fix incorrect parsing of option "-t"
Resctrl test suite accepts command line argument "-t" to specify the
unit tests to run in the test list (e.g., -t mbm,mba,cmt,cat) as
documented in the help.
When calling strtok() to parse the option, the incorrect delimiters
argument ":\t" is used. As a result, passing "-t mbm,mba,cmt,cat" throws
an invalid option error.
Fix this by using delimiters argument "," instead of ":\t" for parsing
of unit tests list. At the same time, remove the unnecessary "spaces"
between the unit tests in help documentation to prevent confusion.
Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest")
Fixes: 78941183d1b1 ("selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest")
Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
Fixes: 034c7678dd2c ("selftests/resctrl: Add README for resctrl tests")
Cc: stable@vger.kernel.org
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-05-27 17:31:53 +08:00
|
|
|
-t test list: run tests specified in the test list, e.g. -t mbm,mba,cmt,cat
|
2020-01-16 13:32:34 -08:00
|
|
|
-n no_of_bits: run cache tests using specified no of bits in cache bit mask
|
|
|
|
-p cpu_no: specify CPU number to run the test. 1 is default
|
|
|
|
-h: help
|