timing: Add/update some toString methods in callgraph
authorGeneviève Bastien <gbastien+lttng@versatic.net>
Tue, 17 Jan 2017 20:41:43 +0000 (15:41 -0500)
committerGenevieve Bastien <gbastien+lttng@versatic.net>
Mon, 30 Jan 2017 14:02:31 +0000 (09:02 -0500)
It makes it easier to debug the callgraph code without having to deeply
inspect each object.

Change-Id: I9c35d570e13f1d4b506df4d83450e83a1c1dfd64
Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net>
Reviewed-on: https://git.eclipse.org/r/88902
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
analysis/org.eclipse.tracecompass.analysis.timing.core.tests/src/org/eclipse/tracecompass/analysis/timing/core/tests/callgraph/CalledFunctionTest.java
analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/AbstractCalledFunction.java
analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/AggregatedCalledFunction.java

index 9628c916e9cdf5826fd066bafe74bff76ed413b2..39babf0f5561a2b7493ac301da1e7b6de36aeeea 100644 (file)
@@ -337,8 +337,8 @@ public class CalledFunctionTest {
      */
     @Test
     public void testToString() {
-        assertEquals("[10, 1010]", fFixture.toString());
-        assertEquals("[400, 500]", f42Fixture.toString());
-        assertEquals("[20, 50]", fHiFixture.toString());
+        assertEquals("[10, 1010] Duration: 1000, Self Time: 870", fFixture.toString());
+        assertEquals("[400, 500] Duration: 100, Self Time: 100", f42Fixture.toString());
+        assertEquals("[20, 50] Duration: 30, Self Time: 30", fHiFixture.toString());
     }
 }
index 0d9833949eb34686b2bfa9beae2a67ec8e39f1c8..ee22f4719a36a27ecd5b96c73deea3de8a94c136 100644 (file)
@@ -138,7 +138,7 @@ abstract class AbstractCalledFunction implements ICalledFunction {
 
     @Override
     public String toString() {
-        return '[' + String.valueOf(fStart) + ", " + String.valueOf(fEnd) + ']'; //$NON-NLS-1$
+        return '[' + String.valueOf(fStart) + ", " + String.valueOf(fEnd) + ']' + " Duration: " + getLength() + ", Self Time: " + fSelfTime; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     }
 
     @Override
index 0781f5c936575ea30691d09592bcf50cd422593e..0eeb499e423d5f36b0775808f382d32936579885 100644 (file)
@@ -264,4 +264,9 @@ public class AggregatedCalledFunction {
     public AggregatedCalledFunctionStatistics getFunctionStatistics() {
         return fStatistics;
     }
+
+    @Override
+    public String toString() {
+        return "Aggregate Function: " + getSymbol() + ", Duration: " + getDuration() + ", Self Time: " + fSelfTime + " on " + getNbCalls() + " calls"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+    }
 }
This page took 0.027466 seconds and 5 git commands to generate.