tmf: Add the notions of timestamp and PID to ISymbolProvider
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Tue, 5 Apr 2016 19:44:37 +0000 (15:44 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Sat, 9 Apr 2016 11:15:20 +0000 (07:15 -0400)
To support completely generic symbol resolution, the methods in
ISymbolProvider needs to consider two new concepts: the timestamp
of the query, and the process ID.

Process ID:
  One trace can contain events from multiple processes. Even if
  they all execute the same executable, the memory addresses, being
  virtual, are specific to each process. The provider may need to know
  the query is for which process in particular.

Timestamp:
  Since libraries can be loaded and unloaded at runtime, with calls to
  dlopen() and dlclose() for example, one address may refer to
  different libraries at different moments in a trace. The provider
  then needs to know the timestamp of the query, so it can refer to the
  correct library if needed.

To ease the transition, we can introduce the new method as default
methods that will ignore the new parameters by default.

Change-Id: I6ec8aa5d97c690d84a9864af15f99a3ec9f4aa3d
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/69969
Reviewed-by: Hudson CI
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProvider.java

index cd19ef4dafb1cc134572ff089604ff5470339e16..f3311a0cb222d5dec97be16ef7d2951ae3869e70 100644 (file)
@@ -24,7 +24,6 @@ import org.eclipse.tracecompass.tmf.core.trace.TmfTrace;
  * @author Robert Kiss
  * @since 2.0
  * @see ISymbolProviderFactory
- *
  */
 public interface ISymbolProvider {
 
@@ -66,6 +65,39 @@ public interface ISymbolProvider {
      */
     @Nullable ITmfCallsite getSymbolInfo(long address);
 
+    /**
+     * Return the symbol text corresponding to the given pid/timestamp/address
+     * tuple, or null if there is no such symbol.
+     *
+     * @param pid
+     *            The process Id for which to query
+     * @param timestamp
+     *            The timestamp of the query
+     * @param address
+     *            the address of the symbol
+     * @return the symbol text or null if the symbol cannot be found
+     */
+    default @Nullable String getSymbolText(int pid, long timestamp, long address) {
+        return getSymbolText(address);
+    }
+
+    /**
+     * Return additional information regarding the symbol from the given
+     * pid/timestamp/address tuple, or null if the symbol cannot be found.
+     *
+     * @param pid
+     *            The process Id for which to query
+     * @param timestamp
+     *            The timestamp of the query
+     * @param address
+     *            the address of the symbol
+     * @return the symbol {@link ITmfCallsite} information or null if the symbol
+     *         cannot be found
+     */
+    default @Nullable ITmfCallsite getSymbolInfo(int pid, long timestamp, long address) {
+        return getSymbolInfo(address);
+    }
+
     /**
      * Create the {@link ISymbolProviderPreferencePage} that can be used to
      * configure this {@link ISymbolProvider}
This page took 0.02581 seconds and 5 git commands to generate.