lttng: Add the dependency graph model and handlers for an LTTng kernel
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.os.linux.core / src / org / eclipse / tracecompass / internal / analysis / os / linux / core / kernelanalysis / KernelStateProvider.java
index 4ea1cd338a909d787f8c096c301e16ee1b4c2cb7..8eb5df45a5d2fc997dee40f9d306699595f1d8aa 100644 (file)
@@ -18,9 +18,9 @@ import java.util.Map;
 
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.Attributes;
+import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.LinuxValues;
 import org.eclipse.tracecompass.analysis.os.linux.core.kernelanalysis.StateValues;
 import org.eclipse.tracecompass.analysis.os.linux.core.trace.IKernelAnalysisEventLayout;
-import org.eclipse.tracecompass.internal.analysis.os.linux.core.kernelanalysis.LinuxValues;
 import org.eclipse.tracecompass.statesystem.core.ITmfStateSystemBuilder;
 import org.eclipse.tracecompass.statesystem.core.exceptions.AttributeNotFoundException;
 import org.eclipse.tracecompass.statesystem.core.exceptions.StateValueTypeException;
@@ -55,7 +55,7 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
      * Version number of this state provider. Please bump this if you modify the
      * contents of the generated state history in some way.
      */
-    private static final int VERSION = 8;
+    private static final int VERSION = 9;
 
     private static final int IRQ_HANDLER_ENTRY_INDEX = 1;
     private static final int IRQ_HANDLER_EXIT_INDEX = 2;
@@ -298,16 +298,23 @@ public class KernelStateProvider extends AbstractTmfStateProvider {
                 prevState = prevState & ~(LinuxValues.TASK_STATE_MAX);
 
                 /* Set the status of the process that got scheduled out. */
-                quark = ss.getQuarkRelativeAndAdd(formerThreadNode, Attributes.STATUS);
-                if (prevState != LinuxValues.TASK_STATE_RUNNING) {
-                    if (prevState == LinuxValues.TASK_STATE_DEAD) {
-                        value = TmfStateValue.nullValue();
-                    } else {
-                        value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE;
-                    }
-                } else {
+                switch (prevState.intValue()) {
+                case LinuxValues.TASK_STATE_RUNNING:
                     value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
+                    break;
+                case LinuxValues.TASK_INTERRUPTIBLE:
+                case LinuxValues.TASK_UNINTERRUPTIBLE:
+                    value = StateValues.PROCESS_STATUS_WAIT_BLOCKED_VALUE;
+                    break;
+                case LinuxValues.TASK_DEAD:
+                    value = TmfStateValue.nullValue();
+                    break;
+                default:
+                    value = StateValues.PROCESS_STATUS_WAIT_UNKNOWN_VALUE;
+                    break;
                 }
+
+                quark = ss.getQuarkRelativeAndAdd(formerThreadNode, Attributes.STATUS);
                 ss.modifyAttribute(ts, value, quark);
 
                 /* Set the status of the new scheduled process */
This page took 0.023876 seconds and 5 git commands to generate.