Capture the build command that executed the build system.

We need to capture the user build command to understand what additional
arguments is passed in to Soong. This data is useful to know which
targets are being executed and have statistics on top build targets
are specified.

Bug: b/169453712
Test: ran "m blueprint_tools", "m nothing", "lunch 1" and checked
      in soong_metrics proto.
Change-Id: I7ab94dcf037211f1abffe6afd012b03ffbf99756
This commit is contained in:
Patrice Arruda
2020-10-29 11:01:32 -07:00
parent e430ac338a
commit e92c30dff1
4 changed files with 109 additions and 90 deletions

View File

@@ -139,6 +139,7 @@ func main() {
met := metrics.New()
met.SetBuildDateTime(buildStarted)
met.SetBuildCommand(os.Args)
stat := &status.Status{}
defer stat.Finish()