tmf.core/ui: Move some logic of the symbol provider to core
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 17 Apr 2017 03:22:07 +0000 (23:22 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Mon, 24 Apr 2017 01:50:01 +0000 (21:50 -0400)
This moves the Symbol provider to core. Special care must be taken to
ensure that the preference page is available if required.

Moves callstack symbol providers to core interfaces.

Makes flamegraph use symbol aspect.

Most changes are internal, so this does not affect the API much.
Also, now CallgraphAnalysis can be in Core.

Change-Id: Ie4c37b670f599fad8fb74e08b458c0db65bb312c
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/95118
Reviewed-by: Hudson CI
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
31 files changed:
analysis/org.eclipse.tracecompass.analysis.timing.core/build.properties
analysis/org.eclipse.tracecompass.analysis.timing.core/icons/callgraph.png [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.timing.core/plugin.properties
analysis/org.eclipse.tracecompass.analysis.timing.core/plugin.xml [new file with mode: 0644]
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/SymbolAspect.java [new file with mode: 0644]
analysis/org.eclipse.tracecompass.analysis.timing.ui/plugin.properties
analysis/org.eclipse.tracecompass.analysis.timing.ui/plugin.xml
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/CallGraphAnalysisUI.java [deleted file]
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/CallGraphDensityViewer.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/CallGraphTableViewer.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/SymbolAspect.java [deleted file]
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/flamegraph/FlameGraphPresentationProvider.java
analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/flamegraph/FlameGraphView.java
common/org.eclipse.tracecompass.common.core/annotations/java/lang/ref/Reference.eea [new file with mode: 0644]
lttng/org.eclipse.tracecompass.lttng2.ust.ui/plugin.xml
lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java
lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProviderFactory.java
tmf/org.eclipse.tracecompass.tmf.core/plugin.properties
tmf/org.eclipse.tracecompass.tmf.core/plugin.xml
tmf/org.eclipse.tracecompass.tmf.core/schema/org.eclipse.tracecompass.tmf.core.symbolProvider.exsd [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/DefaultSymbolProvider.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/ISymbolProviderFactory.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/SymbolProviderManager.java [new file with mode: 0644]
tmf/org.eclipse.tracecompass.tmf.ui/plugin.xml
tmf/org.eclipse.tracecompass.tmf.ui/schema/org.eclipse.tracecompass.tmf.ui.symbolProvider.exsd
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/symbols/BasicSymbolProviderFactory.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/DefaultSymbolProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProviderFactory.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/SymbolProviderManager.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/views/callstack/CallStackView.java

index 363d2f04ae2dc8797744120512d801e3e83c2b35..17be6b6ea65ceb14ddf50545bef93d3c5b50b384 100644 (file)
@@ -12,7 +12,8 @@ output.. = bin/
 bin.includes = META-INF/,\
                plugin.properties,\
                .,\
-               about.html
+               about.html,\
+               plugin.xml
 additional.bundles = org.eclipse.jdt.annotation
 jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
 src.includes = about.html
diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.core/icons/callgraph.png b/analysis/org.eclipse.tracecompass.analysis.timing.core/icons/callgraph.png
new file mode 100644 (file)
index 0000000..48e0b4b
Binary files /dev/null and b/analysis/org.eclipse.tracecompass.analysis.timing.core/icons/callgraph.png differ
index 080780f7aeda1a5bf183f8511ef776a213ca4ba5..e301600d114786155534952e63c2d4654901e9a3 100644 (file)
@@ -9,3 +9,5 @@
 
 Bundle-Vendor = Eclipse Trace Compass
 Bundle-Name = Trace Compass Timing Analysis Core Plug-in
+
+callgraph.analysis = Call Graph Analysis
\ No newline at end of file
diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.core/plugin.xml b/analysis/org.eclipse.tracecompass.analysis.timing.core/plugin.xml
new file mode 100644 (file)
index 0000000..4839f34
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.linuxtools.tmf.core.analysis">
+      <module
+            analysis_module="org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis"
+            applies_experiment="true"
+            automatic="true"
+            icon="icons/callgraph.png"
+            id="org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.callgraphanalysis"
+            name="%callgraph.analysis">
+         <tracetype
+               applies="true"
+               class="org.eclipse.tracecompass.tmf.core.trace.TmfTrace">
+         </tracetype>
+      </module>
+   </extension>
+
+</plugin>
index 22a842ddaf21de64b50c9e847a9c8a4db13a807e..c4adc6533243c4c1a579f9bdf39977f90bd8bd72 100644 (file)
@@ -38,6 +38,7 @@ 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;
+import org.eclipse.tracecompass.tmf.core.segment.ISegmentAspect;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
@@ -63,7 +64,12 @@ import com.google.common.collect.ImmutableList;
  *
  * @author Sonia Farrah
  */
-public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implements ISegmentStoreProvider {
+public class CallGraphAnalysis extends TmfAbstractAnalysisModule implements ISegmentStoreProvider {
+
+    /**
+     * ID
+     */
+    public static final String ID = "org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.callgraphanalysis"; //$NON-NLS-1$
 
     // ------------------------------------------------------------------------
     // Attributes
@@ -122,6 +128,11 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
         return true;
     }
 
+    @Override
+    public @NonNull Iterable<@NonNull ISegmentAspect> getSegmentAspects() {
+        return Collections.singletonList(SymbolAspect.SYMBOL_ASPECT);
+    }
+
     @Override
     protected Iterable<IAnalysisModule> getDependentAnalyses() {
         return TmfTraceManager.getTraceSet(getTrace()).stream()
@@ -429,4 +440,5 @@ public abstract class CallGraphAnalysis extends TmfAbstractAnalysisModule implem
         }
         return processId;
     }
+
 }
\ No newline at end of file
diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/SymbolAspect.java b/analysis/org.eclipse.tracecompass.analysis.timing.core/src/org/eclipse/tracecompass/internal/analysis/timing/core/callgraph/SymbolAspect.java
new file mode 100644 (file)
index 0000000..0038ee7
--- /dev/null
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * 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;
+
+import java.util.Comparator;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.common.core.NonNullUtils;
+import org.eclipse.tracecompass.segmentstore.core.ISegment;
+import org.eclipse.tracecompass.tmf.core.segment.ISegmentAspect;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
+import org.eclipse.tracecompass.tmf.core.symbols.SymbolProviderManager;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
+
+/**
+ * An aspect used to get the function name of a call stack event or to compare
+ * the duration of two events
+ *
+ * @author Sonia Farrah
+ */
+public final class SymbolAspect implements ISegmentAspect {
+    /**
+     * A symbol aspect
+     */
+    public static final ISegmentAspect SYMBOL_ASPECT = new SymbolAspect();
+
+    /**
+     * Constructor
+     */
+    public SymbolAspect() {
+    }
+
+    @Override
+    public @NonNull String getName() {
+        return NonNullUtils.nullToEmptyString(Messages.CallStack_FunctionName);
+    }
+
+    @Override
+    public @NonNull String getHelpText() {
+        return NonNullUtils.nullToEmptyString(Messages.CallStack_FunctionName);
+    }
+
+    @Override
+    public @Nullable Comparator<?> getComparator() {
+        return new Comparator<ISegment>() {
+            @Override
+            public int compare(@Nullable ISegment o1, @Nullable ISegment o2) {
+                if (o1 == null || o2 == null) {
+                    throw new IllegalArgumentException();
+                }
+                return Long.compare(o1.getLength(), o2.getLength());
+            }
+        };
+    }
+
+    @Override
+    public @Nullable Object resolve(@NonNull ISegment segment) {
+        if (segment instanceof ICalledFunction) {
+            ICalledFunction calledFunction = (ICalledFunction) segment;
+            // FIXME work around this trace
+            ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
+            if (trace != null) {
+                String symbolText;
+                Object symbol = calledFunction.getSymbol();
+                if (symbol instanceof Long) {
+                    Long longAddress = (Long) symbol;
+                    ISymbolProvider provider = SymbolProviderManager.getInstance().getSymbolProvider(trace);
+                    symbolText = provider.getSymbolText(longAddress);
+                    if (symbolText == null) {
+                        return "0x" + Long.toHexString(longAddress); //$NON-NLS-1$
+                    }
+                    // take the start time in the query for the symbol name
+                    long time = segment.getStart();
+                    int pid = calledFunction.getProcessId();
+                    if (pid > 0) {
+                        String text = provider.getSymbolText(pid, time, longAddress);
+                        if (text != null) {
+                            return text;
+                        }
+                    }
+                    return symbolText;
+                }
+                return String.valueOf(symbol);
+            }
+        }
+        return null;
+    }
+}
\ No newline at end of file
index f7eaa3bfff791cb0d8a7ccb110c57d4654b6d758..23104f45087774ca0e0c5e5b3a899a1acffbce19 100644 (file)
@@ -15,5 +15,3 @@ view.execgraph = Execution Graph View
 view.callgraphDensity= Function Durations Distribution
 view.flameGraph= Flame Graph
 view.segstore.table = Segment Store Table
-
-callgraph.analysis = Call Graph Analysis
index 5b9c9c838588bf3232b75bb64c8ce3b50f47a053..af92392f667998ba12751a7a309323bbbc0f027a 100644 (file)
@@ -3,29 +3,18 @@
 <plugin>
    <extension
          point="org.eclipse.linuxtools.tmf.core.analysis">
-      <module
-            analysis_module="org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.CallGraphAnalysisUI"
-            automatic="false"
-            icon="icons/elcl16/callgraph.png"
-            id="org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.callgraphanalysis"
-            name="%callgraph.analysis">
-         <tracetype
-               applies="true"
-               class="org.eclipse.tracecompass.tmf.core.trace.TmfTrace">
-         </tracetype>
-      </module>
       <output
             class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
             id="org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.callgraphDensity">
          <analysisModuleClass
-               class="org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.CallGraphAnalysisUI">
+               class="org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis">
          </analysisModuleClass>
       </output>
       <output
             class="org.eclipse.tracecompass.tmf.ui.analysis.TmfAnalysisViewOutput"
             id="org.eclipse.tracecompass.internal.analysis.timing.ui.flamegraph.flamegraphView">
          <analysisModuleClass
-               class="org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.CallGraphAnalysisUI">
+               class="org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis">
          </analysisModuleClass>
       </output>
    </extension>
diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/CallGraphAnalysisUI.java b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/CallGraphAnalysisUI.java
deleted file mode 100644 (file)
index ee63f08..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * 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.ui.callgraph;
-
-import java.util.Collections;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis;
-import org.eclipse.tracecompass.tmf.core.segment.ISegmentAspect;
-
-/**
- * CallGraph Analysis with aspects
- *
- * @author Sonia Farrah
- */
-public class CallGraphAnalysisUI extends CallGraphAnalysis {
-
-    /**
-     * ID
-     */
-    public static final @NonNull String ID = "org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.callgraphanalysis"; //$NON-NLS-1$
-
-    /**
-     * Default constructor
-     */
-    public CallGraphAnalysisUI() {
-        super();
-    }
-
-    @Override
-    public @NonNull Iterable<@NonNull ISegmentAspect> getSegmentAspects() {
-        return Collections.singletonList(SymbolAspect.SYMBOL_ASPECT);
-    }
-}
index 319e18de2f42a3382f896e73efd362bd1fa45417..08fa2372b8569e56653e4472cec6e6673a675e64 100644 (file)
@@ -37,6 +37,6 @@ public class CallGraphDensityViewer extends AbstractSegmentStoreDensityViewer {
 
     @Override
     protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) {
-        return TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysisUI.ID);
+        return TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID);
     }
 }
