Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2018-04-20 11:03:54 -0400
committerGenevieve Bastien2018-04-30 11:35:37 -0400
commit4bd98ad1a400adac8c79c5e9e709a005aa28fae5 (patch)
treed487776dff3024d333a2ac256ac76740ba064f58
parentf6ef304485943fe8e80680c2743dce4cb58ec2a1 (diff)
downloadorg.eclipse.tracecompass.incubator-4bd98ad1a400adac8c79c5e9e709a005aa28fae5.tar.gz
org.eclipse.tracecompass.incubator-4bd98ad1a400adac8c79c5e9e709a005aa28fae5.tar.xz
org.eclipse.tracecompass.incubator-4bd98ad1a400adac8c79c5e9e709a005aa28fae5.zip
callstack: Add method to determine if TID global
Some callstacks may have the same TID during all the trace, and others not. If they have the same TID, then it is possible to populate views for this TID even when there is no function data (like kernel status rows, to still follow blockings and preemption). Change-Id: Id39e658b6cb2b807020b830651e923faf9388382 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/121484 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java15
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java34
-rw-r--r--vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/overhead/VmOverheadAnalysis.java5
3 files changed, 54 insertions, 0 deletions
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java
index b5fb98dd..733e4cae 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java
@@ -303,6 +303,21 @@ public class CallStack {
}
/**
+ * Return whether the TID is variable through time for this callstack or if it
+ * fixed
+ *
+ * @return <code>true</code> if the TID may vary during the trace or if it is
+ * fixed and can be cached.
+ */
+ public boolean isTidVariable() {
+ if (fThreadIdProvider != null) {
+ return fThreadIdProvider.variesInTime();
+ }
+ // No TID provider, so does not vary
+ return false;
+ }
+
+ /**
* Get the start time of this callstack
*
* @return The start time of the callstack
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java
index 1e2d2c3f..1196cdcd 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java
@@ -107,6 +107,18 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
*/
int getThreadId(long time);
+ /**
+ * Return whether the value returned by this provider is variable through time
+ * (ie, each function of a stack may have a different thread ID), or is fixed
+ * (ie, all functions in a stack have the same thread ID)
+ *
+ * @return If <code>true</code>, the thread ID will be identical for a stack all
+ * throughout its life, it can be therefore be used to provider other
+ * thread-related information on stack even when there are no function
+ * calls.
+ */
+ boolean variesInTime();
+
}
/**
@@ -118,6 +130,7 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
private final int fQuark;
private @Nullable ITmfStateInterval fInterval;
private int fLastThreadId = IHostModel.UNKNOWN_TID;
+ private boolean fVariesInTime = true;
public AttributeValueThreadProvider(ITmfStateSystem ss, int quark) {
fSs = ss;
@@ -154,6 +167,12 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
break;
}
+ // If the interval spans the whole state system, the tid does not vary in time
+ if (fSs.waitUntilBuilt(0)) {
+ if (interval.intersects(fSs.getStartTime()) && interval.intersects(fSs.getCurrentEndTime() - 1)) {
+ fVariesInTime = false;
+ }
+ }
} catch (StateSystemDisposedException e) {
interval = null;
tid = IHostModel.UNKNOWN_TID;
@@ -163,6 +182,11 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
return tid;
}
+ @Override
+ public boolean variesInTime() {
+ return fVariesInTime;
+ }
+
}
/**
@@ -188,6 +212,11 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
return fTid;
}
+ @Override
+ public boolean variesInTime() {
+ return false;
+ }
+
}
/**
@@ -230,6 +259,11 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
return IHostModel.UNKNOWN_TID;
}
+ @Override
+ public boolean variesInTime() {
+ return true;
+ }
+
}
/**
diff --git a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/overhead/VmOverheadAnalysis.java b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/overhead/VmOverheadAnalysis.java
index cde9ee07..15f5c59a 100644
--- a/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/overhead/VmOverheadAnalysis.java
+++ b/vm/org.eclipse.tracecompass.incubator.virtual.machine.analysis.core/src/org/eclipse/tracecompass/incubator/internal/virtual/machine/analysis/core/overhead/VmOverheadAnalysis.java
@@ -126,6 +126,11 @@ public class VmOverheadAnalysis extends InstrumentedCallStackAnalysis {
return IHostModel.UNKNOWN_TID;
}
+ @Override
+ public boolean variesInTime() {
+ return true;
+ }
+
}
/**

Back to the top