package org.eclipse.tracecompass.internal.analysis.os.linux.core.kernel.handlers;
-import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
-import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.StateValues;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernel.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernel.StateValues;
import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
Integer parentTid = ((Long) content.getField(getLayout().fieldParentTid()).getValue()).intValue();
Integer childTid = ((Long) content.getField(getLayout().fieldChildTid()).getValue()).intValue();
- Integer parentTidNode = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeThreads(ss), parentTid.toString());
- Integer childTidNode = ss.getQuarkRelativeAndAdd(KernelEventHandlerUtils.getNodeThreads(ss), childTid.toString());
+ final int threadsNode = KernelEventHandlerUtils.getNodeThreads(ss);
+ Integer parentTidNode = ss.getQuarkRelativeAndAdd(threadsNode, parentTid.toString());
+ Integer childTidNode = ss.getQuarkRelativeAndAdd(threadsNode, childTid.toString());
/* Assign the PPID to the new process */
int quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.PPID);
/* Set the process' syscall name, to be the same as the parent's */
quark = ss.getQuarkRelativeAndAdd(parentTidNode, Attributes.SYSTEM_CALL);
value = ss.queryOngoingState(quark);
- if (value.isNull()) {
- /*
- * Maybe we were missing info about the parent? At least we will set
- * the child right. Let's suppose "sys_clone".
- */
- value = TmfStateValue.newValueString(getLayout().eventSyscallEntryPrefix() + IKernelAnalysisEventLayout.INITIAL_SYSCALL_NAME);
+ if (!value.isNull()) {
+ quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL);
+ ss.modifyAttribute(timestamp, value, quark);
}
- quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL);
- ss.modifyAttribute(timestamp, value, quark);
+
}
}