From: Paolo Bonzini <pbonzini@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, kvm@vger.kernel.org
Cc: Sean Christopherson <seanjc@google.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
Andrew Jones <drjones@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] selftests: kvm: make hardware_disable_test less verbose
Date: Fri, 26 Mar 2021 18:17:30 +0100 [thread overview]
Message-ID: <222fc568-399e-b3c4-5354-09169edcb78f@redhat.com> (raw)
In-Reply-To: <20210323104331.1354800-1-vkuznets@redhat.com>
On 23/03/21 11:43, Vitaly Kuznetsov wrote:
> hardware_disable_test produces 512 snippets like
> ...
> main: [511] waiting semaphore
> run_test: [511] start vcpus
> run_test: [511] all threads launched
> main: [511] waiting 368us
> main: [511] killing child
>
> and this doesn't have much value, let's print this info with pr_debug().
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> tools/testing/selftests/kvm/hardware_disable_test.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/hardware_disable_test.c b/tools/testing/selftests/kvm/hardware_disable_test.c
> index 2f2eeb8a1d86..5aadf84c91c0 100644
> --- a/tools/testing/selftests/kvm/hardware_disable_test.c
> +++ b/tools/testing/selftests/kvm/hardware_disable_test.c
> @@ -108,7 +108,7 @@ static void run_test(uint32_t run)
> kvm_vm_elf_load(vm, program_invocation_name, 0, 0);
> vm_create_irqchip(vm);
>
> - fprintf(stderr, "%s: [%d] start vcpus\n", __func__, run);
> + pr_debug("%s: [%d] start vcpus\n", __func__, run);
> for (i = 0; i < VCPU_NUM; ++i) {
> vm_vcpu_add_default(vm, i, guest_code);
> payloads[i].vm = vm;
> @@ -124,7 +124,7 @@ static void run_test(uint32_t run)
> check_set_affinity(throw_away, &cpu_set);
> }
> }
> - fprintf(stderr, "%s: [%d] all threads launched\n", __func__, run);
> + pr_debug("%s: [%d] all threads launched\n", __func__, run);
> sem_post(sem);
> for (i = 0; i < VCPU_NUM; ++i)
> check_join(threads[i], &b);
> @@ -147,16 +147,16 @@ int main(int argc, char **argv)
> if (pid == 0)
> run_test(i); /* This function always exits */
>
> - fprintf(stderr, "%s: [%d] waiting semaphore\n", __func__, i);
> + pr_debug("%s: [%d] waiting semaphore\n", __func__, i);
> sem_wait(sem);
> r = (rand() % DELAY_US_MAX) + 1;
> - fprintf(stderr, "%s: [%d] waiting %dus\n", __func__, i, r);
> + pr_debug("%s: [%d] waiting %dus\n", __func__, i, r);
> usleep(r);
> r = waitpid(pid, &s, WNOHANG);
> TEST_ASSERT(r != pid,
> "%s: [%d] child exited unexpectedly status: [%d]",
> __func__, i, s);
> - fprintf(stderr, "%s: [%d] killing child\n", __func__, i);
> + pr_debug("%s: [%d] killing child\n", __func__, i);
> kill(pid, SIGKILL);
> }
>
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2021-03-26 17:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 10:43 Vitaly Kuznetsov
2021-03-26 17:17 ` Paolo Bonzini [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=222fc568-399e-b3c4-5354-09169edcb78f@redhat.com \
--to=pbonzini@redhat.com \
--cc=drjones@redhat.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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
all inboxes | Powered by JetHome®