os.linux: Add per cpu thread 0 modeling
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / internal / analysis / os / linux / core / kernel / handlers / ProcessForkHandler.java
index c34b52fd2a9ee8b82d24451dd20aea89a5b2843b..a97de2a868bb3477271e224460de0a23183df5ee 100644 (file)
@@ -40,14 +40,26 @@ public class ProcessForkHandler extends KernelEventHandler {
     @Override
     public void handleEvent(ITmfStateSystemBuilder ss, ITmfEvent event) throws AttributeNotFoundException {
         ITmfEventField content = event.getContent();
+        Integer cpu = KernelEventHandlerUtils.getCpu(event);
         String childProcessName = (String) content.getField(getLayout().fieldChildComm()).getValue();
 
         Integer parentTid = ((Long) content.getField(getLayout().fieldParentTid()).getValue()).intValue();
         Integer childTid = ((Long) content.getField(getLayout().fieldChildTid()).getValue()).intValue();
 
+        String parentThreadAttributeName = KernelEventHandlerUtils.buildThreadAttributeName(parentTid, cpu);
+        if (parentThreadAttributeName == null) {
+            return;
+        }
+
+        String childThreadAttributeName = KernelEventHandlerUtils.buildThreadAttributeName(childTid, cpu);
+        if (childThreadAttributeName == null) {
+            return;
+        }
+
         final int threadsNode = KernelEventHandlerUtils.getNodeThreads(ss);
-        Integer parentTidNode = ss.getQuarkRelativeAndAdd(threadsNode, parentTid.toString());
-        Integer childTidNode = ss.getQuarkRelativeAndAdd(threadsNode, childTid.toString());
+        Integer parentTidNode = ss.getQuarkRelativeAndAdd(threadsNode, parentThreadAttributeName);
+        Integer childTidNode = ss.getQuarkRelativeAndAdd(threadsNode, childThreadAttributeName);
+
 
         /* Assign the PPID to the new process */
         int quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.PPID);
This page took 0.026123 seconds and 5 git commands to generate.