Skip to content

Commit

Permalink
traceEvent: Pop up to last function in stack with name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tahini committed Jul 27, 2020
1 parent 1e2dc66 commit e4f4004
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ private void handleEnd(@NonNull ITmfEvent event, ITmfStateSystemBuilder ss, long
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)) {
Expand Down

0 comments on commit e4f4004

Please sign in to comment.