]> 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)
commit85b98ef3a3f7afebed5d7dd609c0ad400dc612f4
treec08614ef0ac6f46817fe5bc4e66bdf7d2e131b42
parent443ef5dd22ebc96b489e1e76e9addae97367eba9
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