Re: [PATCH v2 0/2] selftests: add option to print the time spent per test
From: Ricardo B. Marlière
Date: Tue Dec 01 2026 - 17:32:04 EST
On Fri Nov 20, 2026 at 8:25 AM -03, Jori Koolstra (CIQ) wrote:
> For CI/CD purposes it is useful to know how much time each selftest
> took to complete, for instance, to know which suites to run for a
> quick-fail diagnostic, or what percentage of tests you can expect to
> complete on a paricular --override-timeout value.
>
> Add a -T/--timed option to run_kselftest.sh. When it is set, run_one()
> prints a KTAP diagnostic line with the elapsed wall-clock time just
> before the result line of each test that is actually run, e.g.:
>
> # selftests: timers: nanosleep
> # time: 12.34s
> ok 3 selftests: timers: nanosleep
>
> The other patch of runner.sh fixes a bug when using --netns in
> run_kselftest.sh.
>
> Signed-off-by: Jori Koolstra (CIQ) <jkoolstra@xxxxxxxxx>
> ---
> Changes in v2:
> - Dropped convention change from the series (as Shuah requested)
> - Link to v1: https://lore.kernel.org/r/20261118-kselftest-run-timer-v1-0-53a838b2d62b@xxxxxxxxx
>
> ---
> Jori Koolstra (CIQ) (2):
> selftests: pass the timeout override to tests run in a netns
> selftests: add option to print the time spent per test
>
> tools/testing/selftests/kselftest/runner.sh | 21 +++++++++++++++++++++
> tools/testing/selftests/run_kselftest.sh | 8 ++++++++
> 2 files changed, 29 insertions(+)
For the series,
Reviewed-by: Ricardo B. Marlière (SUSE) <ricardo@xxxxxxxxxxxx>
Thanks!
> ---
> base-commit: 65e4fd942f72a9dba0e4e257290c4fa1aa756854
> change-id: 20261117-kselftest-run-timer-df3ac531652e
>
> Best regards,