os.linux: Fix CPU state when Softirq is interrupted
[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 f6e37b4c6a820bef38dfaac0a1cebe5225f46bb3..c34b52fd2a9ee8b82d24451dd20aea89a5b2843b 100644 (file)
@@ -12,8 +12,8 @@
 
 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;
@@ -45,8 +45,9 @@ public class ProcessForkHandler extends KernelEventHandler {
         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);
@@ -67,14 +68,10 @@ public class ProcessForkHandler extends KernelEventHandler {
         /* 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);
+
     }
 }
This page took 0.026353 seconds and 5 git commands to generate.