use of org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout in project tracecompass by tracecompass.
the class LTTngUstCallStackAnalysisRequirementTest method testCallStackRequirements.
/**
* Test Call Stack Analysis requirements
*/
@Test
public void testCallStackRequirements() {
ILttngUstEventLayout defaultLayout = ILttngUstEventLayout.DEFAULT_LAYOUT;
assertNotNull(defaultLayout);
LttngUstCallStackAnalysisRequirement req = new LttngUstCallStackAnalysisRequirement(defaultLayout);
for (TestData item : TestData.values()) {
assertEquals(item.name(), item.isValid(), req.test(item.getTrace()));
}
}
use of org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout 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());
}
use of org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout in project tracecompass by tracecompass.
the class UstMemoryAnalysisModule method getAnalysisRequirements.
@Override
public Iterable<TmfAbstractAnalysisRequirement> getAnalysisRequirements() {
Set<TmfAbstractAnalysisRequirement> requirements = fAnalysisRequirements;
if (requirements == null) {
ITmfTrace trace = getTrace();
ILttngUstEventLayout layout;
if (!(trace instanceof LttngUstTrace)) {
layout = ILttngUstEventLayout.DEFAULT_LAYOUT;
} else {
layout = ((LttngUstTrace) trace).getEventLayout();
}
@NonNull Set<@NonNull String> requiredEvents = ImmutableSet.of(layout.eventLibcMalloc(), layout.eventLibcFree(), layout.eventLibcCalloc(), layout.eventLibcRealloc(), layout.eventLibcMemalign(), layout.eventLibcPosixMemalign());
/* Initialize the requirements for the analysis: domain and events */
TmfAbstractAnalysisRequirement eventsReq = new TmfAnalysisEventRequirement(requiredEvents, PriorityLevel.MANDATORY);
/*
* In order to have these events, the libc wrapper with probes should be
* loaded
*/
eventsReq.addInformation(nullToEmptyString(Messages.UstMemoryAnalysisModule_EventsLoadingInformation));
eventsReq.addInformation(nullToEmptyString(Messages.UstMemoryAnalysisModule_EventsLoadingExampleInformation));
/* The domain type of the analysis */
// FIXME: The domain requirement should have a way to be verified. It is useless otherwise
// TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(nullToEmptyString(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN));
// domainReq.addValue(nullToEmptyString(SessionConfigStrings.CONFIG_DOMAIN_TYPE_UST), ValuePriorityLevel.MANDATORY);
requirements = ImmutableSet.of(eventsReq);
fAnalysisRequirements = requirements;
}
return requirements;
}
use of org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout in project tracecompass by tracecompass.
the class LttngUstTrace method initTrace.
@Override
public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> eventType) throws TmfTraceException {
super.initTrace(resource, path, eventType);
/* Determine the event layout to use from the tracer's version */
ILttngUstEventLayout layout = getLayoutFromEnv();
fLayout = layout;
ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder();
builder.addAll(LTTNG_UST_ASPECTS);
if (checkFieldPresent(layout.contextVtid())) {
builder.add(new ContextVtidAspect(layout));
}
if (checkFieldPresent(layout.contextVpid())) {
builder.add(new ContextVpidAspect(layout));
}
if (getContainedEventTypes().stream().anyMatch(potentialEvent -> potentialEvent.getName().startsWith(layout.eventTracefPrefix()))) {
builder.add(UstTracefAspect.getInstance());
}
builder.addAll(createCounterAspects(this));
fUstTraceAspects = builder.build();
}
use of org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout 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;
}
Aggregations