\ No newline at end of file
index e45322ea4d6ad6ae1ac7c89a948812d50d3681a0..23d87c9812a7a7a91035476d3f3ee3ae39588cc2 100644 (file)
@@ -50,7 +50,7 @@ public class CallGraphTableViewer extends AbstractSegmentStoreTableViewer {
 
     @Override
     protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) {
-        CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysisUI.ID);
+        CallGraphAnalysis fModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysis.ID);
         if (fModule == null) {
             return null;
         }
diff --git a/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/SymbolAspect.java b/analysis/org.eclipse.tracecompass.analysis.timing.ui/src/org/eclipse/tracecompass/internal/analysis/timing/ui/callgraph/SymbolAspect.java
deleted file mode 100644 (file)
index 0f7631d..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * 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.ui.callgraph;
-
-import java.util.Comparator;
-
-import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.tracecompass.common.core.NonNullUtils;
-import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.ICalledFunction;
-import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.Messages;
-import org.eclipse.tracecompass.segmentstore.core.ISegment;
-import org.eclipse.tracecompass.tmf.core.segment.ISegmentAspect;
-import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
-import org.eclipse.tracecompass.tmf.ui.symbols.SymbolProviderManager;
-
-/**
- * An aspect used to get the function name of a call stack event or to compare
- * the duration of two events
- *
- * @author Sonia Farrah
- */
-public final class SymbolAspect implements ISegmentAspect {
-    /**
-     * A symbol aspect
-     */
-    public static final @NonNull ISegmentAspect SYMBOL_ASPECT = new SymbolAspect();
-
-    /**
-     * Constructor
-     */
-    public SymbolAspect() {
-    }
-
-    @Override
-    public @NonNull String getName() {
-        return NonNullUtils.nullToEmptyString(Messages.CallStack_FunctionName);
-    }
-
-    @Override
-    public @NonNull String getHelpText() {
-        return NonNullUtils.nullToEmptyString(Messages.CallStack_FunctionName);
-    }
-
-    @Override
-    public @Nullable Comparator<?> getComparator() {
-        return new Comparator<ISegment>() {
-            @Override
-            public int compare(@Nullable ISegment o1, @Nullable ISegment o2) {
-                if (o1 == null || o2 == null) {
-                    throw new IllegalArgumentException();
-                }
-                return Long.compare(o1.getLength(), o2.getLength());
-            }
-        };
-    }
-
-    @Override
-    public @Nullable Object resolve(@NonNull ISegment segment) {
-        if (segment instanceof ICalledFunction) {
-            ICalledFunction calledFunction = (ICalledFunction) segment;
-            ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace();
-            if (trace != null) {
-                String symbolText;
-                Object symbol = calledFunction.getSymbol();
-                if (symbol instanceof Long) {
-                    Long longAddress = (Long) symbol;
-                    ISymbolProvider provider = SymbolProviderManager.getInstance().getSymbolProvider(trace);
-                    symbolText = provider.getSymbolText(longAddress);
-                    if (symbolText == null) {
-                        return "0x" + Long.toHexString(longAddress); //$NON-NLS-1$
-                    }
-                    // take the start time in the query for the symbol name
-                    long time = segment.getStart();
-                    int pid = calledFunction.getProcessId();
-                    if (pid > 0) {
-                        String text = provider.getSymbolText(pid, time, longAddress);
-                        if (text != null) {
-                            return text;
-                        }
-                    }
-                    return symbolText;
-                }
-                return String.valueOf(symbol);
-            }
-        }
-        return null;
-    }
-}
\ No newline at end of file
index 6f0fe8e7a19cc31f97aefb8d39e606d07676a4f2..5d880514a7d650c3a82f87f699313a4b343ec52c 100644 (file)
@@ -19,10 +19,11 @@ import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.tracecompass.analysis.timing.ui.views.segmentstore.SubSecondTimeWithUnitFormat;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.AggregatedCalledFunctionStatistics;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.ICalledFunction;
+import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.SymbolAspect;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
+import org.eclipse.tracecompass.tmf.core.symbols.SymbolProviderManager;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceManager;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
-import org.eclipse.tracecompass.tmf.ui.symbols.SymbolProviderManager;
 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.StateItem;
 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.model.ITimeEvent;
