xref: /openbmc/linux/tools/testing/selftests/resctrl/README (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1034c7678SFenghua Yuresctrl_tests - resctrl file system test suit
2034c7678SFenghua Yu
3034c7678SFenghua YuAuthors:
4034c7678SFenghua Yu	Fenghua Yu <fenghua.yu@intel.com>
5034c7678SFenghua Yu	Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>,
6034c7678SFenghua Yu
7034c7678SFenghua Yuresctrl_tests tests various resctrl functionalities and interfaces including
8034c7678SFenghua Yuboth software and hardware.
9034c7678SFenghua Yu
10034c7678SFenghua YuCurrently it supports Memory Bandwidth Monitoring test and Memory Bandwidth
11034c7678SFenghua YuAllocation test on Intel RDT hardware. More tests will be added in the future.
12034c7678SFenghua YuAnd the test suit can be extended to cover AMD QoS and ARM MPAM hardware
13034c7678SFenghua Yuas well.
14034c7678SFenghua Yu
15*42e2f214SShaopeng Tanresctrl_tests can be run with or without kselftest framework.
16*42e2f214SShaopeng Tan
17*42e2f214SShaopeng TanWITH KSELFTEST FRAMEWORK
18*42e2f214SShaopeng Tan=======================
19*42e2f214SShaopeng Tan
20034c7678SFenghua YuBUILD
21034c7678SFenghua Yu-----
22034c7678SFenghua Yu
23*42e2f214SShaopeng TanBuild executable file "resctrl_tests" from top level directory of the kernel source:
24*42e2f214SShaopeng Tan $ make -C tools/testing/selftests TARGETS=resctrl
25034c7678SFenghua Yu
26034c7678SFenghua YuRUN
27034c7678SFenghua Yu---
28034c7678SFenghua Yu
29*42e2f214SShaopeng TanRun resctrl_tests as sudo or root since the test needs to mount resctrl file
30*42e2f214SShaopeng Tansystem and change contents in the file system.
31*42e2f214SShaopeng TanUsing kselftest framework will run all supported tests within resctrl_tests:
32034c7678SFenghua Yu
33*42e2f214SShaopeng Tan $ sudo make -C tools/testing/selftests TARGETS=resctrl run_tests
34*42e2f214SShaopeng Tan
35*42e2f214SShaopeng TanMore details about kselftest framework can be found in
36*42e2f214SShaopeng TanDocumentation/dev-tools/kselftest.rst.
37*42e2f214SShaopeng Tan
38*42e2f214SShaopeng TanWITHOUT KSELFTEST FRAMEWORK
39*42e2f214SShaopeng Tan===========================
40*42e2f214SShaopeng Tan
41*42e2f214SShaopeng TanBUILD
42*42e2f214SShaopeng Tan-----
43*42e2f214SShaopeng Tan
44*42e2f214SShaopeng TanBuild executable file "resctrl_tests" from this directory(tools/testing/selftests/resctrl/):
45*42e2f214SShaopeng Tan  $ make
46*42e2f214SShaopeng Tan
47*42e2f214SShaopeng TanRUN
48*42e2f214SShaopeng Tan---
49*42e2f214SShaopeng Tan
50*42e2f214SShaopeng TanRun resctrl_tests as sudo or root since the test needs to mount resctrl file
51*42e2f214SShaopeng Tansystem and change contents in the file system.
52034c7678SFenghua YuExecuting the test without any parameter will run all supported tests:
53034c7678SFenghua Yu
54*42e2f214SShaopeng Tan $ sudo ./resctrl_tests
55034c7678SFenghua Yu
56034c7678SFenghua YuOVERVIEW OF EXECUTION
57*42e2f214SShaopeng Tan=====================
58034c7678SFenghua Yu
59034c7678SFenghua YuA test case has four stages:
60034c7678SFenghua Yu
61034c7678SFenghua Yu  - setup: mount resctrl file system, create group, setup schemata, move test
62034c7678SFenghua Yu    process pids to tasks, start benchmark.
63034c7678SFenghua Yu  - execute: let benchmark run
64034c7678SFenghua Yu  - verify: get resctrl data and verify the data with another source, e.g.
65034c7678SFenghua Yu    perf event.
66034c7678SFenghua Yu  - teardown: umount resctrl and clear temporary files.
67034c7678SFenghua Yu
68034c7678SFenghua YuARGUMENTS
69*42e2f214SShaopeng Tan=========
70034c7678SFenghua Yu
71034c7678SFenghua YuParameter '-h' shows usage information.
72034c7678SFenghua Yu
73034c7678SFenghua Yuusage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits]
742f320911SFenghua Yu        -b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT default benchmark is builtin fill_buf
752f320911SFenghua Yu        -t test list: run tests specified in the test list, e.g. -t mbm,mba,cmt,cat
76034c7678SFenghua Yu        -n no_of_bits: run cache tests using specified no of bits in cache bit mask
77034c7678SFenghua Yu        -p cpu_no: specify CPU number to run the test. 1 is default
78034c7678SFenghua Yu        -h: help
79