From: Shuah Khan <skhan@linuxfoundation.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>,
John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <sboyd@kernel.org>,
Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Shuah Khan <shuah@kernel.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 resend] selftests: timers: clocksource-switch: Adapt progress to kselftest framework
Date: Mon, 16 Dec 2024 16:08:19 -0700 [thread overview]
Message-ID: <16657ef3-72e5-4da3-8785-9f4391cc0002@linuxfoundation.org> (raw)
In-Reply-To: <7dd4b9ab6e43268846e250878ebf25ae6d3d01ce.1733994134.git.geert+renesas@glider.be>
On 12/12/24 02:02, Geert Uytterhoeven wrote:
> When adapting the test to the kselftest framework, a few printf() calls
> indicating test progress were not updated.
>
> Fix this by replacing these printf() calls by ksft_print_msg() calls.
>
> Fixes: ce7d101750ff8450 ("selftests: timers: clocksource-switch: adapt to kselftest framework")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
> ---
> v2:
> - Add Reviewed-by.
>
> When just running the test, the output looks like:
>
> # Validating clocksource arch_sys_counter
> TAP version 13
> 1..12
> ok 1 CLOCK_REALTIME
> ...
> # Validating clocksource ffca0000.timer
> TAP version 13
> 1..12
> ok 1 CLOCK_REALTIME
> ...
>
> When redirecting the test output to a file, the progress prints are not
> interspersed with the test output, but collated at the end:
>
> TAP version 13
> 1..12
> ok 1 CLOCK_REALTIME
> ...
> TAP version 13
> 1..12
> ok 1 CLOCK_REALTIME
> ...
> # Totals: pass:6 fail:0 xfail:0 xpass:0 skip:6 error:0
> # Validating clocksource arch_sys_counter
> # Validating clocksource ffca0000.timer
> ...
>
> This makes it hard to match the test results with the timer under test.
> Is there a way to fix this? The test does use fork().
>
> Thanks!
> ---
> tools/testing/selftests/timers/clocksource-switch.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/timers/clocksource-switch.c b/tools/testing/selftests/timers/clocksource-switch.c
> index c5264594064c8516..83faa4e354e389c2 100644
> --- a/tools/testing/selftests/timers/clocksource-switch.c
> +++ b/tools/testing/selftests/timers/clocksource-switch.c
> @@ -156,8 +156,8 @@ int main(int argc, char **argv)
> /* Check everything is sane before we start switching asynchronously */
> if (do_sanity_check) {
> for (i = 0; i < count; i++) {
> - printf("Validating clocksource %s\n",
> - clocksource_list[i]);
> + ksft_print_msg("Validating clocksource %s\n",
> + clocksource_list[i]);
> if (change_clocksource(clocksource_list[i])) {
> status = -1;
> goto out;
> @@ -169,7 +169,7 @@ int main(int argc, char **argv)
> }
> }
>
> - printf("Running Asynchronous Switching Tests...\n");
> + ksft_print_msg("Running Asynchronous Switching Tests...\n");
> pid = fork();
> if (!pid)
> return run_tests(runtime);
Applied to linux-kselftest next for Linux 6.14-rc1.
thanks,
-- Shuah
prev parent reply other threads:[~2024-12-16 23:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-12 9:02 [PATCH v2 resend] selftests: timers: clocksource-switch: Adapt progress to kselftest framework Geert Uytterhoeven
2024-12-16 23:08 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16657ef3-72e5-4da3-8785-9f4391cc0002@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=anna-maria@linutronix.de \
--cc=frederic@kernel.org \
--cc=geert+renesas@glider.be \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=shuah@kernel.org \
--cc=tglx@linutronix.de \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox