SchedSwitchHandler: update the priority of the former process
authorRaphaël Beamonte <raphael.beamonte@gmail.com>
Tue, 12 Apr 2016 17:48:33 +0000 (13:48 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Thu, 14 Apr 2016 16:14:27 +0000 (12:14 -0400)
Update the SchedSwitchHandler class to update the priority of
the former process as well as the one of the new one. This
allows to keep a 'sort of' up to date priority in the absence
of other events updating it.

Change-Id: Ie0da99274b9c932a0784dbd737d3279f2cfa6165
Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Reviewed-on: https://git.eclipse.org/r/70504
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Tested-by: Alexandre Montplaisir <alexmonthy@efficios.com>
analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/SchedSwitchHandler.java
lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestValues.java

index 1387f494ab59d80c2895a316e3b4ad371fb43d51..bccb673c2233d4314a6ff46c83f8677fb40a57a5 100644 (file)
@@ -50,6 +50,7 @@ public class SchedSwitchHandler extends KernelEventHandler {
         ITmfEventField content = event.getContent();
         Integer prevTid = ((Long) content.getField(getLayout().fieldPrevTid()).getValue()).intValue();
         Long prevState = checkNotNull((Long) content.getField(getLayout().fieldPrevState()).getValue());
+        Integer prevPrio = ((Long) content.getField(getLayout().fieldPrevPrio()).getValue()).intValue();
         String nextProcessName = checkNotNull((String) content.getField(getLayout().fieldNextComm()).getValue());
         Integer nextTid = ((Long) content.getField(getLayout().fieldNextTid()).getValue()).intValue();
         Integer nextPrio = ((Long) content.getField(getLayout().fieldNextPrio()).getValue()).intValue();
@@ -72,6 +73,9 @@ public class SchedSwitchHandler extends KernelEventHandler {
         /* Set the exec name of the new process */
         setNewProcessExecName(ss, nextProcessName, newCurrentThreadNode, timestamp);
 
+        /* Set the current prio for the former process */
+        setNewProcessPrio(ss, prevPrio, formerThreadNode, timestamp);
+
         /* Set the current prio for the new process */
         setNewProcessPrio(ss, nextPrio, newCurrentThreadNode, timestamp);
 
index 1253e07dc3780d361de1c5baafaa6b33253b52ec..ffdd3d8728050c4e590e7acd434bdb14e99eec8b 100644 (file)
@@ -35,6 +35,7 @@ interface TestValues {
         1331668247316320929L,
         1331668247316334243L,
         1331668247314046266L,
+        1331668247399148733L,
         1331668247316120937L,
         1331668247314038062L,
         1331668247314038062L,
@@ -61,6 +62,7 @@ interface TestValues {
         1331668247314038062L,
         1331668247314038062L,
         1331668248013353414L,
+        1331668247314607227L,
         1331668247314038062L,
         1331668248014184526L,
         1331668248014130616L,
@@ -97,13 +99,11 @@ interface TestValues {
         1331668248004925240L,
         1331668247316553071L,
         1331668247314038062L,
-        1331668247399148733L,
         1331668247399743968L,
         1331668247316925661L,
         1331668247314038062L,
         1331668247314038062L,
         1331668247317063795L,
-        1331668247317063795L,
         1331668247314038062L,
         1331668247314038062L,
         1331668247999256178L,
@@ -185,7 +185,7 @@ interface TestValues {
         1331668247314038062L,
         1331668247314038062L,
         1331668247401441000L,
-        1331668247401408057L,
+        1331668247401341331L,
         1331668247401428073L,
         1331668247400779449L,
         1331668247314038062L,
@@ -1078,6 +1078,7 @@ interface TestValues {
         1331668259054285979L,
         1331668259054285979L,
         1331668259054285979L,
+        1331668259054130388L,
         1331668259054285979L,
         1331668259054285979L,
         1331668259054285979L,
@@ -1105,6 +1106,7 @@ interface TestValues {
         1331668259054285979L,
         1331668248015333196L,
         1331668259054285979L,
+        1331668259054285979L,
         1331668248014548923L,
         1331668248014188534L,
         1331668259054285979L,
@@ -1140,7 +1142,6 @@ interface TestValues {
         1331668248016194935L,
         1331668259054285979L,
         1331668259054285979L,
-        1331668259054130388L,
         1331668259054136697L,
         1331668259054285979L,
         1331668259054285979L,
@@ -1148,7 +1149,6 @@ interface TestValues {
         1331668259054285979L,
         1331668259054285979L,
         1331668259054285979L,
-        1331668259054285979L,
         1331668248016556933L,
         1331668248016556933L,
         1331668248016592456L,
@@ -2122,6 +2122,7 @@ interface TestValues {
         TmfStateValue.newValueInt(1),
         TmfStateValue.newValueString("lttng-consumerd"),
         TmfStateValue.newValueInt(20),
+        TmfStateValue.newValueInt(20),
         TmfStateValue.nullValue(),
         TmfStateValue.nullValue(),
         TmfStateValue.nullValue(),
@@ -2147,6 +2148,7 @@ interface TestValues {
         TmfStateValue.nullValue(),
         TmfStateValue.nullValue(),
         TmfStateValue.newValueInt(5),
+        TmfStateValue.newValueInt(20),
         TmfStateValue.nullValue(),
         TmfStateValue.newValueInt(1432),
         TmfStateValue.newValueInt(4),
@@ -2183,13 +2185,11 @@ interface TestValues {
         TmfStateValue.newValueString("sys_ppoll"),
         TmfStateValue.newValueString("alsa-sink"),
         TmfStateValue.nullValue(),
-        TmfStateValue.newValueInt(20),
         TmfStateValue.newValueString("sys_epoll_wait"),
         TmfStateValue.newValueString("lttng-sessiond"),
         TmfStateValue.nullValue(),
         TmfStateValue.nullValue(),
         TmfStateValue.newValueString("swapper/1"),
-        TmfStateValue.newValueInt(20),
         TmfStateValue.nullValue(),
         TmfStateValue.nullValue(),
         TmfStateValue.newValueInt(1),
This page took 0.029884 seconds and 5 git commands to generate.