timing: Add a threadId field for the flame graph
authorSonia Farrah <sonia.farrah@ericsson.com>
Mon, 15 Aug 2016 18:00:49 +0000 (14:00 -0400)
committerBernd Hufmann <bernd.hufmann@ericsson.com>
Tue, 23 Aug 2016 20:48:11 +0000 (16:48 -0400)
This creates a class for a thread that extends the
AggregatedCalledFunction class and having a field for the thread id.

This adds a new field for the thread id in the FlamegraphDepthEntry.

Change-Id: I9bd08039c9adc553e412cf0db6a8a788f786459b
Signed-off-by: Sonia Farrah <sonia.farrah@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/79074
Reviewed-by: Hudson CI
Reviewed-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Tested-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.timing.core.tests/src/org/eclipse/tracecompass/analysis/timing/core/tests/flamegraph/AggregatedCalledFunctionStatisticsTest.java
analysis/org.eclipse.tracecompass.analysis.timing.core.tests/src/org/eclipse/tracecompass/analysis/timing/core/tests/flamegraph/AggregationTreeTest.java
analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/CallGraphAnalysis.java
analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/ThreadNode.java [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/flamegraph/FlameGraphContentProvider.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/flamegraph/FlamegraphDepthEntry.java

index f501d99ab00c448d22fa1e805cbe7e406faa3c53..67ed76fa4cb0505337b3f9db4c7123b649923246 100644 (file)
@@ -14,6 +14,7 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.AggregatedCalledFunction;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.AggregatedCalledFunctionStatistics;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis;
+import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.ThreadNode;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
 import org.eclipse.tracecompass.statesystem.core.StateSystemFactory;
@@ -104,7 +105,7 @@ public class AggregatedCalledFunctionStatisticsTest {
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
         @NonNull
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         Object[] children = threads.get(0).getChildren().toArray();
@@ -190,7 +191,7 @@ public class AggregatedCalledFunctionStatisticsTest {
         // Execute the CallGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         assertNotNull(threads);
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction firstFunction = (AggregatedCalledFunction) children[0];
@@ -285,7 +286,7 @@ public class AggregatedCalledFunctionStatisticsTest {
         // Execute the callGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         Object[] children = threads.get(0).getChildren().toArray();
@@ -400,7 +401,7 @@ public class AggregatedCalledFunctionStatisticsTest {
         // Execute the CallGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         // Test the threads generated by the analysis
index 49ab868e89cdfd55d75c06cb2976b12bba26f2a8..8d21b3198707d34a1ab652bd1de7cbb92f120ddc 100644 (file)
@@ -23,6 +23,7 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.AggregatedCalledFunction;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis;
+import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.ThreadNode;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystem;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
 import org.eclipse.tracecompass.statesystem.core.StateSystemFactory;
@@ -88,7 +89,7 @@ public class AggregationTreeTest {
         fixture.closeHistory(1002);
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         assertNotNull(threads);
         assertEquals("Number of threads found", 0, threads.size());
     }
@@ -110,7 +111,9 @@ public class AggregationTreeTest {
         // Build the state system
         long start = 1;
         long end = 1001;
-        int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH);
+        int threadQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH);
+        int parentQuark = fixture.getQuarkRelativeAndAdd(threadQuark, CALLSTACK_PATH);
+        fixture.updateOngoingState(TmfStateValue.newValueLong(100), threadQuark);
         for (int i = 1; i <= SMALL_AMOUNT_OF_SEGMENT; i++) {
             int quark = fixture.getQuarkRelativeAndAdd(parentQuark, Integer.toString(i));
             TmfStateValue statev = TmfStateValue.newValueLong(i);
@@ -124,11 +127,13 @@ public class AggregationTreeTest {
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
         @NonNull
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         assertEquals("Number of thread nodes Found", 1, threads.size());
         assertEquals("Number of root functions ", 1, threads.get(0).getChildren().size());
+        assertEquals("Thread id", 100, threads.get(0).getId());
+        assertEquals("Thread name", "Thread", threads.get(0).getSymbol());
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction firstFunction = (AggregatedCalledFunction) children[0];
         assertEquals("Children number: First function", 1, firstFunction.getChildren().size());
@@ -174,7 +179,9 @@ public class AggregationTreeTest {
     public void treeTest() {
         ITmfStateSystemBuilder fixture = createFixture();
         // Build the state system
-        int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH);
+        int threadQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH);
+        int parentQuark = fixture.getQuarkRelativeAndAdd(threadQuark, CALLSTACK_PATH);
+        fixture.updateOngoingState(TmfStateValue.newValueDouble(0.001), threadQuark);
         int quark = fixture.getQuarkRelativeAndAdd(parentQuark, QUARK_0);
         TmfStateValue statev = TmfStateValue.newValueLong(0);
         fixture.modifyAttribute(0, statev, quark);
@@ -196,10 +203,12 @@ public class AggregationTreeTest {
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
         @NonNull
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         assertEquals("Number of thread nodes Found", 1, threads.size());
+        assertEquals("Thread id", -1, threads.get(0).getId());
+        assertEquals("Thread name", "Thread", threads.get(0).getSymbol());
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction firstFunction = (AggregatedCalledFunction) children[0];
         assertEquals("Children number: First function", 1, firstFunction.getChildren().size());
@@ -245,7 +254,9 @@ public class AggregationTreeTest {
     public void mergeFirstLevelCalleesTest() {
         ITmfStateSystemBuilder fixture = createFixture();
         // Build the state system
-        int parentQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, THREAD_PATH, CALLSTACK_PATH);
+        int threadQuark = fixture.getQuarkAbsoluteAndAdd(PROCESS_PATH, "123");
+        int parentQuark = fixture.getQuarkRelativeAndAdd(threadQuark, CALLSTACK_PATH);
+        fixture.updateOngoingState(TmfStateValue.newValueDouble(0.001), threadQuark);
         int quark = fixture.getQuarkRelativeAndAdd(parentQuark, QUARK_0);
         TmfStateValue statev = TmfStateValue.newValueLong(0);
         fixture.modifyAttribute(0, statev, quark);
@@ -269,11 +280,14 @@ public class AggregationTreeTest {
 
         // Execute the CallGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
-        assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        String @NonNull [] tp = { "123" };
+        assertTrue(cga.iterateOverStateSystem(fixture, tp, PP, CSP, new NullProgressMonitor()));
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         assertEquals("Number of thread nodes Found", 1, threads.size());
+        assertEquals("Thread id", 123, threads.get(0).getId());
+        assertEquals("Thread name", "123", threads.get(0).getSymbol());
         assertEquals("Number of root functions ", 1, threads.get(0).getChildren().size());
         Object[] children = threads.get(0).getChildren().toArray();
 
@@ -380,10 +394,12 @@ public class AggregationTreeTest {
         // Execute the CallGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         assertEquals("Number of thread nodes Found", 1, threads.size());
+        assertEquals("Thread id", -1, threads.get(0).getId());
+        assertEquals("Thread name", "Thread", threads.get(0).getSymbol());
         assertEquals("Number of root functions ", 1, threads.get(0).getChildren().size());
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction main = (AggregatedCalledFunction) children[0];
@@ -457,9 +473,11 @@ public class AggregationTreeTest {
         // Execute the callGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
+        assertEquals("Thread id", -1, threads.get(0).getId());
+        assertEquals("Thread name", "Thread", threads.get(0).getSymbol());
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction parent = (AggregatedCalledFunction) children[0];
         for (int i = 1; i < LARGE_AMOUNT_OF_SEGMENTS; i++) {
@@ -507,10 +525,12 @@ public class AggregationTreeTest {
         // Execute the callGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         assertEquals("Number of thread nodes Found", 1, threads.size());
+        assertEquals("Thread id", -1, threads.get(0).getId());
+        assertEquals("Thread name", "Thread", threads.get(0).getSymbol());
         assertEquals("Number of root functions ", 1, threads.get(0).getChildren().size());
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction firstFunction = (AggregatedCalledFunction) children[0];
@@ -579,10 +599,12 @@ public class AggregationTreeTest {
         // Execute the callGraphAnalysis
         CGAnalysis cga = new CGAnalysis();
         assertTrue(cga.iterateOverStateSystem(fixture, TP, PP, CSP, new NullProgressMonitor()));
-        List<AggregatedCalledFunction> threads = cga.getThreadNodes();
+        List<ThreadNode> threads = cga.getThreadNodes();
         // Test the threads generated by the analysis
         assertNotNull(threads);
         assertEquals("Number of thread nodes Found", 1, threads.size());
+        assertEquals("Thread id", -1, threads.get(0).getId());
+        assertEquals("Thread name", "Thread", threads.get(0).getSymbol());
         assertEquals("Number of root functions ", 2, threads.get(0).getChildren().size());
         Object[] children = threads.get(0).getChildren().toArray();
         AggregatedCalledFunction firstFunction = (AggregatedCalledFunction) children[0];
index 8b87520a1ad5a0f3d48033a261c7bf8b1f8a0e26..e34f7b5caec24f66bac6425afa6fb47a785a3eda 100644 (file)
@@ -32,6 +32,7 @@ import org.eclipse.tracecompass.statesystem.core.exceptions.StateSystemDisposedE
 import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
 import org.eclipse.tracecompass.statesystem.core.interval.ITmfStateInterval;
 import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
+import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue.Type;
 import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
 import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
 import org.eclipse.tracecompass.tmf.core.callstack.CallStackAnalysis;
@@ -89,7 +90,7 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
      * The List of thread nodes. Each thread has a virtual node having the root
      * function as children
      */
-    private List<AggregatedCalledFunction> fThreadNodes = new ArrayList<>();
+    private List<ThreadNode> fThreadNodes = new ArrayList<>();
 
     /**
      * Default constructor
@@ -205,12 +206,28 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
      */
     private boolean iterateOverQuark(ITmfStateSystem stateSystem, int quark, String[] subAttributePath, IProgressMonitor monitor) {
         String threadName = stateSystem.getAttributeName(quark);
-        AggregatedCalledFunction init = null;
+        long threadId = -1;
+        ITmfStateInterval interval = null;
+        try {
+            interval = stateSystem.querySingleState(stateSystem.getStartTime(), quark);
+            ITmfStateValue threadStateValue = interval.getStateValue();
+            if (threadStateValue.getType() == Type.LONG || threadStateValue.getType() == Type.INTEGER) {
+                threadId = threadStateValue.unboxLong();
+            } else {
+                try {
+                    threadId = Long.parseLong(threadName);
+                } catch (NumberFormatException e) {
+                    /* use default threadId */
+                }
+            }
+        } catch (StateSystemDisposedException error) {
+            Activator.getInstance().logError(Messages.QueringStateSystemError, error);
+        }
         try {
             long curTime = stateSystem.getStartTime();
             long limit = stateSystem.getCurrentEndTime();
             AbstractCalledFunction initSegment = CalledFunctionFactory.create(0, 0, 0, threadName, null);
-            init = new AggregatedCalledFunction(initSegment, 0);
+            ThreadNode init = new ThreadNode(initSegment, 0, threadId);
             while (curTime < limit) {
                 if (monitor.isCanceled()) {
                     return false;
@@ -222,7 +239,7 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
                 }
                 final int depth = 0;
                 int quarkParent = fCurrentQuarks.get(depth);
-                ITmfStateInterval interval = stateSystem.querySingleState(curTime, quarkParent);
+                interval = stateSystem.querySingleState(curTime, quarkParent);
                 ITmfStateValue stateValue = interval.getStateValue();
 
                 if (!stateValue.isNull()) {
@@ -240,12 +257,11 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
 
                 curTime = interval.getEndTime() + 1;
             }
-
+            fThreadNodes.add(init);
         } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) {
             Activator.getInstance().logError(Messages.QueringStateSystemError, e);
             return false;
         }
-        fThreadNodes.add(init);
         return true;
     }
 
@@ -363,7 +379,7 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
      *
      * @return The thread nodes
      */
-    public List<AggregatedCalledFunction> getThreadNodes() {
+    public List<ThreadNode> getThreadNodes() {
         return ImmutableList.copyOf(fThreadNodes);
     }
 
diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/ThreadNode.java b/analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/ThreadNode.java
new file mode 100644 (file)
index 0000000..fb2a64c
--- /dev/null
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Ericsson
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.analysis.timing.core.callgraph;
+
+/**
+ * This class represents one thread. It's used as a root node for the aggregated
+ * tree created in the CallGraphAnalysis.
+ *
+ * @author Sonia Farrah
+ */
+public class ThreadNode extends AggregatedCalledFunction {
+
+    private final long fId;
+
+    /**
+     * @param calledFunction
+     *            the called function
+     * @param maxDepth
+     *            The maximum depth
+     * @param id
+     *            The thread id
+     */
+    public ThreadNode(AbstractCalledFunction calledFunction, int maxDepth, long id) {
+        super(calledFunction, maxDepth);
+        fId = id;
+    }
+
+    /**
+     * The thread id
+     *
+     * @return The thread id
+     */
+    public long getId() {
+        return fId;
+    }
+
+}
index 18cb9e8241bcc49c314e9290353cc490546bd7b5..f38a28c71a92aceab4b840abcb040e8b0ddf8ecc 100644 (file)
@@ -18,6 +18,7 @@ import java.util.List;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.tracecompass.common.core.NonNullUtils;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.AggregatedCalledFunction;
+import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.ThreadNode;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphContentProvider;
@@ -52,7 +53,7 @@ public class FlameGraphContentProvider implements ITimeGraphContentProvider {
     private void setData(AggregatedCalledFunction firstNode, List<FlamegraphDepthEntry> childrenEntries, Deque<Long> timestampStack) {
         for (int i = 0; i < firstNode.getMaxDepth(); i++) {
             if (i >= childrenEntries.size()) {
-                FlamegraphDepthEntry entry = new FlamegraphDepthEntry(String.valueOf(i), 0, fActiveTrace.getEndTime().toNanos() - fActiveTrace.getStartTime().toNanos(), i);
+                FlamegraphDepthEntry entry = new FlamegraphDepthEntry(String.valueOf(i), 0, fActiveTrace.getEndTime().toNanos() - fActiveTrace.getStartTime().toNanos(), i, i);
                 childrenEntries.add(entry);
             }
         }
@@ -111,8 +112,8 @@ public class FlameGraphContentProvider implements ITimeGraphContentProvider {
         if (inputElement instanceof List<?>) {
             List<?> threadNodes = (List<?>) inputElement;
             for (Object object : threadNodes) {
-                if (object instanceof AggregatedCalledFunction) {
-                    buildChildrenEntries((AggregatedCalledFunction) object);
+                if (object instanceof ThreadNode) {
+                    buildChildrenEntries((ThreadNode) object);
                 }
             }
         }
@@ -127,8 +128,8 @@ public class FlameGraphContentProvider implements ITimeGraphContentProvider {
      * @param threadNode
      *            The node of the aggregation tree
      */
-    private void buildChildrenEntries(AggregatedCalledFunction threadNode) {
-        FlamegraphDepthEntry threadEntry = new FlamegraphDepthEntry("", 0, fActiveTrace.getEndTime().toNanos() - fActiveTrace.getStartTime().toNanos(), fFlameGraphEntries.size()); //$NON-NLS-1$
+    private void buildChildrenEntries(ThreadNode threadNode) {
+        FlamegraphDepthEntry threadEntry = new FlamegraphDepthEntry("", 0, fActiveTrace.getEndTime().toNanos() - fActiveTrace.getStartTime().toNanos(), fFlameGraphEntries.size(), threadNode.getId()); //$NON-NLS-1$
         List<FlamegraphDepthEntry> childrenEntries = new ArrayList<>();
         fThreadDuration = 0L;
         // Sort children by duration
index 21ed20a1ca198ce0485c411ad9c207c5118ea7fe..f0cdbdb67a505571bfd9e7d57e185d4341b6e8e5 100644 (file)
@@ -19,6 +19,7 @@ import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.TimeGraphEntry;
 public class FlamegraphDepthEntry extends TimeGraphEntry {
 
     private final int fDepth;
+    private final long fId;
 
     /**
      * Constructor
@@ -31,10 +32,13 @@ public class FlamegraphDepthEntry extends TimeGraphEntry {
      *            The end time of an entry
      * @param depth
      *            The Depth of an entry
+     * @param id
+     *            The id of an entry
      */
-    public FlamegraphDepthEntry(String name, long startTime, long endTime, int depth) {
+    public FlamegraphDepthEntry(String name, long startTime, long endTime, int depth, long id) {
         super(name, startTime, endTime);
         fDepth = depth;
+        fId = id;
     }
 
     /**
@@ -45,4 +49,13 @@ public class FlamegraphDepthEntry extends TimeGraphEntry {
     public int getDepth() {
         return fDepth;
     }
+
+    /**
+     * The id of an entry
+     *
+     * @return The id
+     */
+    public long getId() {
+        return fId;
+    }
 }
This page took 0.03274 seconds and 5 git commands to generate.