Skip to content

Commit 18c8839

Browse files
coeuvrecopybara-github
authored andcommitted
Add profiles to the call sites of updateRunfiles
To make it easier to debug #20748. Closes #20783. PiperOrigin-RevId: 596824058 Change-Id: I1dd6b940c30bd6c4b99904d19667f48a389b3a41
1 parent 9d0468a commit 18c8839

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/main/java/com/google/devtools/build/lib/exec/local/LocalSpawnRunner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ public SpawnResult exec(Spawn spawn, SpawnExecutionContext context)
131131
SpawnMetrics.Builder spawnMetrics = SpawnMetrics.Builder.forLocalExec();
132132
Stopwatch totalTimeStopwatch = Stopwatch.createStarted();
133133
Stopwatch setupTimeStopwatch = Stopwatch.createStarted();
134-
runfilesTreeUpdater.updateRunfiles(
135-
spawn.getRunfilesSupplier(), spawn.getEnvironment(), context.getFileOutErr());
134+
try (var s = Profiler.instance().profile("updateRunfiles")) {
135+
runfilesTreeUpdater.updateRunfiles(
136+
spawn.getRunfilesSupplier(), spawn.getEnvironment(), context.getFileOutErr());
137+
}
136138
if (Spawns.shouldPrefetchInputsForLocalExecution(spawn)) {
137139
context.prefetchInputsAndWait();
138140
}

src/main/java/com/google/devtools/build/lib/worker/WorkerSpawnRunner.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,10 @@ public SpawnResult exec(Spawn spawn, SpawnExecutionContext context)
177177
String.format(
178178
"%s worker %s", spawn.getMnemonic(), spawn.getResourceOwner().describe()))) {
179179

180-
runfilesTreeUpdater.updateRunfiles(
181-
spawn.getRunfilesSupplier(), spawn.getEnvironment(), context.getFileOutErr());
180+
try (var s = Profiler.instance().profile("updateRunfiles")) {
181+
runfilesTreeUpdater.updateRunfiles(
182+
spawn.getRunfilesSupplier(), spawn.getEnvironment(), context.getFileOutErr());
183+
}
182184

183185
InputMetadataProvider inputFileCache = context.getInputMetadataProvider();
184186

0 commit comments

Comments
 (0)