diff options
author | 2020-12-12 06:24:26 +0000 | |
---|---|---|
committer | 2020-12-14 18:48:11 +0000 | |
commit | 05ab2d0731495fed0e9ee7d4158cf70697728f77 (patch) | |
tree | 223ff2427ca95be91ae7ab67fe8f2370a1f40318 /shared | |
parent | 57fab96e0123f8de2faea7088a7c624e66d14099 (diff) |
Enable bazel profiling in soong_build.
Bazel is executed several times during the execution of soong_build.
For each bazel execution, generate a profile and save under the
BAZEL_METRICS_DIR which is defined in soong_ui.
Bug: b/174479924
Test: * USE_BAZEL_ANALYSIS=1 USE_BAZEL=1 m nothing and checked
if the cquery and graph build bazel profiles were generated.
* Verified that the generated bazel profiles were uploaded
to the local dev metrics pipeline.
Change-Id: I3d20204484dc6c5a1525a5d3eec1d62cfb33535b
Diffstat (limited to 'shared')
-rw-r--r-- | shared/Android.bp | 3 | ||||
-rw-r--r-- | shared/paths.go | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/shared/Android.bp b/shared/Android.bp index 07dfe11d3..2a4f56f77 100644 --- a/shared/Android.bp +++ b/shared/Android.bp @@ -4,4 +4,7 @@ bootstrap_go_package { srcs: [ "paths.go", ], + deps: [ + "soong-bazel", + ], } diff --git a/shared/paths.go b/shared/paths.go index f5dc5dd2e..1b9ff6098 100644 --- a/shared/paths.go +++ b/shared/paths.go @@ -18,6 +18,8 @@ package shared import ( "path/filepath" + + "android/soong/bazel" ) // A SharedPaths represents a list of paths that are shared between @@ -37,6 +39,6 @@ func TempDirForOutDir(outDir string) (tempPath string) { // on the action name. This is to help to store a set of bazel // profiles since bazel may execute multiple times during a single // build. -func BazelMetricsFilename(s SharedPaths, actionName string) string { - return filepath.Join(s.BazelMetricsDir(), actionName+"_bazel_profile.gz") +func BazelMetricsFilename(s SharedPaths, actionName bazel.RunName) string { + return filepath.Join(s.BazelMetricsDir(), actionName.String()+"_bazel_profile.gz") } |