use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.
the class TmfExperimentTest method testSeekNoTrace.
@Test
public void testSeekNoTrace() {
TmfExperiment experiment = new TmfExperiment(ITmfEvent.class, EXPERIMENT, null, TmfExperiment.DEFAULT_INDEX_PAGE_SIZE, null);
ITmfContext context = experiment.seekEvent((TmfExperimentLocation) null);
validateContextRanks(context);
experiment.dispose();
}
use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.
the class DataProviderManagerTest method init.
/**
* Test Class setup
*/
@BeforeClass
public static void init() {
DataProviderManager.getInstance();
// Open kernel trace
fKernelTrace = LttngKernelTestTraceUtils.getTrace(CtfTestTrace.KERNEL);
// Open UST trace
fUstTrace = LttngUstTestTraceUtils.getTrace(CtfTestTrace.CYG_PROFILE);
// Open experiment with kernel and UST trace
ITmfTrace[] traces = { fKernelTrace, fUstTrace };
fExperiment = new TmfExperiment(ITmfEvent.class, "TextExperiment", traces, TmfExperiment.DEFAULT_INDEX_PAGE_SIZE, null);
TmfTraceOpenedSignal openTraceSignal = new TmfTraceOpenedSignal(fExperiment, fExperiment, null);
TmfSignalManager.dispatchSignal(openTraceSignal);
fExperiment.indexTrace(true);
}
use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.
the class TmfTraceTest method testGetUUID.
/**
* Test getUUID()
*
* @throws TmfTraceException
* won't happen
*/
@Test
public void testGetUUID() throws TmfTraceException {
TmfTraceStub trace = null;
trace = new TmfTraceStub(TEST_TRACE.getFullPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
// UUIDs should be seen as hashcodes, a match heavily implies that the
// traces are the same.
// Here we confirm two traces pointing to the same file return the same
// UUID. The UUID is not hardcoded as it will change from one machine to
// another depending on the checkout date.
assertEquals(fTrace.getUUID(), trace.getUUID());
trace.dispose();
// Here the trace file is different. The UUID should no longer be the
// same.
trace = new TmfTraceStub(TmfTestTrace.A_TEST_10K2.getFullPath(), ITmfTrace.DEFAULT_TRACE_CACHE_SIZE, false, null);
assertNotEquals(fTrace.getUUID(), trace.getUUID());
ITmfTrace[] traces = { fTrace, trace };
TmfExperiment exp = new TmfExperiment(ITmfEvent.class, "", traces, 1, null);
assertNotEquals(fTrace.getUUID(), exp.getUUID());
trace.dispose();
exp.dispose();
}
use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.
the class TmfAnalysisModuleHelperConfigElement method newModule.
@Override
public IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException {
/* Check if it applies to trace itself */
Boolean applies = appliesToTraceClass(trace.getClass());
/*
* If the trace is an experiment, check if this module would apply to an
* experiment should it apply to one of its traces.
*/
if (applies == null && (trace instanceof TmfExperiment) && appliesToExperiment()) {
for (ITmfTrace expTrace : TmfTraceManager.getTraceSet(trace)) {
if (appliesToTraceClass(expTrace.getClass()) == Boolean.TRUE) {
applies = true;
break;
}
}
}
if (applies != Boolean.TRUE) {
return null;
}
IAnalysisModule module = createModule();
if (module == null) {
return null;
}
module.setAutomatic(isAutomatic());
/* Get the module's parameters */
final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM);
for (IConfigurationElement element : parametersCE) {
String paramName = element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR);
if (paramName == null) {
continue;
}
module.addParameter(paramName);
String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR);
if (defaultValue != null) {
module.setParameter(paramName, defaultValue);
}
}
if (module.setTrace(trace)) {
TmfAnalysisManager.analysisModuleCreated(module);
} else {
module.dispose();
module = null;
}
return module;
}
use of org.eclipse.tracecompass.tmf.core.trace.experiment.TmfExperiment in project tracecompass by tracecompass.
the class CallStackDataProviderFactoryTest method setup.
/**
* Test class setup
*/
@BeforeClass
public static void setup() {
fTraceData1 = new TestDataSmallCallStack();
fTraceData2 = new TestDataBigCallStack();
TmfXmlTraceStub trace1 = (TmfXmlTraceStub) fTraceData1.getTrace();
TmfXmlTraceStub trace2 = (TmfXmlTraceStub) fTraceData2.getTrace();
CallStackAnalysisStub module = TmfTraceUtils.getAnalysisModuleOfClass(trace1, CallStackAnalysisStub.class, CallStackAnalysisStub.ID);
assertNotNull(module);
module = TmfTraceUtils.getAnalysisModuleOfClass(trace2, CallStackAnalysisStub.class, CallStackAnalysisStub.ID);
assertNotNull(module);
ITmfTrace[] traces = new ITmfTrace[1];
traces[0] = trace1;
fExperimentSingleTrace = new TmfExperiment(ITmfEvent.class, "experiment", traces, 1000, null);
traces = new ITmfTrace[2];
traces[0] = trace1;
traces[1] = trace2;
fExperiment = new TmfExperiment(ITmfEvent.class, "experiment", traces, 1000, null);
fFactory = new CallStackDataProviderFactory();
}
Aggregations