Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2019-07-29 14:51:00 -0400
committerGenevieve Bastien2019-07-31 12:20:38 -0400
commit51c78b6865eff16399c0fbdd314929f82c0b3df9 (patch)
treec88de3fc09efde68d1a6cf44a6b049b343a5add7
parent782955c5fdcb22525d87e131a8ce00729d7883e2 (diff)
downloadorg.eclipse.tracecompass.incubator-stable-5.0.tar.gz
org.eclipse.tracecompass.incubator-stable-5.0.tar.xz
org.eclipse.tracecompass.incubator-stable-5.0.zip
callstack: Add PID to called functionsstable-5.0
The function created from the segment store methods should also contain the PID, since this data is necessary to resolve the function name. Also, the name of a function now tries to resolve the symbol instead of returning the symbol address as a string. Change-Id: I2d8a15a84470e86b688710dd598c1a4c2695e6cf Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/146754 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/146824
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java9
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java3
2 files changed, 9 insertions, 3 deletions
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 f22ee4a6..466fb67b 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
@@ -649,7 +649,8 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
@Override
public Iterable<ISegment> getIntersectingElements(long start, long end) {
ITmfStateSystem stateSystem = fRootGroup.getStateSystem();
- long startTime = Math.max(start - 1, stateSystem.getStartTime());
+ // Start can be Long.MIN_VALUE, we need to avoid underflow
+ long startTime = Math.max(Math.max(1, start) - 1, stateSystem.getStartTime());
long endTime = Math.min(end, stateSystem.getCurrentEndTime());
if (startTime > endTime) {
return Collections.emptyList();
@@ -664,10 +665,14 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
throw new NullPointerException("The quark was in that map in the first place, there must be a callstack to go with it!"); //$NON-NLS-1$
}
HostThread hostThread = callstack.getHostThread(interval.getStartTime());
+
+ int pid = -1 ;
if (hostThread == null) {
hostThread = new HostThread(StringUtils.EMPTY, IHostModel.UNKNOWN_TID);
+ } else {
+ pid = ModelManager.getModelFor(hostThread.getHost()).getProcessId(hostThread.getTid(), interval.getStartTime());
}
- return CalledFunctionFactory.create(interval.getStartTime(), interval.getEndTime() + 1, interval.getValue(), -1, hostThread.getTid(),
+ return CalledFunctionFactory.create(interval.getStartTime(), interval.getEndTime() + 1, interval.getValue(), pid, hostThread.getTid(),
null, ModelManager.getModelFor(hostThread.getHost()));
};
return Iterables.transform(query2d, fct);
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java
index 84b1df98..d9eef317 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java
@@ -17,6 +17,7 @@ import java.util.Objects;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.incubator.analysis.core.model.IHostModel;
+import org.eclipse.tracecompass.incubator.callstack.core.callgraph.SymbolAspect;
import org.eclipse.tracecompass.incubator.callstack.core.instrumented.ICalledFunction;
import org.eclipse.tracecompass.segmentstore.core.ISegment;
import org.eclipse.tracecompass.segmentstore.core.SegmentComparators;
@@ -91,7 +92,7 @@ abstract class AbstractCalledFunction implements ICalledFunction {
@Override
public String getName() {
- return NonNullUtils.nullToEmptyString(getSymbol().toString());
+ return NonNullUtils.nullToEmptyString(SymbolAspect.SYMBOL_ASPECT.resolve(this));
}
/**

Back to the top