Search in sources :

Example 6 with LttngUstTrace

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

the class UstDebugInfoAnalysisModule method canExecute.

@Override
public boolean canExecute(ITmfTrace trace) {
    /* The analysis can only work with LTTng-UST traces... */
    if (!(trace instanceof LttngUstTrace)) {
        return false;
    }
    LttngUstTrace ustTrace = (LttngUstTrace) trace;
    String tracerName = CtfUtils.getTracerName(ustTrace);
    int majorVersion = CtfUtils.getTracerMajorVersion(ustTrace);
    int minorVersion = CtfUtils.getTracerMinorVersion(ustTrace);
    /* ... taken with UST >= 2.8 ... */
    if (!LttngUstTrace.TRACER_NAME.equals(tracerName)) {
        return false;
    }
    if (majorVersion < 2) {
        return false;
    }
    if (majorVersion == 2 && minorVersion < 8) {
        return false;
    }
    /* ... that respect the ip/vpid contexts requirements. */
    return super.canExecute(trace);
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace)

Example 7 with LttngUstTrace

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

the class UstDebugInfoBinaryAspect method resolve.

@Override
@Nullable
public BinaryCallsite resolve(ITmfEvent event) {
    /* This aspect only supports UST traces */
    if (!(event.getTrace() instanceof LttngUstTrace)) {
        return null;
    }
    LttngUstTrace trace = (LttngUstTrace) event.getTrace();
    ILttngUstEventLayout layout = trace.getEventLayout();
    /* We need both the vpid and ip contexts */
    ITmfEventField vpidField = event.getContent().getField(layout.contextVpid());
    ITmfEventField ipField = event.getContent().getField(layout.contextIp());
    if (ipField == null) {
        ipField = event.getContent().getField(layout.fieldAddr());
    }
    if (vpidField == null || ipField == null) {
        return null;
    }
    Long vpid = (Long) vpidField.getValue();
    Long ip = (Long) ipField.getValue();
    long ts = event.getTimestamp().toNanos();
    return getBinaryCallsite(trace, vpid.intValue(), ts, ip.longValue());
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) ITmfEventField(org.eclipse.tracecompass.tmf.core.event.ITmfEventField) ILttngUstEventLayout(org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout) Nullable(org.eclipse.jdt.annotation.Nullable)

Example 8 with LttngUstTrace

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

the class UstDebugInfoSymbolProviderPreferencePage method saveConfiguration.

@Override
public void saveConfiguration() {
    SymbolProviderConfig config = new SymbolProviderConfig(getCurrentCheckBoxState(), getCurrentPathPrefix());
    LttngUstTrace trace = getSymbolProvider().getTrace();
    trace.setSymbolProviderConfig(config);
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) SymbolProviderConfig(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace.SymbolProviderConfig)

Example 9 with LttngUstTrace

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

the class MarkerSetSwtBotTest method setUp.

/**
 * Set up the test context and environment
 */
@BeforeClass
public static void setUp() {
    SWTBotUtils.initialize();
    /* set up for swtbot */
    SWTBotPreferences.TIMEOUT = 10000;
    /* 10 second timeout */
    SWTBotPreferences.KEYBOARD_LAYOUT = "EN_US";
    fBot = new SWTWorkbenchBot();
    SWTBotUtils.createProject(TRACE_PROJECT_NAME);
    WaitUtils.waitForJobs();
    final CtfTestTrace cygProfile = CtfTestTrace.CYG_PROFILE;
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(cygProfile);
    fStart = ((CtfTmfTrace) trace).getStartTime().toNanos();
    fFullRange = new TmfTimeRange(TmfTimestamp.fromNanos(fStart), TmfTimestamp.fromNanos(fStart + 100l));
    final File file = new File(trace.getPath());
    LttngUstTestTraceUtils.dispose(cygProfile);
    SWTBotUtils.openTrace(TRACE_PROJECT_NAME, file.getAbsolutePath(), UST_ID);
    SWTBotUtils.openView(FlameChartView.ID);
    fViewBot = fBot.viewByTitle("Flame Chart");
    WaitUtils.waitForJobs();
}
Also used : LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) SWTWorkbenchBot(org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot) TmfTimeRange(org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange) File(java.io.File) CtfTmfTrace(org.eclipse.tracecompass.tmf.ctf.core.trace.CtfTmfTrace) CtfTestTrace(org.eclipse.tracecompass.testtraces.ctf.CtfTestTrace) BeforeClass(org.junit.BeforeClass)

Example 10 with LttngUstTrace

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

the class UstDebugInfoAnalysisModuleTest method testBuildIDDebugLink.

/**
 * Test the analysis with a trace with debug_link information.
 */
@Test
public void testBuildIDDebugLink() {
    UstDebugInfoLoadedBinaryFile matchingFile, expected;
    LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(SYNTH_BUILDID_DEBUGLINK_TRACE);
    executeModule(trace);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/foo_nn", null, null, false);
    matchingFile = fModule.getMatchingFile(17000000, 1337, 0x400100);
    assertEquals(expected, matchingFile);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/foo_yn", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", null, false);
    matchingFile = fModule.getMatchingFile(18000000, 1338, 0x400100);
    assertEquals(expected, matchingFile);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/foo_ny", null, "/tmp/debug_link1", false);
    matchingFile = fModule.getMatchingFile(19000000, 1339, 0x400100);
    assertEquals(expected, matchingFile);
    expected = new UstDebugInfoLoadedBinaryFile(0x400000, "/tmp/foo_yy", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "/tmp/debug_link2", false);
    matchingFile = fModule.getMatchingFile(20000000, 1340, 0x400100);
    assertEquals(expected, matchingFile);
    LttngUstTestTraceUtils.dispose(SYNTH_BUILDID_DEBUGLINK_TRACE);
}
Also used : UstDebugInfoLoadedBinaryFile(org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoLoadedBinaryFile) LttngUstTrace(org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace) Test(org.junit.Test)

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