selftests/resctrl: Split measure_cache_vals()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 15 Dec 2023 15:04:57 +0000 (17:04 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 13 Feb 2024 20:56:44 +0000 (13:56 -0700)
commita575c9734f3021f1fc81c2477ecaee4d9841fd59
tree376d0ba1f055c63bf64eedf11639089f673d0ba8
parentb6dfac948686799169c899557a179b84d0d1f47e
selftests/resctrl: Split measure_cache_vals()

measure_cache_vals() does a different thing depending on the test case
that called it:
  - For CAT, it measures LLC misses through perf.
  - For CMT, it measures LLC occupancy through resctrl.

Split these two functionalities into own functions the CAT and CMT
tests can call directly. Replace passing the struct resctrl_val_param
parameter with the filename because it's more generic and all those
functions need out of resctrl_val.

Co-developed-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-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/cache.c
tools/testing/selftests/resctrl/resctrl.h
tools/testing/selftests/resctrl/resctrl_val.c