Bug 257141

Summary: make buildworld with time logging for each stage
Product: Base System Reporter: Wolfram Schneider <wosch>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: emaste, wosch
Priority: Normal    
Version: CURRENT   
Hardware: Any   
OS: Any   
URL: https://reviews.freebsd.org/D31154

Description Wolfram Schneider freebsd_committer 2021-07-12 18:07:21 UTC
The target "buildworld" does a lot of bootstrapping before we actually compile our current source code. It would be nice if we can see how much time we spent in each bootstrapping stage, and how much for the current code.

Here is a simple patch which runs the make command together with the time(1) command.

cd /usr/src && make buildworld
egrep  ' real | stage ' log.buildworld

>>> stage 1.1: legacy release compatibility shims
        0.18 real         0.11 user         0.11 sys
>>> stage 1.2: bootstrap tools
       51.61 real       957.71 user        26.57 sys
>>> stage 2.1: cleaning up the object tree
        5.25 real        76.18 user        30.59 sys
        4.02 real        48.22 user        18.68 sys
>>> stage 2.3: build tools
        1.71 real         7.21 user         1.90 sys
>>> stage 3: cross tools
      699.53 real     17984.32 user       379.21 sys
        0.08 real         0.03 user         0.04 sys
>>> stage 3.1: recording build metadata
        0.10 real         0.02 user         0.07 sys
        0.04 real         0.02 user         0.01 sys
>>> stage 4.1: building includes
        4.23 real        62.01 user        13.27 sys
>>> stage 4.2: building libraries
     1165.88 real     33415.91 user       919.59 sys
>>> stage 4.3: building lib32 shim libraries
        0.23 real         0.34 user         0.50 sys
        0.14 real         0.11 user         0.07 sys
        1.16 real         6.80 user         1.73 sys
        0.06 real         0.02 user         0.04 sys
        0.18 real         0.34 user         0.16 sys
        0.27 real         0.27 user         0.08 sys
        0.10 real         0.50 user         0.23 sys
      197.43 real      4766.05 user       401.80 sys
>>> stage 4.4: building everything
      273.69 real      6713.36 user       438.12 sys
     2413.52 real     64045.82 user      2241.87 sys
Comment 1 commit-hook freebsd_committer 2021-08-01 09:15:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=99feb137f5f66f903bba816c1d98ced2a92bef12

commit 99feb137f5f66f903bba816c1d98ced2a92bef12
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2021-08-01 09:10:49 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2021-08-01 09:10:49 +0000

    `make buildworld' with time logging for each stage

    PR:             257141
    Reviewed by:    sjg,emaste
    Approved by:    emaste
    Differential Revision:  https://reviews.freebsd.org/D31154

 Makefile.inc1      | 13 +++++++------
 Makefile.libcompat |  2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)