diff options
author | 2018-06-15 07:19:11 -0700 | |
---|---|---|
committer | 2018-06-15 07:20:37 -0700 | |
commit | ef5b63ddb4b00a573d3f1c016e508bf3d412b57a (patch) | |
tree | 81c760637401c2a5d0b382e4280e69901a51e440 /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | |
parent | de2623cc0720a3a9646f3dc9844fc2fca3058306 (diff) |
Add a bit more profiler coverage
The intent is that the main thread has ~zero gaps in the profile (though there
may still be small gaps due to the time between one try block and an
immediately subsequent try block).
We need to be careful not to wrap markPhase calls (or methods that call
markPhase) in try blocks for the profiler - the Profiler requires that all
markPhase calls happen at top level, and throws an exception if not.
This should not have any performance impact - all of these are once per build,
or at most once per module per build, and we don't expect a very large number
of modules (and if we see an increasing number, we need to change the module
API to not have to call every single module, but only those that are actually
interested in certain events, maybe with an EventBus-based setup).
PiperOrigin-RevId: 200712677
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java index b7c9386bc3..ac6e8d1496 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java @@ -119,6 +119,8 @@ import com.google.devtools.build.lib.pkgcache.TargetPatternEvaluator; import com.google.devtools.build.lib.pkgcache.TestFilter; import com.google.devtools.build.lib.pkgcache.TransitivePackageLoader; import com.google.devtools.build.lib.profiler.AutoProfiler; +import com.google.devtools.build.lib.profiler.Profiler; +import com.google.devtools.build.lib.profiler.SilentCloseable; import com.google.devtools.build.lib.skyframe.AspectValue.AspectValueKey; import com.google.devtools.build.lib.skyframe.DirtinessCheckerUtils.FileDirtinessChecker; import com.google.devtools.build.lib.skyframe.ExternalFilesHelper.ExternalFileAction; @@ -1309,9 +1311,12 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory { checkActive(); Preconditions.checkState(actionLogBufferPathGenerator != null); - skyframeActionExecutor.prepareForExecution( - reporter, executor, keepGoing, explain, actionCacheChecker, - finalizeActionsToOutputService ? outputService : null); + try (SilentCloseable c = + Profiler.instance().profile("skyframeActionExecutor.prepareForExecution")) { + skyframeActionExecutor.prepareForExecution( + reporter, executor, keepGoing, explain, actionCacheChecker, + finalizeActionsToOutputService ? outputService : null); + } resourceManager.resetResourceUsage(); try { |