All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Yu Zhang <yu.c.zhang@linux.intel.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: A question of KVM selftests' makefile
Date: Wed, 25 Jan 2023 17:26:53 +0000	[thread overview]
Message-ID: <Y9FmXVJw4PkLKryW@google.com> (raw)
In-Reply-To: <20230125085350.xg6u73ozznpum4u5@linux.intel.com>

On Wed, Jan 25, 2023, Yu Zhang wrote:
> Hi all,
> 
>   Currently, unlike the build system of Linux kernel, KVM selftests will
> have to run "make clean && make" to rebuild the entire test suite, once
> a header file is modified.
> 
>   Is it designed like this on purpose,

My #1 rule: never assume anything weird in KVM was an explicit design choice :-)

>   or does anyone wanna change it?

Yes!

>   I hacked the makefile by using "-MD" as EXTRA_CFLAGS, so that dependency
> rules can be generated for each target object, whose prerequisites contains
> the source file and the included header files as well.
> 
>   However, this change has its own costs. E.g., new ".o" and ".d" files will
> occupy more storage. And performance-wise, the benifit could be limited,
> because for now, most header files are needed by almost every ".c" files.
> But with the evolution of KVM selftests, more ".h" files may be added. Some
> of which may be of special usage. E.g., file "include/x86_64/mce.h" is only
> used by "x86_64/ucna_injection_test". Having to rebuild the whole test suite
> just because one specific header is touched would be annoying.
> 
>   I am not sure if this change is worthy,

Absolutely worthy, I've run afoul of the lack of dependency tracking far too many
times.

> or if there's a better solution.

This part I don't know.  I would have cobbled together something long ago if I
wasn't so clueless about Makefiles.

  reply	other threads:[~2023-01-25 17:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25  8:53 A question of KVM selftests' makefile Yu Zhang
2023-01-25 17:26 ` Sean Christopherson [this message]
2023-01-25 18:46 ` Paolo Bonzini
2023-01-27 14:29   ` Yu Zhang

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=Y9FmXVJw4PkLKryW@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yu.c.zhang@linux.intel.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 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.