Skip to content

Commit

Permalink
Add breakdown to sandboxing preparation/overhead to JSON profile.
Browse files Browse the repository at this point in the history
Fixes #10404.

RELNOTES: None

Closes #10407.

PiperOrigin-RevId: 285225420
  • Loading branch information
meisterT authored and copybara-github committed Dec 12, 2019
1 parent bb6afc5 commit 26fbb9d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import com.google.devtools.build.lib.exec.ExecutionOptions;
import com.google.devtools.build.lib.exec.SpawnRunner;
import com.google.devtools.build.lib.exec.TreeDeleter;
import com.google.devtools.build.lib.profiler.Profiler;
import com.google.devtools.build.lib.profiler.SilentCloseable;
import com.google.devtools.build.lib.runtime.CommandEnvironment;
import com.google.devtools.build.lib.shell.ExecutionStatistics;
import com.google.devtools.build.lib.shell.Subprocess;
Expand Down Expand Up @@ -78,7 +80,10 @@ public final SpawnResult exec(Spawn spawn, SpawnExecutionContext context)
try (ResourceHandle ignored =
resourceManager.acquireResources(owner, spawn.getLocalResources())) {
context.report(ProgressStatus.EXECUTING, getName());
SandboxedSpawn sandbox = prepareSpawn(spawn, context);
SandboxedSpawn sandbox;
try (SilentCloseable c = Profiler.instance().profile("SandboxedSpawn.prepareSpawn")) {
sandbox = prepareSpawn(spawn, context);
}
return runSpawn(spawn, sandbox, context);
} catch (IOException e) {
throw new UserExecException("I/O exception during sandboxed execution", e);
Expand Down

0 comments on commit 26fbb9d

Please sign in to comment.