Enable bazel metrics from ninja build.
Generate the bazel profile file that contains the metrics of executing the ninja build phase of Soong. Bug: b/173028918 Test: * m nothing and check out dir that there is no bazel_metrics dir. * USE_BAZEL=1 m nothing and checked out/bazel_metrics/build_bazel_profile.gz existed. * m nothing and checked out/bazel_metrics does not exist. Change-Id: I797d1eecf5c2c260ade8b55dc69c237bfd0fcbd4
This commit is contained in:
@@ -19,6 +19,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"android/soong/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runBazel(ctx Context, config Config) {
|
func runBazel(ctx Context, config Config) {
|
||||||
@@ -45,9 +47,12 @@ func runBazel(ctx Context, config Config) {
|
|||||||
cmd.Args = append(cmd.Args, strings.Fields(extra_startup_args)...)
|
cmd.Args = append(cmd.Args, strings.Fields(extra_startup_args)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actionName := "build"
|
||||||
cmd.Args = append(cmd.Args,
|
cmd.Args = append(cmd.Args,
|
||||||
"build",
|
actionName,
|
||||||
"--output_groups="+outputGroups,
|
"--output_groups="+outputGroups,
|
||||||
|
"--profile="+filepath.Join(shared.BazelMetricsFilename(config.OutDir(), actionName)),
|
||||||
|
"--slim_profile=true",
|
||||||
)
|
)
|
||||||
|
|
||||||
if extra_build_args, ok := cmd.Environment.Get("BAZEL_BUILD_ARGS"); ok {
|
if extra_build_args, ok := cmd.Environment.Get("BAZEL_BUILD_ARGS"); ok {
|
||||||
|
Reference in New Issue
Block a user