From 05ab2d0731495fed0e9ee7d4158cf70697728f77 Mon Sep 17 00:00:00 2001 From: Patrice Arruda Date: Sat, 12 Dec 2020 06:24:26 +0000 Subject: 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 --- shared/paths.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'shared/paths.go') 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") } -- cgit v1.2.3-59-g8ed1b