Search in sources :

Example 16 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstDebugInfoSourceAspect method resolve.

/**
 * @since 2.1
 */
@Override
@Nullable
public TmfCallsite resolve(ITmfEvent event) {
    /* This aspect only supports UST traces */
    if (!(event.getTrace() instanceof LttngUstTrace)) {
        return null;
    }
    LttngUstTrace trace = (LttngUstTrace) event.getTrace();
    /*
         * Resolve the binary callsite first, from there we can use the file's
         * debug information if it is present.
         */
    BinaryCallsite bc = UstDebugInfoBinaryAspect.INSTANCE.resolve(event);
    if (bc == null) {
        return null;
    }
    TmfCallsite callsite = FileOffsetMapper.getCallsiteFromOffset(new File(bc.getBinaryFilePath()), bc.getBuildId(), bc.getOffset());
    if (callsite == null) {
        return null;
    }
    /*
         * Apply the path prefix again, this time on the path given from
         * addr2line. If applicable.
         */
    String pathPrefix = trace.getSymbolProviderConfig().getActualRootDirPath();
    if (pathPrefix.isEmpty()) {
        return callsite;
    }
    String fullFileName = (pathPrefix + callsite.getFileName());
    return new TmfCallsite(fullFileName, callsite.getLineNo());
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) TmfCallsite(org.eclipse.tracecompass.tmf.core.event.lookup.TmfCallsite) NonNullUtils.nullToEmptyString(org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString) File(java.io.File) Nullable(org.eclipse.jdt.annotation.Nullable)

Example 17 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class LttngUstCallStackAnalysis method getAnalysisRequirements.

@Override
@NonNull
public Iterable<@NonNull TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
    Set<@NonNull TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements;
    if (requirements == null) {
        LttngUstTrace trace = getTrace();
        ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT;
        if (trace != null) {
            layout = trace.getEventLayout();
        }
        requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout));
        fAnalysisRequirements = requirements;
    }
    return requirements;
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) TmfAbstractAnalysisRequirement(org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement) ILttngUstEventLayout(org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout) NonNull(org.eclipse.jdt.annotation.NonNull)

Example 18 with LttngUstTrace

use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace in project tracecompass by tracecompass.

the class UstDebugInfoSymbolProviderPreferencePage method loadCurrentSettings.

private void loadCurrentSettings() {
    /* The settings are currently stored in the trace object */
    LttngUstTrace trace = getSymbolProvider().getTrace();
    SymbolProviderConfig config = trace.getSymbolProviderConfig();
    checkNotNull(fUseCustomDirectoryCheckbox).setSelection(config.useCustomRootDir());
    checkNotNull(fCustomDirectoryPath).setText(config.getCustomRootDirPath());
    updateContents();
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) SymbolProviderConfig(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace.SymbolProviderConfig)

Aggregations

LttngUstTrace (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace)18 Test (org.junit.Test)8 UstDebugInfoLoadedBinaryFile (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoLoadedBinaryFile)3 ILttngUstEventLayout (org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout)3 File (java.io.File)2 NonNull (org.eclipse.jdt.annotation.NonNull)2 Nullable (org.eclipse.jdt.annotation.Nullable)2 NonNullUtils.nullToEmptyString (org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString)2 SymbolProviderConfig (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace.SymbolProviderConfig)2 CtfTestTrace (org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace)2 TmfAbstractAnalysisRequirement (org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAbstractAnalysisRequirement)2 ArrayList (java.util.ArrayList)1 SWTWorkbenchBot (org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot)1 UstDebugInfoAnalysisModule (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule)1 UstDebugInfoBinaryAspect (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect)1 UstDebugInfoBinaryFile (org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryFile)1 LttngUstEvent (org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstEvent)1 ITmfStateSystem (org.eclipse.tracecompass.statesystem.core.ITmfStateSystem)1 TmfAnalysisEventRequirement (org.eclipse.tracecompass.tmf.core.analysis.requirements.TmfAnalysisEventRequirement)1 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)1