Class CallStackScriptingModule
java.lang.Object
org.eclipse.tracecompass.incubator.scripting.core.callstack.CallStackScriptingModule
Provide an API to manipulate callstacks and weighted trees. This modules uses
objects of class
IWeightedTreeProvider
that can be obtained from a
trace by requesting an analysis that implements the interface.
For example, the following scriptlet would get the LTTng-UST CallStack (Incubator) analysis, which implements the weighted tree provider, for the active LTTng UST trace. The object can then be used as parameter for the methods of this module.
trace = getActiveTrace() wtProvider = getTraceAnalysis(trace, "org.eclipse.tracecompass.incubator.callstack.core.lttng.ust");
- Author:
- Geneviève Bastien
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<@NonNull N>
@Nullable DifferentialWeightedTreeProvider<N>diffTreeSets
(IWeightedTreeProvider<@NonNull N, ?, WeightedTree<@NonNull N>> provider, IWeightedTreeSet<@NonNull N, @NonNull ?, WeightedTree<@NonNull N>> first, IWeightedTreeSet<@NonNull N, @NonNull ?, WeightedTree<@NonNull N>> second, int minSignificantValue, int maxSignificantValue) Differentiates 2 treesets<@NonNull N,
E, @NonNull T extends WeightedTree<@NonNull N>>
org.eclipse.tracecompass.incubator.internal.callstack.core.flamegraph.FlameGraphDataProvider<N,E, T> getFlameGraphDataProvider
(ITmfTrace trace, IWeightedTreeProvider<@NonNull N, E, @NonNull T> provider, String id) Get a flame graph data provider for a weighted tree provider.<@NonNull N,
E>
IWeightedTreeSet<N,?, WeightedTree<N>> groupTreesBy
(IWeightedTreeProvider<@NonNull N, E, WeightedTree<@NonNull N>> provider, int level) Group the trees of the provider's main treeset, up to the requested level.
-
Constructor Details
-
CallStackScriptingModule
public CallStackScriptingModule()
-
-
Method Details
-
groupTreesBy
public <@NonNull N,E> IWeightedTreeSet<N,?, groupTreesByWeightedTree<N>> (IWeightedTreeProvider<@NonNull N, E, WeightedTree<@NonNull N>> provider, int level) Group the trees of the provider's main treeset, up to the requested level. For example, if a treeset's elements are grouped in a hierarchical manner with the following element hierarchy:element 1 --> element 2 --> element 3 element 4 --> element 5
this method with a level of1
would result in a treeset with 2 elements:element 1
andelement 4
, each containing a merge of the weighted trees of their respective children elements.- Type Parameters:
N
- The type of objects represented by each node in the treeE
- The type of elements used to group the trees- Parameters:
provider
- TheIWeightedTreeProvider
object containing the treeset for which to group trees.level
- The hierarchical level after which the elements' trees will be merged together. A value of0
would group all the weighted trees together in a single element.- Returns:
- The weighted tree set with weighted grouped at the requested level.
-
diffTreeSets
public <@NonNull N> @Nullable DifferentialWeightedTreeProvider<N> diffTreeSets(IWeightedTreeProvider<@NonNull N, ?, WeightedTree<@NonNull N>> provider, IWeightedTreeSet<@NonNull N, @NonNull ?, WeightedTree<@NonNull N>> first, IWeightedTreeSet<@NonNull N, @NonNull ?, WeightedTree<@NonNull N>> second, @ScriptParameter(defaultValue="-1") int minSignificantValue, @ScriptParameter(defaultValue="-1") int maxSignificantValue) Differentiates 2 treesets- Type Parameters:
N
- The type of data that goes in the trees- Parameters:
provider
- The original weighted tree provider, whose values will be used for the metrics, palettes, etcfirst
- The base treeset for comparisonsecond
- The treeset to compare tominSignificantValue
- The value as a percentage (between 0 and 100), under which is difference should not be highlightedmaxSignificantValue
- The value as a percentage (between 0 and 100), above which the difference should be highlighted at the maximal value.- Returns:
- The resulting differential weighted tree provider containing the result of the difference between the 2 trees
-
getFlameGraphDataProvider
public <@NonNull N,E, org.eclipse.tracecompass.incubator.internal.callstack.core.flamegraph.FlameGraphDataProvider<N,@NonNull T extends WeightedTree<@NonNull N>> E, getFlameGraphDataProviderT> (ITmfTrace trace, IWeightedTreeProvider<@NonNull N, E, @NonNull T> provider, String id) Get a flame graph data provider for a weighted tree provider. The weighted tree provider can be the result of thediffTreeSets(org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.IWeightedTreeProvider<N, ?, org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.WeightedTree<N>>, org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.IWeightedTreeSet<N, ?, org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.WeightedTree<N>>, org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.IWeightedTreeSet<N, ?, org.eclipse.tracecompass.incubator.analysis.core.weighted.tree.WeightedTree<N>>, int, int)
method- Type Parameters:
N
- The type of data that goes in the treesE
- The type of elements used to group the treesT
- The type of the tree provided- Parameters:
trace
- The trace for which to get the data provider. It is required for the data provider base class.provider
- The weighted tree provider that will provide the dataid
- The ID of the data provider- Returns:
- The resulting flame graph data provider
-