aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java
diff options
context:
space:
mode:
authorGravatar Klaas Boesche <klaasb@google.com>2015-09-22 11:29:47 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2015-09-22 17:07:41 +0000
commit6bd4f2da3288a1508bdafe3072a1a2f611eb8316 (patch)
treef4750c67b63d84dc841d8436d899af9f3da08bb7 /src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java
parent907d5795724641408f1aad21a02ab8adfd6e9c76 (diff)
Heavily refactor ProfileCommand to separate output and statistics generation and enable their reuse
-- MOS_MIGRATED_REVID=103634406
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java b/src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java
index d30b3dfd48..10f124f043 100644
--- a/src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java
+++ b/src/main/java/com/google/devtools/build/lib/profiler/ProfileInfo.java
@@ -14,7 +14,6 @@
package com.google.devtools.build.lib.profiler;
import static com.google.devtools.build.lib.profiler.ProfilerTask.CRITICAL_PATH;
-import static com.google.devtools.build.lib.profiler.ProfilerTask.CRITICAL_PATH_COMPONENT;
import static com.google.devtools.build.lib.profiler.ProfilerTask.TASK_COUNT;
import com.google.common.base.Joiner;
@@ -295,6 +294,15 @@ public class ProfileInfo {
public long getCriticalTime() {
return criticalTime;
}
+
+ /**
+ * @return true when this is just an action element on the critical path as logged by
+ * {@link com.google.devtools.build.lib.runtime.BuildSummaryStatsModule} and is thus a
+ * pre-processed and -analyzed critical path element
+ */
+ public boolean isComponent() {
+ return task.type == ProfilerTask.CRITICAL_PATH_COMPONENT;
+ }
}
/**
@@ -760,7 +768,7 @@ public class ProfileInfo {
public void analyzeCriticalPath(Set<ProfilerTask> ignoredTypes, CriticalPathEntry path) {
// With light critical path we do not need to analyze since it is already preprocessed
// by blaze build.
- if (path != null && path.task.type == CRITICAL_PATH_COMPONENT) {
+ if (path == null || path.isComponent()) {
return;
}
for (CriticalPathEntry entry = path; entry != null; entry = entry.next) {