]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: Add test_cpucg_stats() testcase to cgroup cpu selftests
authorDavid Vernet <void@manifault.com>
Fri, 22 Apr 2022 17:33:51 +0000 (10:33 -0700)
committerTejun Heo <tj@kernel.org>
Fri, 22 Apr 2022 18:39:32 +0000 (08:39 -1000)
commit87b96fa7418ece8399c7ecbd0eba6e6eaaab2ec2
treec08614ef0ac6f46817fe5bc4e66bdf7d2e131b42
parent9e5dbc9ccc43c0b447c712c0f02abe3c7fd24638
cgroup: Add test_cpucg_stats() testcase to cgroup cpu selftests

test_cpu.c includes testcases that validate the cgroup cpu controller.
This patch adds a new testcase called test_cpucg_stats() that verifies the
expected behavior of the cpu.stat interface. In doing so, we define a
new hog_cpus_timed() function which takes a cpu_hog_func_param struct
that configures how many CPUs it uses, and how long it runs. Future
patches will also spawn threads that hog CPUs, so this function will
eventually serve those use-cases as well.

Signed-off-by: David Vernet <void@manifault.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/cgroup/cgroup_util.h
tools/testing/selftests/cgroup/test_cpu.c