Add performance counter metrics to build.trace.gz
Start a background goroutine at the beginning of soong_build that
captures the CPU usage, heap size, and total system memory every
second. Propagate the values through soong_build_metrics.pb back
to soong_ui, and then into build.trace.gz.
Test: m nothing, examine build.trace.gz
Change-Id: Iad99f8f1f088f4f7f7d5f76566a38c0c4f4d0daa
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index d20847b..568a6f8 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -422,6 +422,7 @@
metricsDir := availableEnv["LOG_DIR"]
ctx := newContext(configuration)
+ android.StartBackgroundMetrics(configuration)
var finalOutputFile string