All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] selftests/resctrl: Simplify test cleanup functions
@ 2024-02-27  7:21 Maciej Wieczor-Retman
  2024-02-27  7:21 ` [PATCH v5 1/3] selftests/resctrl: Add cleanup function to test framework Maciej Wieczor-Retman
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Maciej Wieczor-Retman @ 2024-02-27  7:21 UTC (permalink / raw)
  To: reinette.chatre, fenghua.yu, shuah
  Cc: linux-kselftest, linux-kernel, ilpo.jarvinen

Cleaning up after tests is implemented separately for individual tests
and called at the end of each test execution. Since these functions are
very similar and a more generalized test framework was introduced a
function pointer in the resctrl_test struct can be used to reduce the
amount of function calls.

These functions are also all called in the ctrl-c handler because the
handler isn't aware which test is currently running. Since the handler
is implemented with a sigaction no function parameters can be passed
there but information about what test is currently running can be passed
with a global variable.

Series applies cleanly on top of kselftests/next.

Changelog v5:
- Rebase onto kselftests/next.
- Add Reinette's reviewed-by tag.

Changelog v4:
- Check current_test pointer and reset it in signal unregistering.
- Move cleanup call to test_cleanup function.

Changelog v3:
- Make current_test static.
- Add callback NULL check to the ctrl-c handler.

Changelog v2:
- Make current_test a const pointer limited in scope to resctrl_val
  file.
- Remove tests_cleanup from resctrl.h.
- Cleanup 'goto out' path and labels in individual test functions.

Older versions of this series:
[v1] https://lore.kernel.org/all/cover.1708434017.git.maciej.wieczor-retman@intel.com/
[v2] https://lore.kernel.org/all/cover.1708596015.git.maciej.wieczor-retman@intel.com/
[v3] https://lore.kernel.org/all/cover.1708599491.git.maciej.wieczor-retman@intel.com/
[v4] https://lore.kernel.org/all/cover.1708949785.git.maciej.wieczor-retman@intel.com/

Maciej Wieczor-Retman (3):
  selftests/resctrl: Add cleanup function to test framework
  selftests/resctrl: Simplify cleanup in ctrl-c handler
  selftests/resctrl: Move cleanups out of individual tests

 tools/testing/selftests/resctrl/cat_test.c    |  8 +++-----
 tools/testing/selftests/resctrl/cmt_test.c    |  4 ++--
 tools/testing/selftests/resctrl/mba_test.c    |  8 +++-----
 tools/testing/selftests/resctrl/mbm_test.c    |  8 +++-----
 tools/testing/selftests/resctrl/resctrl.h     |  9 +++------
 .../testing/selftests/resctrl/resctrl_tests.c | 20 +++++++------------
 tools/testing/selftests/resctrl/resctrl_val.c |  8 ++++++--
 7 files changed, 27 insertions(+), 38 deletions(-)

-- 
2.43.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-28 20:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27  7:21 [PATCH v5 0/3] selftests/resctrl: Simplify test cleanup functions Maciej Wieczor-Retman
2024-02-27  7:21 ` [PATCH v5 1/3] selftests/resctrl: Add cleanup function to test framework Maciej Wieczor-Retman
2024-02-27  7:21 ` [PATCH v5 2/3] selftests/resctrl: Simplify cleanup in ctrl-c handler Maciej Wieczor-Retman
2024-02-27  7:21 ` [PATCH v5 3/3] selftests/resctrl: Move cleanups out of individual tests Maciej Wieczor-Retman
2024-02-27 12:49 ` [PATCH v5 0/3] selftests/resctrl: Simplify test cleanup functions Ilpo Järvinen
2024-02-27 16:36 ` Reinette Chatre
2024-03-27 23:08   ` Reinette Chatre
2024-03-28 19:25     ` Shuah Khan
2024-03-28 20:28       ` Reinette Chatre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.