[DTrace-devel] [PATCH 3/5] build: avoid building config.mk unnecessarily

Nick Alcock nick.alcock at oracle.com
Mon Jan 15 15:48:40 UTC 2024


On 21 Dec 2023, Kris Van Hees uttered the following:

> On Wed, Nov 29, 2023 at 04:08:27PM +0000, Nick Alcock wrote:
>> 'make help' and similar targets in a clean tree can take quite a
>> long time, and can even fail(!), because the unconditional inclusion
>> of config.mk forces all the Makeconfig machinery to run even if we
>> are doing nothing that might ever need any of it.
>> 
>> Include it only when we're not asking for things like help,
>> make dist, make clean and things like that.  (A surprising amount
>> does depend on config.mk and more will depend on it once we start
>> to optionally bake installation paths into it, but this subset
>> seems likely never to need it.)
>> 
>> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
>
> Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

Thanks!

> ... but I note that make help, make help-overrides, etc... all take quite a
>     bit of time even with this patch.  There is a noticable delay (~1s)
>     between issueing the command and getting output, which is surprising since
>     it shouldn't have to do much.
>
>     This is also quite visible in the ./confgure --help output where you get
>     the first screen full right away, then have a ~1s pause, and then the rest
>     comes (from make help-overrides).

Hm. Yeah, what's it doing?

... running GCC a couple of times (ignorable), and statting dumpcap and
grepping for UID_MIN in /etc/login.defs dozens of times (!). what on
earth?

... oh dammit. Because USER_UID and DUMPCAP_GROUP are recursively
assigned and used in compile lines, every single compile line gets them
re-expanded and re-executed. With a fix for that it only takes a bit
over a tenth of a second, which given all the sed and printf to format
the help is probably all we can hope for.

>     So, more work on this is needed I think to streamline things.

Indeed: clearly my machine is too fast or my standards are too low :P
Thank you for highlighting that!



More information about the DTrace-devel mailing list