use of org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstEvent in project tracecompass by tracecompass.
the class UstDebugInfoAnalysisModuleTest method testBinaryCallsites.
/**
* Test that the binary callsite aspect resolves correctly for some
* user-defined tracepoints in the trace.
*
* These should be available even without the binaries with debug symbols
* being present on the system.
*/
@Test
public void testBinaryCallsites() {
LttngUstTrace trace = LttngUstTestTraceUtils.getTrace(REAL_TEST_TRACE);
/*
* Fake a "trace opened" signal, so that the relevant analyses are
* started.
*/
TmfTraceOpenedSignal signal = new TmfTraceOpenedSignal(this, trace, null);
TmfSignalManager.dispatchSignal(signal);
UstDebugInfoAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace, UstDebugInfoAnalysisModule.class, UstDebugInfoAnalysisModule.ID);
assertNotNull(module);
module.waitForCompletion();
/* Send a request to get the 3 events we are interested in */
List<@NonNull LttngUstEvent> events = new ArrayList<>();
TmfEventRequest request = new TmfEventRequest(LttngUstEvent.class, 31, 1, ExecutionType.FOREGROUND) {
@Override
public void handleData(ITmfEvent event) {
super.handleData(event);
events.add((LttngUstEvent) event);
}
};
trace.sendRequest(request);
try {
request.waitForCompletion();
} catch (InterruptedException e) {
fail(e.getMessage());
}
/* Tests that the aspects are resolved correctly */
final UstDebugInfoBinaryAspect aspect = UstDebugInfoBinaryAspect.INSTANCE;
String actual = checkNotNull(aspect.resolve(events.get(0))).toString();
String expected = "/home/simark/src/babeltrace/tests/debug-info-data/libhello_so+0x14d4";
assertEquals(expected, actual);
LttngUstTestTraceUtils.dispose(REAL_TEST_TRACE);
}
Aggregations