diff options
| author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2023-12-15 17:04:52 +0200 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-02-13 13:56:43 -0700 |
| commit | 24be05591fb7a2a3edd639092c045298dd57aeea (patch) | |
| tree | 54e63e6eb0dd6fa433a2f35507f2e2ad61517b78 /tools/testing/selftests/resctrl/resctrl.h | |
| parent | f8f669699977db503569465b64dc5220ab21bb41 (diff) | |
| download | linux-24be05591fb7a2a3edd639092c045298dd57aeea.tar.gz linux-24be05591fb7a2a3edd639092c045298dd57aeea.zip | |
selftests/resctrl: Refactor fill_buf functions
There are unnecessary nested calls in fill_buf.c:
- run_fill_buf() calls fill_cache()
- alloc_buffer() calls malloc_and_init_memory()
Simplify the code flow and remove those unnecessary call levels by
moving the called code inside the calling function and remove the
duplicated error print.
Resolve the difference in run_fill_buf() and fill_cache() parameter
name into 'buf_size' which is more descriptive than 'span'. Also, while
moving the allocation related code, rename 'p' into 'buf' to be
consistent in naming the variables.
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>
Diffstat (limited to 'tools/testing/selftests/resctrl/resctrl.h')
| -rw-r--r-- | tools/testing/selftests/resctrl/resctrl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index dd3546655657..a848e9c75578 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -91,7 +91,7 @@ int write_bm_pid_to_resctrl(pid_t bm_pid, char *ctrlgrp, char *mongrp, char *resctrl_val); int perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags); -int run_fill_buf(size_t span, int memflush, int op, bool once); +int run_fill_buf(size_t buf_size, int memflush, int op, bool once); int resctrl_val(const char * const *benchmark_cmd, struct resctrl_val_param *param); int mbm_bw_change(int cpu_no, const char * const *benchmark_cmd); void tests_cleanup(void); |
