| commit | e4f40043cb8f44b9597f5ab8265f24282d306a08 | [log] [tgz] |
|---|---|---|
| author | Geneviève Bastien <gbastien+lttng@versatic.net> | Thu Jul 23 16:22:52 2020 -0400 |
| committer | Genevieve Bastien <gbastien+lttng@versatic.net> | Mon Jul 27 10:06:19 2020 -0400 |
| tree | cdca82056244ac0ff8979518abc341d4a14b4413 | |
| parent | 1e2dc6667f33d9b23a067bc474bc32aecf3a500b [diff] |
traceEvent: Pop up to last function in stack with name When a stack has elements of the same name and there is an end event, it should pop up to the deepest element in the stack with that name, not the first one. Change-Id: Id33a37bcb4719d3b2dd32189454ffd3b6a8ca6ae Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/166756 Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
diff --git a/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/callstack/TraceEventCallStackProvider.java b/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/callstack/TraceEventCallStackProvider.java index e434422..696d41a 100644 --- a/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/callstack/TraceEventCallStackProvider.java +++ b/tracetypes/org.eclipse.tracecompass.incubator.traceevent.core/src/org/eclipse/tracecompass/incubator/internal/traceevent/core/analysis/callstack/TraceEventCallStackProvider.java
@@ -513,7 +513,7 @@ int quark = ss.getQuarkAbsoluteAndAdd(PROCESSES, pName, threadName, InstrumentedCallStackAnalysis.CALL_STACK); // The function to end is not necessarily the tip of the stack. Unstack up to function name List<Object> callStack = getCallStack(ss, quark); - int indexOf = callStack.indexOf(functionExitName); + int indexOf = callStack.lastIndexOf(functionExitName); // Function not found, just unstack the last one? if (indexOf < 0) { if (functionExitName.equals(TraceEventField.UNKNOWN_EXIT_EVENT) || functionExitName.equals(TraceEventField.UNKNOWN_DURATION_EXIT_EVENT)) {