Modify LTTng state provider to ignore scheduler wakeups on already-running processes
authorFrançois Rajotte <francois.rajotte@polymtl.ca>
Fri, 12 Jul 2013 15:08:03 +0000 (11:08 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 18 Jul 2013 17:56:10 +0000 (13:56 -0400)
Change-Id: I537caf33c348833de65a2836138f694d80a0c4fe
Signed-off-by: François Rajotte <francois.rajotte@polymtl.ca>
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/14518
Tested-by: Hudson CI
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/LttngKernelStateProvider.java

index 5f62847254d863c174cfc68f5e46419c01b3541b..38bf88ff7b7fcee0de298956233d0a639337d810 100644 (file)
@@ -44,7 +44,7 @@ public class LttngKernelStateProvider 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 = 2;
+    private static final int VERSION = 3;
 
     /* Event names HashMap. TODO: This can be discarded once we move to Java 7 */
     private final HashMap<String, Integer> knownEventNames;
@@ -414,11 +414,17 @@ public class LttngKernelStateProvider extends AbstractTmfStateProvider {
 
                 /*
                  * The process indicated in the event's payload is now ready to
-                 * run. Assign it to the "wait for cpu" state.
+                 * run. Assign it to the "wait for cpu" state, but only if it
+                 * was not already running.
                  */
                 quark = ss.getQuarkRelativeAndAdd(threadNode, Attributes.STATUS);
-                value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
-                ss.modifyAttribute(ts, value, quark);
+                int status = ss.queryOngoingState(quark).unboxInt();
+
+                if (status != StateValues.PROCESS_STATUS_RUN_SYSCALL &&
+                    status != StateValues.PROCESS_STATUS_RUN_USERMODE) {
+                    value = StateValues.PROCESS_STATUS_WAIT_FOR_CPU_VALUE;
+                    ss.modifyAttribute(ts, value, quark);
+                }
             }
                 break;
 
This page took 0.026289 seconds and 5 git commands to generate.