diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-08-21 15:17:17 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2017-02-06 14:05:07 -0800 |
commit | d9f6fa28d681de1051adcddb5aef293e02bcc60e (patch) | |
tree | fee99e8cb9cc21243379fccb471902f3519080b6 /ui/build/soong.go | |
parent | c2af0bedc1701ee043f61d95d6b7b160f388a3cb (diff) | |
download | build_soong-d9f6fa28d681de1051adcddb5aef293e02bcc60e.tar.gz build_soong-d9f6fa28d681de1051adcddb5aef293e02bcc60e.tar.bz2 build_soong-d9f6fa28d681de1051adcddb5aef293e02bcc60e.zip |
Add build tracing
This creates a rotating build.trace.gz in the out directory that can be
loaded with chrome://tracing. It'll include start and end timings for
make/soong/kati/ninja, and it will import and time-correct the ninja log
files.
Test: m -j; load out/build.trace.gz in chrome://tracing
Test: multiproduct_kati -keep; load out/multiproduct*/build.trace.gz
Change-Id: Ic060fa9515eb88d95dbe16712479dae9dffcf626
Diffstat (limited to 'ui/build/soong.go')
-rw-r--r-- | ui/build/soong.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/build/soong.go b/ui/build/soong.go index 88e4161c..d017e700 100644 --- a/ui/build/soong.go +++ b/ui/build/soong.go @@ -20,6 +20,9 @@ import ( ) func runSoongBootstrap(ctx Context, config Config) { + ctx.BeginTrace("bootstrap soong") + defer ctx.EndTrace() + cmd := exec.CommandContext(ctx.Context, "./bootstrap.bash") env := config.Environment().Copy() env.Set("BUILDDIR", config.SoongOutDir()) @@ -37,6 +40,9 @@ func runSoongBootstrap(ctx Context, config Config) { } func runSoong(ctx Context, config Config) { + ctx.BeginTrace("soong") + defer ctx.EndTrace() + cmd := exec.CommandContext(ctx.Context, filepath.Join(config.SoongOutDir(), "soong"), "-w", "dupbuild=err") if config.IsVerbose() { cmd.Args = append(cmd.Args, "-v") |