lttng2.ust: remove deprecated code
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.ust.core / src / org / eclipse / tracecompass / lttng2 / ust / core / analysis / debuginfo / UstDebugInfoSourceAspect.java
index 98c0fd4a48046bf7a6d7756aa270cf17c9daefc4..71e39e25e25d3adf8817142811f4880de11611ed 100644 (file)
@@ -20,16 +20,14 @@ import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
 import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
 import org.eclipse.tracecompass.tmf.core.event.lookup.TmfCallsite;
 
-import com.google.common.collect.Iterables;
-
 /**
  * Event aspect of UST traces to generate a {@link TmfCallsite} using the debug
  * info analysis and the IP (instruction pointer) context.
  *
  * @author Alexandre Montplaisir
- * @since 2.0
+ * @since 3.0
  */
-public class UstDebugInfoSourceAspect implements ITmfEventAspect<SourceCallsite> {
+public class UstDebugInfoSourceAspect implements ITmfEventAspect<TmfCallsite> {
 
     /** Singleton instance */
     public static final UstDebugInfoSourceAspect INSTANCE = new UstDebugInfoSourceAspect();
@@ -46,8 +44,11 @@ public class UstDebugInfoSourceAspect implements ITmfEventAspect<SourceCallsite>
         return nullToEmptyString(Messages.UstDebugInfoAnalysis_SourceAspectHelpText);
     }
 
+    /**
+     * @since 2.1
+     */
     @Override
-    public @Nullable SourceCallsite resolve(ITmfEvent event) {
+    public @Nullable TmfCallsite resolve(ITmfEvent event) {
         /* This aspect only supports UST traces */
         if (!(event.getTrace() instanceof LttngUstTrace)) {
             return null;
@@ -63,35 +64,13 @@ public class UstDebugInfoSourceAspect implements ITmfEventAspect<SourceCallsite>
             return null;
         }
 
-        return getSourceCallsite(trace, bc);
-    }
-
-    /**
-     * Get the source callsite (the full {@link TmfCallsite} information) from a
-     * binary callsite.
-     *
-     * @param trace
-     *            The trace, which may contain trace-specific configuration
-     * @param bc
-     *            The binary callsite
-     * @return The source callsite, which sould include file name, function name
-     *         and line number
-     */
-    public static @Nullable SourceCallsite getSourceCallsite(LttngUstTrace trace, BinaryCallsite bc) {
-        Iterable<SourceCallsite> callsites = FileOffsetMapper.getCallsiteFromOffset(
+        TmfCallsite callsite = FileOffsetMapper.getCallsiteFromOffset(
                 new File(bc.getBinaryFilePath()),
                 bc.getBuildId(),
                 bc.getOffset());
-
-        if (callsites == null || Iterables.isEmpty(callsites)) {
+        if (callsite == null) {
             return null;
         }
-        /*
-         * TMF only supports the notion of one callsite per event at the moment.
-         * We will take the "deepest" one in the stack, which should refer to
-         * the initial, non-inlined location.
-         */
-        SourceCallsite callsite = Iterables.getLast(callsites);
 
         /*
          * Apply the path prefix again, this time on the path given from
@@ -103,6 +82,6 @@ public class UstDebugInfoSourceAspect implements ITmfEventAspect<SourceCallsite>
         }
 
         String fullFileName = (pathPrefix + callsite.getFileName());
-        return new SourceCallsite(fullFileName, callsite.getFunctionName(), callsite.getLineNumber());
+        return new TmfCallsite(fullFileName, callsite.getLineNo());
     }
 }
This page took 0.025679 seconds and 5 git commands to generate.