aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
diff options
context:
space:
mode:
authorGravatar Nathan Harmata <nharmata@google.com>2015-09-08 20:03:22 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-08 22:27:47 +0000
commitd4803010a6c07f262e3a326bde9c43f0f29aa5ff (patch)
tree8efd74d9d96c0460929bbf2b9d1d8ebfa884bb2b /src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
parentea2f63c98f4334c7dfe81fc9a0a20fcf4732ed59 (diff)
Use AutoProfiler in the Bazel codebase.
-- MOS_MIGRATED_REVID=102584924
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.java14
1 files changed, 5 insertions, 9 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 5fc379eb7e..050497fc64 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
@@ -84,7 +84,7 @@ import com.google.devtools.build.lib.pkgcache.PackageCacheOptions;
import com.google.devtools.build.lib.pkgcache.PackageManager;
import com.google.devtools.build.lib.pkgcache.PathPackageLocator;
import com.google.devtools.build.lib.pkgcache.TransitivePackageLoader;
-import com.google.devtools.build.lib.profiler.Profiler;
+import com.google.devtools.build.lib.profiler.AutoProfiler;
import com.google.devtools.build.lib.skyframe.AspectValue.AspectKey;
import com.google.devtools.build.lib.skyframe.DirtinessCheckerUtils.FileDirtinessChecker;
import com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.ActionCompletedReceiver;
@@ -980,14 +980,10 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
|| skyframeBuildView.isSomeConfiguredTargetInvalidated()) {
// This operation is somewhat expensive, so we only do it if the graph might have changed in
// some way -- either we analyzed a new target or we invalidated an old one.
- long startTime = Profiler.nanoTimeMaybe();
- skyframeActionExecutor.findAndStoreArtifactConflicts(getActionLookupValues());
- skyframeBuildView.resetEvaluatedConfiguredTargetFlag();
- // The invalidated configured targets flag will be reset later in the evaluate() call.
-
- long duration = Profiler.nanoTimeMaybe() - startTime;
- if (duration > 0) {
- LOG.info("Spent " + (duration / 1000 / 1000) + " ms discovering artifact conflicts");
+ try (AutoProfiler p = AutoProfiler.logged("discovering artifact conflicts", LOG)) {
+ skyframeActionExecutor.findAndStoreArtifactConflicts(getActionLookupValues());
+ skyframeBuildView.resetEvaluatedConfiguredTargetFlag();
+ // The invalidated configured targets flag will be reset later in the evaluate() call.
}
}
return skyframeActionExecutor.badActions();