linux/tools/testing/selftests/resctrl
Ilpo Järvinen b60187f610 selftests/resctrl: Move _GNU_SOURCE define into Makefile
[ Upstream commit 3a1e4a91aa ]

_GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE has a large
impact on what gets defined when including headers either before or
after it. This can result in compile failures if .c file decides to
include a standard header file before resctrl.h.

It is safer to define _GNU_SOURCE in Makefile so it is always defined
regardless of in which order includes are done.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-12-08 08:48:04 +01:00
..
.gitignore selftests/resctrl: Create .gitignore to include resctrl_tests 2021-04-02 13:58:42 -06:00
cache.c selftests/resctrl: Close perf value read fd on errors 2023-09-19 12:22:31 +02:00
cat_test.c selftests/resctrl: Allow ->setup() to return errors 2023-05-11 23:00:19 +09:00
cmt_test.c selftests/resctrl: Remove duplicate feature check from CMT test 2023-11-28 16:56:30 +00:00
config selftests/resctrl: Add config dependencies 2021-04-02 13:57:42 -06:00
fill_buf.c selftests/resctrl: Don't leak buffer in fill_cache() 2023-09-19 12:22:31 +02:00
Makefile selftests/resctrl: Move _GNU_SOURCE define into Makefile 2023-12-08 08:48:04 +01:00
mba_test.c selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests 2023-11-28 16:56:30 +00:00
mbm_test.c selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests 2023-11-28 16:56:30 +00:00
README selftests/resctrl: Fix incorrect parsing of option "-t" 2021-06-07 18:38:58 -06:00
resctrl.h selftests/resctrl: Move _GNU_SOURCE define into Makefile 2023-12-08 08:48:04 +01:00
resctrl_tests.c selftests/resctrl: Ensure the benchmark commands fits to its array 2023-11-20 11:08:22 +01:00
resctrl_val.c selftests/resctrl: Allow ->setup() to return errors 2023-05-11 23:00:19 +09:00
resctrlfs.c selftests/resctrl: Extend CPU vendor detection 2023-05-11 23:00:19 +09: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.

BUILD
-----

Run "make" to build executable file "resctrl_tests".

RUN
---

To use resctrl_tests, root or sudoer privileges are required. This is because
the test needs to mount resctrl file system and change contents in the file
system.

Executing the test without any parameter will run all supported tests:

	sudo ./resctrl_tests

OVERVIEW OF EXECUTION
---------------------

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
---------

Parameter '-h' shows usage information.

usage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits]
        -b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT default benchmark is builtin fill_buf
        -t test list: run tests specified in the test list, e.g. -t mbm,mba,cmt,cat
        -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