Class CallStackSeries
java.lang.Object
org.eclipse.tracecompass.incubator.callstack.core.instrumented.statesystem.CallStackSeries
- All Implemented Interfaces:
Iterable<ISegment>
,Collection<ISegment>
,ISegmentStore<ISegment>
A callstack series contain the information necessary to build all the
different callstacks from a same pattern.
Example: Let's take a trace that registers function entry and exit for
threads and where events also provide information on some other stackable
application component:
The structure of this callstack in the state system could be as follows:
Per PID [pid] [tid] callstack 1 -> function name 2 -> function name 3 -> function name Per component [application component] [tid] callstack 1 -> some string 2 -> some stringThere are 2
CallStackSeries
in this example, one starting by "Per
PID" and another "Per component". For the first series, there could be 3
ICallStackGroupDescriptor
: "Per PID/*", "*", "callstack".
If the function names happen to be addresses in an executable and the PID is
the key to map those symbols to actual function names, then the first group
"Per PID/*" would be the symbol key group.
Each group descriptor can get the corresponding ICallStackElement
s,
ie, for the first group, it would be all the individual pids in the state
system, and for the second group, it would be the application components.
Each element that is not a leaf element (check with
ICallStackElement.isLeaf()
) will have a next group descriptor that
can fetch the elements under it. The last group will resolve to leaf elements
and each leaf elements has one CallStack
object.- Author:
- Geneviève Bastien
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
This class will resolve the thread ID provider by the value of a attribute at a given depthstatic final class
This class will resolve the thread ID provider by the value of a attribute at a given depthstatic final class
This class will resolve the thread ID from the CPU on which the callstack was running at a given timestatic interface
Interface for classes that provide a thread ID at time t for a callstack.static interface
Interface for describing how a callstack will get the thread ID -
Constructor Summary
ConstructorDescriptionCallStackSeries
(ITmfStateSystem ss, List<String[]> patternPaths, int symbolKeyLevelIndex, String name, CallStackHostUtils.IHostIdResolver hostResolver, @Nullable CallStackSeries.IThreadIdResolver threadResolver) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(@Nullable Collection<? extends ISegment> c) void
clear()
boolean
boolean
containsAll
(@Nullable Collection<?> c) void
dispose()
getIntersectingElements
(long start, long end) getName()
Get the name of this callstack seriesGet the root elements of this callstack seriesGet the root group of the callstack seriesboolean
isEmpty()
iterator()
com.google.common.collect.Multimap<CallStackDepth,
ISegment> queryCallStacks
(Collection<CallStackDepth> callstacks, Collection<Long> times) Query the requested callstacks and return the segments for the sampled times.int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
Methods inherited from interface org.eclipse.tracecompass.segmentstore.core.ISegmentStore
close, getIntersectingElements, getIntersectingElements, getIntersectingElements, getIntersectingElements, iterator, remove, removeAll, retainAll
-
Constructor Details
-
CallStackSeries
public CallStackSeries(ITmfStateSystem ss, List<String[]> patternPaths, int symbolKeyLevelIndex, String name, CallStackHostUtils.IHostIdResolver hostResolver, @Nullable CallStackSeries.IThreadIdResolver threadResolver) Constructor- Parameters:
ss
- The state system containing this call stackpatternPaths
- The patterns for the different levels of the callstack in the state system. Any further level path is relative to the previous one.symbolKeyLevelIndex
- The index in the list of the list to be used as a key to the symbol provider. The data at this level must be an integer, for instance a process IDname
- A name for this callstackhostResolver
- The host ID resolver for this callstackthreadResolver
- The thread resolver
-
-
Method Details
-
getRootElements
Get the root elements of this callstack series- Returns:
- The root elements of the callstack series
-
getRootGroup
Get the root group of the callstack series- Returns:
- The root group descriptor
-
getName
Get the name of this callstack series- Returns:
- The name of the callstack series
-
queryCallStacks
public com.google.common.collect.Multimap<CallStackDepth,ISegment> queryCallStacks(Collection<CallStackDepth> callstacks, Collection<Long> times) Query the requested callstacks and return the segments for the sampled times. The returned segments will be simplyISegment
when there is no function at a given depth, orICalledFunction
when there is an actual function.- Parameters:
callstacks
- The callstack entries to querytimes
- The complete list of times to query, they may not all be within this series's range- Returns:
- A map of callstack depths to a list of segments.
-
size
public int size()- Specified by:
size
in interfaceCollection<ISegment>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<ISegment>
-
contains
- Specified by:
contains
in interfaceCollection<ISegment>
-
iterator
-
toArray
- Specified by:
toArray
in interfaceCollection<ISegment>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArray
in interfaceCollection<ISegment>
-
add
- Specified by:
add
in interfaceCollection<ISegment>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<ISegment>
-
addAll
- Specified by:
addAll
in interfaceCollection<ISegment>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<ISegment>
-
getIntersectingElements
- Specified by:
getIntersectingElements
in interfaceISegmentStore<ISegment>
-
dispose
public void dispose()- Specified by:
dispose
in interfaceISegmentStore<ISegment>
-