import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
import java.util.Collection;
+import java.util.Collections;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
}
private static Collection<TmfAbstractAnalysisRequirement> getSubRequirements(ILttngUstEventLayout layout) {
- Set<@NonNull String> requiredEventsFields = ImmutableSet.of(
- layout.contextProcname(),
- layout.contextVtid());
+ Set<@NonNull String> requiredEventsFields = Collections.singleton(layout.contextVtid());
// Requirement for the cyg_profile events
TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement(
import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
return false;
}
ITmfEventField content = ((CtfTmfEvent) event).getContent();
- if (content.getField(fLayout.contextVtid()) == null ||
- content.getField(fLayout.contextProcname()) == null) {
+ if (content.getField(fLayout.contextVtid()) == null) {
return false;
}
return true;
public @Nullable String getThreadName(ITmfEvent event) {
/* We checked earlier that the "procname" context is present */
ITmfEventField content = event.getContent();
- String procName = (String) content.getField(fLayout.contextProcname()).getValue();
+ ITmfEventField field = content.getField(fLayout.contextProcname());
+ String procName = field == null ? StringUtils.EMPTY : (String.valueOf(field.getValue()) + '-');
long vtid = getThreadId(event);
- return (procName + '-' + Long.toString(vtid));
+ return (procName + Long.toString(vtid));
}
}