Merge "metric namespace for symlink_forest"

This commit is contained in:
Usta (Tsering) Shrestha
2022-12-01 19:18:39 +00:00
committed by Gerrit Code Review

View File

@@ -629,6 +629,7 @@ func bazelArtifacts() []string {
// symlink tree creation binary. Then the latter would not need to depend on
// the very heavy-weight machinery of soong_build .
func runSymlinkForestCreation(configuration android.Config, ctx *android.Context, extraNinjaDeps []string, metricsDir string) string {
ctx.EventHandler.Do("symlink_forest", func() {
var ninjaDeps []string
ninjaDeps = append(ninjaDeps, extraNinjaDeps...)
@@ -653,9 +654,8 @@ func runSymlinkForestCreation(configuration android.Config, ctx *android.Context
// PlantSymlinkForest() returns all the directories that were readdir()'ed.
// Such a directory SHOULD be added to `ninjaDeps` so that a child directory
// or file created/deleted under it would trigger an update of the symlink
// forest.
ctx.EventHandler.Do("symlink_forest", func() {
// or file created/deleted under it would trigger an update of the symlink forest.
ctx.EventHandler.Do("plant", func() {
symlinkForestDeps := bp2build.PlantSymlinkForest(
configuration.IsEnvTrue("BP2BUILD_VERBOSE"), topDir, workspaceRoot, generatedRoot, excludes)
ninjaDeps = append(ninjaDeps, symlinkForestDeps...)
@@ -663,6 +663,7 @@ func runSymlinkForestCreation(configuration android.Config, ctx *android.Context
writeDepFile(symlinkForestMarker, ctx.EventHandler, ninjaDeps)
touch(shared.JoinPath(topDir, symlinkForestMarker))
})
codegenMetrics := bp2build.ReadCodegenMetrics(metricsDir)
if codegenMetrics == nil {
m := bp2build.CreateCodegenMetrics()