Add total build time to metrics

Determining the total build time from the existing metrics is
tricky because some of the metrics are overlapping.  For example,
the "soong" metric includes  "blueprint bootstrap",
"environment check", "minibp", "bpglob", "minibootstrap", and
"bootstrap".  Create a new singleton "total" metric that
covers the interesting parts of the build.

Test: m nothing
Change-Id: Iedcf5c9cf0d27252b694d35e6ff66ca1fcf734ac
This commit is contained in:
Colin Cross
2020-01-16 15:25:50 -08:00
parent ee76fba905
commit 74cda72f5e
4 changed files with 78 additions and 58 deletions

View File

@@ -19,6 +19,8 @@ import (
"os"
"path/filepath"
"text/template"
"android/soong/ui/metrics"
)
// Ensures the out directory exists, and has the proper files to prevent kati
@@ -139,6 +141,9 @@ func Build(ctx Context, config Config, what int) {
ctx.Verboseln("Environment:", config.Environment().Environ())
ctx.Verbosef("Total RAM: %dGB", config.TotalRAM()/1024/1024/1024)
ctx.BeginTrace(metrics.Total, "total")
defer ctx.EndTrace()
if config.SkipMake() {
ctx.Verboseln("Skipping Make/Kati as requested")
what = what & (BuildSoong | BuildNinja)