Add tracer to runBazel function.
Added a tracer named "bazel" in runBazel function to capture topline
metrics when running bazel.
Bug: b/173028918
Test: * USE_BAZEL=1 m nothing and checked soong_metrics file using
printproto command to verify that bazel topline metrics
were captured.
Change-Id: I5cb0728a4da48545dc701cc79627c318d5d9a29d
diff --git a/ui/build/bazel.go b/ui/build/bazel.go
index 0bc3a16..4b03bc1 100644
--- a/ui/build/bazel.go
+++ b/ui/build/bazel.go
@@ -21,9 +21,13 @@
"strings"
"android/soong/shared"
+ "android/soong/ui/metrics"
)
func runBazel(ctx Context, config Config) {
+ ctx.BeginTrace(metrics.RunBazel, "bazel")
+ defer ctx.EndTrace()
+
// "droid" is the default ninja target.
// TODO(b/160568333): stop hardcoding 'droid' to support building any
// Ninja target.