/** * Setup the trace for the tests and return the InputOutputAnalysisModule, not executed. * * @param fileName The file name of the trace to open * @return The input output analysis module */ protected @NonNull InputOutputAnalysisModule setUp(String fileName) { TmfXmlKernelTraceStub trace = new TmfXmlKernelTraceStub(); trace.addEventAspect(KernelTidAspect.INSTANCE); trace.setKernelEventLayout(EVENT_LAYOUT); IPath filePath = Activator.getAbsoluteFilePath(IO_FILE_PATH + fileName); IStatus status = trace.validate(null, filePath.toOSString()); if (!status.isOK()) { fail(status.getException().getMessage()); } try { trace.initTrace(null, filePath.toOSString(), TmfEvent.class); } catch (TmfTraceException e) { fail(e.getMessage()); } deleteSuppFiles(trace); ((TmfTrace) trace).traceOpened(new TmfTraceOpenedSignal(this, trace, null)); fTrace = trace; /* Start the kernel analysis module */ KernelAnalysisModule kernelMod = TmfTraceUtils.getAnalysisModuleOfClass( trace, KernelAnalysisModule.class, KernelAnalysisModule.ID); assertNotNull(kernelMod); kernelMod.schedule(); kernelMod.waitForCompletion(); InputOutputAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass( trace, InputOutputAnalysisModule.class, InputOutputAnalysisModule.ID); assertNotNull(module); return module; }
@Override protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { return TmfTraceUtils.getAnalysisModuleOfClass( trace, CallGraphAnalysis.class, CallGraphAnalysisUI.ID); }