summaryrefslogtreecommitdiff
path: root/shared/paths.go
diff options
context:
space:
mode:
author Patrice Arruda <patricearruda@google.com> 2020-12-12 06:24:26 +0000
committer Patrice Arruda <patricearruda@google.com> 2020-12-14 18:48:11 +0000
commit05ab2d0731495fed0e9ee7d4158cf70697728f77 (patch)
tree223ff2427ca95be91ae7ab67fe8f2370a1f40318 /shared/paths.go
parent57fab96e0123f8de2faea7088a7c624e66d14099 (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/paths.go')
-rw-r--r--shared/paths.go6
1 files changed, 4 insertions, 2 deletions
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")
}