selftests/resctrl: Add a helper for the non-contiguous test
authorMaciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Fri, 16 Feb 2024 08:35:15 +0000 (09:35 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 23 Feb 2024 22:19:09 +0000 (15:19 -0700)
commite331ac141f1df6d151d24e60ff16e93ec075509e
treea71c47954859aa43cafb27031e80cc7f3fea7c47
parent5339792bd64bd1605d3d51f8e52e94dfc385959b
selftests/resctrl: Add a helper for the non-contiguous test

The CAT non-contiguous selftests have to read the file responsible for
reporting support of non-contiguous CBMs in kernel (resctrl). Then the
test compares if that information matches what is reported by CPUID
output.

Add a generic helper function to read an unsigned number from
/sys/fs/resctrl/info/<RESOURCE>/<FILE>.

Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/resctrl.h
tools/testing/selftests/resctrl/resctrlfs.c