@@ -130,23 +131,15 @@ public class FlameGraphPresentationProvider extends TimeGraphPresentationProvide
     private static String getFuntionSymbol(FlamegraphEvent event, ISymbolProvider symbolProvider) {
         String funcSymbol = ""; //$NON-NLS-1$
         if (event.getSymbol() instanceof Long || event.getSymbol() instanceof Integer) {
-            long longAddress = ((Long) event.getSymbol()).longValue();
-            funcSymbol = symbolProvider.getSymbolText(longAddress);
-            if (funcSymbol == null) {
-                return "0x" + Long.toHexString(longAddress); //$NON-NLS-1$
-            }
-            // take time of max segment for time a query the symbol name
-            ICalledFunction maxObject = event.getStatistics().getDurationStatistics().getMaxObject();
-            if (maxObject == null) {
+
+            ICalledFunction segment = event.getStatistics().getDurationStatistics().getMinObject();
+            if (segment == null) {
+                long longAddress = ((Long) event.getSymbol()).longValue();
                 return "0x" + Long.toHexString(longAddress); //$NON-NLS-1$
             }
-            long time = maxObject.getStart();
-            int pid = event.getProcessId();
-            if (pid > 0) {
-                String text = symbolProvider.getSymbolText(pid, time, longAddress);
-                if (text != null) {
-                    return text;
-                }
+            Object symbol = SymbolAspect.SYMBOL_ASPECT.resolve(segment);
+            if (symbol != null) {
+                return symbol.toString();
             }
         } else {
             return event.getSymbol().toString();
index 2da1dba663a7a80f7e7f0a13e3798a1c5d749599..76c217747e21ccaab245909b5fa9779e73a11724 100644 (file)
@@ -40,7 +40,6 @@ import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.tracecompass.internal.analysis.timing.core.callgraph.CallGraphAnalysis;
 import org.eclipse.tracecompass.internal.analysis.timing.ui.Activator;
-import org.eclipse.tracecompass.internal.analysis.timing.ui.callgraph.CallGraphAnalysisUI;
 import org.eclipse.tracecompass.segmentstore.core.ISegment;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
 import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
@@ -208,7 +207,7 @@ public class FlameGraphView extends TmfView {
     public void traceSelected(final TmfTraceSelectedSignal signal) {
         fTrace = signal.getTrace();
         if (fTrace != null) {
-            fFlamegraphModule = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, CallGraphAnalysis.class, CallGraphAnalysisUI.ID);
+            fFlamegraphModule = TmfTraceUtils.getAnalysisModuleOfClass(fTrace, CallGraphAnalysis.class, CallGraphAnalysis.ID);
             buildFlameGraph(fFlamegraphModule);
         }
     }
diff --git a/common/org.eclipse.tracecompass.common.core/annotations/java/lang/ref/Reference.eea b/common/org.eclipse.tracecompass.common.core/annotations/java/lang/ref/Reference.eea
new file mode 100644 (file)
index 0000000..0ecf714
--- /dev/null
@@ -0,0 +1,4 @@
+class java/lang/ref/Reference
+get
+ ()TT;
+ ()T0T;
index 130807c2af8561c705794559ac343deffe14816e..4a1f3a997d7aa3d13bdbdd5b55d13f9235fab60d 100644 (file)
@@ -30,7 +30,7 @@
       </output>
    </extension>
    <extension
-         point="org.eclipse.tracecompass.tmf.ui.symbolProvider">
+         point="org.eclipse.tracecompass.tmf.core.symbolProvider">
       <providerFactory
             class="org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.debuginfo.UstDebugInfoSymbolProviderFactory"
             id="org.eclipse.tracecompass.lttng2.ust.ui.analysis.debuginfo.providerFactory"
index 9f1671ced9c4888c24cacc569475c1571f30cc26..f98af9572c1e10df6c347558edb8d96b4a1d3afe 100644 (file)
@@ -18,8 +18,10 @@ import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoB
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoFunctionAspect;
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoSourceAspect;
 import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
+import org.eclipse.tracecompass.tmf.core.event.lookup.ITmfCallsite;
 import org.eclipse.tracecompass.tmf.core.event.lookup.TmfCallsite;
-import org.eclipse.tracecompass.tmf.ui.symbols.DefaultSymbolProvider;
+import org.eclipse.tracecompass.tmf.core.symbols.DefaultSymbolProvider;
+import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
 import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
 
 /**
@@ -28,7 +30,7 @@ import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
  * @author Alexandre Montplaisir
  * @see UstDebugInfoAnalysisModule
  */
-public class UstDebugInfoSymbolProvider extends DefaultSymbolProvider {
+public class UstDebugInfoSymbolProvider extends DefaultSymbolProvider implements ISymbolProvider{
 
     /**
      * Create a new {@link UstDebugInfoSymbolProvider} for the given trace
@@ -84,4 +86,10 @@ public class UstDebugInfoSymbolProvider extends DefaultSymbolProvider {
         return new UstDebugInfoSymbolProviderPreferencePage(this);
     }
 
+    @Deprecated
+    @Override
+    public @Nullable ITmfCallsite getSymbolInfo(long address) {
+        return null;
+    }
+
 }
index c43126dda7b03ccbfbd2c8ffcec65d75abc05c45..aa84bbd948612cd88f2a23969d5c635fa6c6134e 100644 (file)
@@ -12,10 +12,10 @@ package org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.debuginfo;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule;
 import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProviderFactory;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderFactory;
 
 /**
  * Factory to create {@link UstDebugInfoSymbolProvider}. Provided to TMF via
index 5bdd6e2d99c9da060252a7569997f9997f2e2d19..1a9d53a7b479d51ee3919b146daf762993944507 100644 (file)
@@ -18,6 +18,7 @@ extensionpoint.trace_type.name = Tmf Trace Type
 extensionpoint.analysis_module.name = Trace Analysis Module
 extensionpoint.ondemand_analysis.name = On-demand Analysis
 extensionpoint.custom_trace.name = Custom Trace
+extensionpoint.symbol_provider.name = Core Symbol Provider
 
 # Experiment type
 experimenttype.type.generic = Generic Experiment
index 37b90bec9896539d026c899e3d6c5d8abfb804a0..3e9051df4643c64a2e1ad217b28cba49ade73695 100644 (file)
@@ -5,6 +5,7 @@
    <extension-point id="org.eclipse.linuxtools.tmf.core.analysis" name="%extensionpoint.analysis_module.name" schema="schema/org.eclipse.linuxtools.tmf.core.analysis.exsd"/>
    <extension-point id="org.eclipse.tracecompass.tmf.core.analysis.ondemand" name="%extensionpoint.ondemand_analysis.name" schema="schema/org.eclipse.tracecompass.tmf.core.analysis.ondemand.exsd"/>
    <extension-point id="org.eclipse.tracecompass.tmf.core.custom.trace" name="%extensionpoint.custom_trace.name" schema="schema/org.eclipse.tracecompass.tmf.core.custom.trace.exsd"/>
+   <extension-point id="org.eclipse.tracecompass.tmf.core.symbolProvider" name="%extensionpoint.symbol_provider.name" schema="schema/org.eclipse.tracecompass.tmf.core.symbolProvider.exsd"/>
 
    <extension
          point="org.eclipse.core.runtime.preferences">
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/schema/org.eclipse.tracecompass.tmf.core.symbolProvider.exsd b/tmf/org.eclipse.tracecompass.tmf.core/schema/org.eclipse.tracecompass.tmf.core.symbolProvider.exsd
new file mode 100644 (file)
index 0000000..d7013ee
--- /dev/null
@@ -0,0 +1,135 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.tracecompass.tmf.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.eclipse.tracecompass.tmf.core" id="org.eclipse.tracecompass.tmf.core.symbolProvider" name="Core Symbol Provider"/>
+      </appinfo>
+      <documentation>
+         Core symbol provider, provides a symbol factory for a given trace. This extension point can be used to transform from symbol addresses that might be found inside a TmfTrace into human readable texts, for example function names.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence minOccurs="1" maxOccurs="unbounded">
+            <element ref="providerFactory"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="providerFactory">
+      <complexType>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  The name of the class responsible to create an ISymbolProvider
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.eclipse.tracecompass.tmf.core.symbols.ISymbolProviderFactory"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="priority" type="string" use="default" value="50">
+            <annotation>
+               <documentation>
+                  Specify the priority of this factory relative to the other. It should be an integer number. If not defined or not a valid integer it will be assumed to be zero.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The ID of the extension
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         3.0
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         &lt;p&gt;For example, a symbol provider can be initialized with a priority. It is specified in the extension point.
+&lt;/p&gt;
+
+&lt;p&gt;
+The following is an example of the extension point usage:
+&lt;pre&gt;
+  &lt;extension
+         point=&quot;org.eclipse.tracecompass.tmf.core.symbolProvider&quot;&gt;
+      &lt;providerFactory
+            class=&quot;org.myproject.mypackage.mySymbolProviderFactory&quot;
+            id=&quot;org.myproject.mypackage.mySymbolProviderFactory.id&quot;
+            priority=&quot;42&quot;&gt;
+      &lt;/providerFactory&gt;
+   &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         Since 3.0
+
+Symbol providers using this extension point have to specify the symbol provider factory. This class has to implement ISymbolProviderFactory.
+      </documentation>
+   </annotation>
+
+
+   <annotation>
+      <appinfo>
+         <meta.section type="copyright"/>
+      </appinfo>
+      <documentation>
+         Copyright (c) 2017 Ericsson and others
+
+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 &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/DefaultSymbolProvider.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/DefaultSymbolProvider.java
new file mode 100644 (file)
index 0000000..9d9676a
--- /dev/null
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Movidius Inc. and others
+ *
+ * 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.tmf.core.symbols;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * A default implementation of the {@link ISymbolProvider} which return a hex
+ * format representation of the symbol address
+ *
+ * @author Robert Kiss
+ * @since 2.4
+ */
+public class DefaultSymbolProvider implements ISymbolProvider {
+
+    private final ITmfTrace fTrace;
+
+    /**
+     * Create a new provider for the given trace
+     *
+     * @param trace
+     *            the trace
+     */
+    public DefaultSymbolProvider(ITmfTrace trace) {
+        fTrace = trace;
+    }
+
+    @Override
+    public void loadConfiguration(@Nullable IProgressMonitor monitor) {
+        // no configuration here
+    }
+
+    @Override
+    public ITmfTrace getTrace() {
+        return fTrace;
+    }
+
+    /**
+     * Return a hex formated representation of the given address
+     *
+     * @param address
+     *            the symbol address
+     * @return the hex representation of the given address
+     */
+    @Override
+    public @NonNull String getSymbolText(long address) {
+        if ((address & (0xFFFFFFFF << 32)) == 0) {
+            return String.format("%08x", address); //$NON-NLS-1$
+        }
+        return String.format("%016x", address); //$NON-NLS-1$
+    }
+
+}
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/ISymbolProviderFactory.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/ISymbolProviderFactory.java
new file mode 100644 (file)
index 0000000..b35ee47
--- /dev/null
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Movidius Inc. and others
+ *
+ * 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.tmf.core.symbols;
+
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * Instance of this interface can be contributed using the
+ * <code>org.eclipse.tracecompass.tmf.core.symbolProvider</code> extension and is
+ * used to create instances of {@link ISymbolProvider}
+ *
+ * @author Robert Kiss
+ *
+ * @since 2.4
+ */
+public interface ISymbolProviderFactory {
+
+    /**
+     * Create a provider for the given trace. If this factory does not know how
+     * to handle the given trace it will return null;
+     *
+     * @param trace
+     *            A non-null trace
+     * @return A newly created provider that can resolve symbols from the given
+     *         trace or null if no such provider can be created by this factory
+     */
+    @Nullable ISymbolProvider createProvider(ITmfTrace trace);
+
+}
\ No newline at end of file
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/SymbolProviderManager.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/symbols/SymbolProviderManager.java
new file mode 100644 (file)
index 0000000..6d17ff1
--- /dev/null
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2016-2017 Movidius Inc. and others
+ *
+ * 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.tmf.core.symbols;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.tracecompass.internal.tmf.core.Activator;
+import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
+
+/**
+ * This class offer services around the
+ * <code>org.eclipse.tracecompass.tmf.core.symbolProvider</code> extension
+ * point.
+ *
+ * @author Robert Kiss
+ * @since 2.4
+ */
+public final class SymbolProviderManager {
+
+    /**
+     * The singleton instance of this manager
+     */
+    private static @Nullable SymbolProviderManager INSTANCE;
+
+    private static final String OLD_EXTENSION_POINT_ID = "org.eclipse.tracecompass.tmf.ui.symbolProvider"; //$NON-NLS-1$
+    private static final String EXTENSION_POINT_ID = "org.eclipse.tracecompass.tmf.core.symbolProvider"; //$NON-NLS-1$
+    private static final String ELEM_NAME_PROVIDER = "providerFactory"; //$NON-NLS-1$
+    private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
+    private static final String ATTR_PRIORITY = "priority"; //$NON-NLS-1$
+
+    private final List<SymbolProviderFactoryWrapper> fProviders;
+
+    private final Map<ITmfTrace, WeakReference<ISymbolProvider>> fInstances = new WeakHashMap<>();
+
+    /**
+     * Internal class used to store extension point information
+     *
+     */
+    private static class SymbolProviderFactoryWrapper {
+
+        public final ISymbolProviderFactory factory;
+        public final int priority;
+
+        private SymbolProviderFactoryWrapper(ISymbolProviderFactory factory, int priority) {
+            this.factory = factory;
+            this.priority = priority;
+        }
+    }
+
+    /**
+     *
+     * @return the singleton instance of this class
+     */
+    public static synchronized SymbolProviderManager getInstance() {
+        SymbolProviderManager manager = INSTANCE;
+        if (manager == null) {
+            manager = new SymbolProviderManager();
+            INSTANCE = manager;
+        }
+        return manager;
+    }
+
+    /**
+     * The private constructor of this manager
+     */
+    private SymbolProviderManager() {
+        fProviders = new ArrayList<>();
+        load(OLD_EXTENSION_POINT_ID);
+        load(EXTENSION_POINT_ID);
+        // Those with a higher priority need to be on top
+        fProviders.sort(Comparator.comparingLong(o -> -o.priority));
+    }
+
+    private void load(String configElemPath) {
+        IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(configElemPath);
+        for (IConfigurationElement element : configElements) {
+            if (element != null && ELEM_NAME_PROVIDER.equals(element.getName())) {
+                try {
+                    Object extension = checkNotNull(element.createExecutableExtension(ATTR_CLASS));
+                    int priority = 0;
+                    try {
+                        priority = Integer.parseInt(element.getAttribute(ATTR_PRIORITY));
+                    } catch (NumberFormatException e) {
+                        // safe to ignore
+                    }
+                    fProviders.add(new SymbolProviderFactoryWrapper((ISymbolProviderFactory) extension, priority));
+                } catch (CoreException | ClassCastException e) {
+                    Activator.logError("Exception while loading extensions", e); //$NON-NLS-1$
+                }
+            }
+        }
+    }
+
+    /**
+     * Locate an {@link ISymbolProvider} capable to resolve symbols from the
+     * given trace. If no such provider is defined an instance of
+     * {@link DefaultSymbolProvider} will be returned
+     *
+     * @param trace
+     *            The trace to create a provider for
+     * @return a valid {@link ISymbolProvider}, never null
+     */
+    public ISymbolProvider getSymbolProvider(ITmfTrace trace) {
+        // Check to see if we already have a provider for this trace
+        synchronized (fInstances) {
+            WeakReference<ISymbolProvider> reference = fInstances.get(trace);
+            if (reference != null) {
+                ISymbolProvider provider = reference.get();
+                if (provider != null) {
+                    return provider;
+                }
+            }
+            // we don't have yet an instance, build one
+            for (SymbolProviderFactoryWrapper wrapper : fProviders) {
+                ISymbolProviderFactory factory = wrapper.factory;
+                ISymbolProvider provider = factory.createProvider(trace);
+                if (provider != null) {
+                    fInstances.put(trace, new WeakReference<>(provider));
+                    return provider;
+                }
+            }
+        }
+        // No provider found, return the default one
+        return new DefaultSymbolProvider(trace);
+    }
+
+}
index 1ff14c5e624a9e3285f0b0031af8f003fe863206..9d0abcad490b42cb7b6916cdf441e3d1828ed0da 100644 (file)
          </description>
       </colorDefinition>
    </extension>
-   <extension
-         point="org.eclipse.tracecompass.tmf.ui.symbolProvider">
-      <providerFactory
-            class="org.eclipse.tracecompass.internal.tmf.ui.symbols.BasicSymbolProviderFactory"
-            id="org.eclipse.tracecompass.tmf.ui.providerFactory1"
-            priority="0">
-      </providerFactory>
-   </extension>
    <extension
          point="org.eclipse.core.runtime.preferences">
       <initializer
             name="%preferences.page.trace.types">
       </page>
    </extension>
+   <extension
+         point="org.eclipse.tracecompass.tmf.core.symbolProvider">
+      <providerFactory
+            class="org.eclipse.tracecompass.internal.tmf.ui.symbols.BasicSymbolProviderFactory"
+            id="org.eclipse.tracecompass.tmf.ui.providerFactory.basic"
+            priority="0">
+      </providerFactory>
+   </extension>
 </plugin>
index f435ebdf1c1ffb0165add6d1b412201fa12abc3d..24bf15faae4db95b748d8aa19cc095a8cd6cd246 100644 (file)
@@ -13,7 +13,7 @@
    <element name="extension">
       <annotation>
          <appinfo>
-            <meta.element />
+            <meta.element deprecated="true" />
          </appinfo>
       </annotation>
       <complexType>
          <attribute name="point" type="string" use="required">
             <annotation>
                <documentation>
-                  
+
                </documentation>
             </annotation>
          </attribute>
          <attribute name="id" type="string">
             <annotation>
                <documentation>
-                  
+
                </documentation>
             </annotation>
          </attribute>
          <attribute name="name" type="string">
             <annotation>
                <documentation>
-                  
+
                </documentation>
                <appinfo>
                   <meta.attribute translatable="true"/>
@@ -49,6 +49,9 @@
 
    <element name="providerFactory">
       <annotation>
+         <appinfo>
+            <meta.element deprecated="true"/>
+         </appinfo>
          <documentation>
             A symbol provider factory can be used to translate symbol addresses that can be found inside traces into symbol names.
          </documentation>
@@ -74,7 +77,7 @@
          <attribute name="priority" type="string" use="default" value="50">
             <annotation>
                <documentation>
-                  Specify the priority of this factory relativ to the other. It should be an integer number. If not defined or not a valid integer it will be assumed to be zero.
+                  Specify the priority of this factory relative to the other. It should be an integer number. If not defined or not a valid integer it will be assumed to be zero.
                </documentation>
             </annotation>
          </attribute>
index 6fc01be3ab237409bfa9623bb01eb4a5caa1aee3..ed8b0a29da603afbc67cd0e3bfaa7b75e930eecc 100644 (file)
@@ -12,9 +12,9 @@ package org.eclipse.tracecompass.internal.tmf.ui.symbols;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProviderFactory;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderFactory;
 
 /**
  * Basic symbol provider factory that can handle any trace. It will create a
index 9736e5fc372bca7c328a352cfdce054760cc199f..9c50b5e430eea362b2145614ef871daaa0bb66da 100644 (file)
@@ -23,8 +23,9 @@ import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
  *
  * @author Robert Kiss
  * @since 2.0
- *
+ * @deprecated use {@link org.eclipse.tracecompass.tmf.core.symbols.DefaultSymbolProvider}
  */
+@Deprecated
 @NonNullByDefault
 public class DefaultSymbolProvider implements ISymbolProvider {
 
index 6d1cefc1acf7c25492470e9f116deb165b300b59..6d8c779b1b79adaa0e499368cb246e4b05a2eeba 100644 (file)
@@ -30,7 +30,7 @@ public interface ISymbolProviderFactory {
      * to handle the given trace it will return null;
      *
      * @param trace
-     *            A non-null trace
+     *            A trace
      * @return A newly created provider that can resolve symbols from the given
      *         trace or null if no such provider can be created by this factory
      */
index c749992f2c6e3f0b1e2a1e44eb11d4ce398c1a3e..a3bdcf20ba97098b700a24e6ad8912b5ac2abad7 100644 (file)
@@ -32,8 +32,11 @@ import com.google.common.collect.ImmutableList;
  *
  * @author Robert Kiss
  * @since 2.0
- *
+ * @deprecated use
+ *             {@link org.eclipse.tracecompass.tmf.core.symbols.SymbolProviderManager}
+ *             instead
  */
+@Deprecated
 public final class SymbolProviderManager {
 
     /**
@@ -69,6 +72,7 @@ public final class SymbolProviderManager {
 
     /**
      * Get the instance of the {@link SymbolProviderManager}
+     *
      * @return the singleton instance of this class
      */
     @SuppressWarnings("null")
index 17f193d07b86a955251320841c2096cf7d08a54f..a0cdbd1ea85dfb0ebda0717f9e5ae7adfb14ac97 100644 (file)
@@ -24,6 +24,7 @@ import java.util.Map;
 import java.util.function.Consumer;
 
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.jface.action.Action;
@@ -63,6 +64,8 @@ import org.eclipse.tracecompass.tmf.core.signal.TmfSignalHandler;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceClosedSignal;
 import org.eclipse.tracecompass.tmf.core.signal.TmfTraceSelectedSignal;
 import org.eclipse.tracecompass.tmf.core.signal.TmfWindowRangeUpdatedSignal;
+import org.eclipse.tracecompass.tmf.core.symbols.ISymbolProvider;
+import org.eclipse.tracecompass.tmf.core.symbols.SymbolProviderManager;
 import org.eclipse.tracecompass.tmf.core.timestamp.ITmfTimestamp;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestamp;
@@ -70,10 +73,8 @@ import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimestampDelta;
 import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace;
 import org.eclipse.tracecompass.tmf.core.trace.TmfTraceUtils;
 import org.eclipse.tracecompass.tmf.ui.editors.ITmfTraceEditor;
-import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
 import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
 import org.eclipse.tracecompass.tmf.ui.symbols.SymbolProviderConfigDialog;
-import org.eclipse.tracecompass.tmf.ui.symbols.SymbolProviderManager;
 import org.eclipse.tracecompass.tmf.ui.views.timegraph.AbstractTimeGraphView;
 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphTimeListener;
 import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphContentProvider;
@@ -243,8 +244,7 @@ public class CallStackView extends AbstractTimeGraphView {
 
         @Override
         public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
-            return reverse ? o2.getName().compareTo(o1.getName()) :
-                    o1.getName().compareTo(o2.getName());
+            return reverse ? o2.getName().compareTo(o1.getName()) : o1.getName().compareTo(o2.getName());
         }
     }
 
@@ -260,8 +260,7 @@ public class CallStackView extends AbstractTimeGraphView {
             if (o1 instanceof ThreadEntry && o2 instanceof ThreadEntry) {
                 ThreadEntry t1 = (ThreadEntry) o1;
                 ThreadEntry t2 = (ThreadEntry) o2;
-                return reverse ? Long.compare(t2.getThreadId(), t1.getThreadId()) :
-                    Long.compare(t1.getThreadId(), t2.getThreadId());
+                return reverse ? Long.compare(t2.getThreadId(), t1.getThreadId()) : Long.compare(t1.getThreadId(), t2.getThreadId());
             }
             return 0;
         }
@@ -276,8 +275,7 @@ public class CallStackView extends AbstractTimeGraphView {
 
         @Override
         public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
-            return reverse ? Long.compare(o2.getStartTime(), o1.getStartTime()) :
-                    Long.compare(o1.getStartTime(), o2.getStartTime());
+            return reverse ? Long.compare(o2.getStartTime(), o1.getStartTime()) : Long.compare(o1.getStartTime(), o2.getStartTime());
         }
     }
 
@@ -505,8 +503,8 @@ public class CallStackView extends AbstractTimeGraphView {
     @TmfSignalHandler
     public void traceClosed(TmfTraceClosedSignal signal) {
         super.traceClosed(signal);
-        synchronized(fSymbolProviders){
-            for(ITmfTrace trace : getTracesToBuild(signal.getTrace())){
+        synchronized (fSymbolProviders) {
+            for (ITmfTrace trace : getTracesToBuild(signal.getTrace())) {
                 fSymbolProviders.remove(trace);
             }
         }
@@ -535,7 +533,7 @@ public class CallStackView extends AbstractTimeGraphView {
         ISymbolProvider provider = fSymbolProviders.get(trace);
         if (provider == null) {
             provider = SymbolProviderManager.getInstance().getSymbolProvider(trace);
-            provider.loadConfiguration(null);
+            provider.loadConfiguration(new NullProgressMonitor());
             fSymbolProviders.put(trace, provider);
         }
 
@@ -567,7 +565,8 @@ public class CallStackView extends AbstractTimeGraphView {
                 return;
             }
             long end = ss.getCurrentEndTime();
-            if (start == end && !complete) { // when complete execute one last time regardless of end time
+            if (start == end && !complete) { // when complete execute one last
+                                             // time regardless of end time
                 continue;
             }
 
@@ -583,14 +582,16 @@ public class CallStackView extends AbstractTimeGraphView {
 
             try {
                 /*
-                 * Get quarks first to make sure they are in the full query result.
+                 * Get quarks first to make sure they are in the full query
+                 * result.
                  */
                 List<Integer> processQuarks = ss.getQuarks(module.getProcessesPattern());
                 List<ITmfStateInterval> endStates = ss.queryFullState(end);
                 for (int processQuark : processQuarks) {
 
                     /*
-                     * Default to trace entry, overwrite if a process entry exists.
+                     * Default to trace entry, overwrite if a process entry
+                     * exists.
                      */
                     TimeGraphEntry threadParent = traceEntry;
                     int processId = -1;
@@ -644,19 +645,26 @@ public class CallStackView extends AbstractTimeGraphView {
                             threadEnd = endInterval.getStartTime();
                         }
                         /*
-                         * Default to process/trace entry, overwrite if a thread entry exists.
+                         * Default to process/trace entry, overwrite if a thread
+                         * entry exists.
                          */
                         TimeGraphEntry callStackParent = threadParent;
                         if (threadQuark != processQuark) {
                             ThreadEntry threadEntry = threadEntryMap.get(threadQuark);
                             if (threadEntry == null) {
                                 if (startStates == null || callStackQuark >= startStates.size()) {
-                                    /* attribute created after previous full query */
+                                    /*
+                                     * attribute created after previous full
+                                     * query
+                                     */
                                     startStates = ss.queryFullState(ss.getStartTime());
                                 }
                                 long threadId = -1;
                                 if (threadQuark >= endStates.size()) {
-                                    /* attribute created after previous full query */
+                                    /*
+                                     * attribute created after previous full
+                                     * query
+                                     */
                                     endStates = ss.queryFullState(end);
                                 }
                                 ITmfStateValue threadStateValue = endStates.get(threadQuark).getStateValue();
@@ -680,7 +688,10 @@ public class CallStackView extends AbstractTimeGraphView {
                             } else {
                                 threadEntry.updateEndTime(threadEnd);
                             }
-                            /* The parent of the call stack entries will be a thread */
+                            /*
+                             * The parent of the call stack entries will be a
+                             * thread
+                             */
                             callStackParent = threadEntry;
                         }
                         int level = 1;
@@ -1072,8 +1083,7 @@ public class CallStackView extends AbstractTimeGraphView {
          * Since we cannot know the exact analysis ID (in separate plugins), we
          * will search using the analysis type.
          */
-        Iterable<CallStackAnalysis> modules =
-                TmfTraceUtils.getAnalysisModulesOfClass(trace, CallStackAnalysis.class);
+        Iterable<CallStackAnalysis> modules = TmfTraceUtils.getAnalysisModulesOfClass(trace, CallStackAnalysis.class);
         Iterator<CallStackAnalysis> it = modules.iterator();
         if (!it.hasNext()) {
             /* This trace does not provide a call-stack analysis */
@@ -1260,8 +1270,9 @@ public class CallStackView extends AbstractTimeGraphView {
         if (trace != null) {
             for (ITmfTrace subTrace : getTracesToBuild(trace)) {
                 ISymbolProvider provider = fSymbolProviders.get(subTrace);
-                if (provider != null) {
-                    ISymbolProviderPreferencePage page = provider.createPreferencePage();
+                if (provider instanceof org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider) {
+                    org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider provider2 = (org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider) provider;
+                    ISymbolProviderPreferencePage page = provider2.createPreferencePage();
                     if (page != null) {
                         pages.add(page);
                     }
This page took 0.048949 seconds and 5 git commands to generate.