timing.ui: make Aggregated functions merge statistics
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Sun, 4 Sep 2016 02:20:25 +0000 (22:20 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Wed, 7 Sep 2016 20:23:02 +0000 (16:23 -0400)
When calling merge, the statistics are now merged, not just
the max and min time.

Change-Id: I7e76c8a9d38672900f877decc2b3cb32699bf37a
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/80354
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Tested-by: Genevieve Bastien <gbastien+lttng@versatic.net>
analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/AggregatedCalledFunction.java
analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/AggregatedCalledFunctionStatistics.java

index 51f4f834a62e7b8d4d679c1be9729da71224a2eb..0781f5c936575ea30691d09592bcf50cd422593e 100644 (file)
@@ -179,7 +179,7 @@ public class AggregatedCalledFunction {
         long sourceSelfTime = source.getSelfTime();
         destination.addToDuration(sourceDuration);
         destination.addToSelfTime(sourceSelfTime);
-        destination.fStatistics.update(source.fStatistics.getMaxSegment(), source.fStatistics.getMinSegment(), sourceDuration, sourceSelfTime);
+        destination.getFunctionStatistics().update(source.getFunctionStatistics(), sourceDuration, sourceSelfTime);
         // merge the children callees.
         mergeChildren(destination, source);
     }
index 293fd71256cbc7074a0678e85485fbfc44499614..b74a3985e3a55cbc3e624f1de342d46de0d9f454 100644 (file)
@@ -10,7 +10,6 @@
 package org.eclipse.tracecompass.internal.analysis.timing.core.callgraph;
 
 import org.eclipse.tracecompass.analysis.timing.core.segmentstore.statistics.SegmentStoreStatistics;
-import org.eclipse.tracecompass.segmentstore.core.BasicSegment;
 import org.eclipse.tracecompass.segmentstore.core.ISegment;
 
 /**
@@ -67,23 +66,15 @@ public class AggregatedCalledFunctionStatistics extends SegmentStoreStatistics {
      * Update the statistics, this is used while merging nodes for the
      * aggregation tree.
      *
-     * @param maxSegment
-     *            The longest segment of the function to be merged
-     * @param minSegment
-     *            The shortest segment of the function to be merged
+     * @param statisticsNode
+     *            The statistics node to be merged
      * @param duration
      *            The function to be merged duration
      * @param selfTime
      *            The function to be merged self time
      */
-    public void update(ISegment maxSegment, ISegment minSegment, long duration, long selfTime) {
-        update(new BasicSegment(0, duration));
-        if (maxSegment.getLength() > fMaxSegment.getLength()) {
-            fMaxSegment = maxSegment;
-        }
-        if (minSegment.getLength() < fMinSegment.getLength()) {
-            fMinSegment = minSegment;
-        }
+    public void update(SegmentStoreStatistics statisticsNode, long duration, long selfTime) {
+        merge(statisticsNode);
         if (fMaxSelfTime < selfTime) {
             fMaxSelfTime = selfTime;
         }
This page took 0.039569 seconds and 5 git commands to generate.