selftests/resctrl: Print accurate buffer size as part of MBM results
authorReinette Chatre <reinette.chatre@intel.com>
Thu, 24 Oct 2024 21:18:39 +0000 (14:18 -0700)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 5 Nov 2024 00:02:02 +0000 (17:02 -0700)
commit1b4840395f08e9723a15fea42c2d31090e8375f3
tree605eb7e2edaaf99f3233098e12b48aa459acb80e
parent18f5744e8200e3c2bfeb896d6d3c10c3f0946318
selftests/resctrl: Print accurate buffer size as part of MBM results

By default the MBM test uses the "fill_buf" benchmark to keep reading
from a buffer with size DEFAULT_SPAN while measuring memory bandwidth.
User space can provide an alternate benchmark or amend the size of
the buffer "fill_buf" should use.

Analysis of the MBM measurements do not require that a buffer be used
and thus do not require knowing the size of the buffer if it was used
during testing. Even so, the buffer size is printed as informational
as part of the MBM test results. What is printed as buffer size is
hardcoded as DEFAULT_SPAN, even if the test relied on another benchmark
(that may or may not use a buffer) or if user space amended the buffer
size.

Ensure that accurate buffer size is printed when using "fill_buf"
benchmark and omit the buffer size information if another benchmark
is used.

Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/mbm_test.c