diff options
author | Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com> | 2024-02-27 10:21:42 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-05-06 22:57:19 +0300 |
commit | e6487230e952cfd4070c61141f011608841f36eb (patch) | |
tree | 48810da77f1abda29a2a34e560476266797fb3e3 /tools/testing/selftests/resctrl/resctrl.h | |
parent | 8780bc88d4c86cdb7e9591bde9dd1110156a203b (diff) | |
download | linux-e6487230e952cfd4070c61141f011608841f36eb.tar.xz |
selftests/resctrl: Simplify cleanup in ctrl-c handler
Ctrl-c handler isn't aware of what test is currently running. Because of
that it executes all cleanups even if they aren't necessary. Since the
ctrl-c handler uses the sa_sigaction system no parameters can be passed
to it as function arguments.
Add a global variable to make ctrl-c handler aware of the currently run
test and only execute the correct cleanup callback.
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@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 | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 221c94532733..bc486f92aceb 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -158,7 +158,6 @@ int resctrl_val(const struct resctrl_test *test, const struct user_params *uparams, const char * const *benchmark_cmd, struct resctrl_val_param *param); -void tests_cleanup(void); void mbm_test_cleanup(void); void mba_test_cleanup(void); unsigned long create_bit_mask(unsigned int start, unsigned int len); @@ -168,7 +167,7 @@ int get_mask_no_shareable(const char *cache_type, unsigned long *mask); int get_cache_size(int cpu_no, const char *cache_type, unsigned long *cache_size); int resource_info_unsigned_get(const char *resource, const char *filename, unsigned int *val); void ctrlc_handler(int signum, siginfo_t *info, void *ptr); -int signal_handler_register(void); +int signal_handler_register(const struct resctrl_test *test); void signal_handler_unregister(void); void cat_test_cleanup(void); unsigned int count_bits(unsigned long n); |