From: Raphaël Beamonte Date: Tue, 12 Apr 2016 17:48:33 +0000 (-0400) Subject: SchedSwitchHandler: update the priority of the former process X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;ds=sidebyside;h=5c209c22e755ae3d44dc6513d62ccb63366d1b7e;p=deliverable%2Ftracecompass.git SchedSwitchHandler: update the priority of the former process 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 Reviewed-on: https://git.eclipse.org/r/70504 Reviewed-by: Matthew Khouzam Reviewed-by: Hudson CI Reviewed-by: Alexandre Montplaisir Tested-by: Alexandre Montplaisir --- diff --git a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/SchedSwitchHandler.java b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/SchedSwitchHandler.java index 1387f494ab..bccb673c22 100644 --- a/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/SchedSwitchHandler.java +++ b/analysis/org.eclipse.tracecompass.analysis.os.linux.core/src/org/eclipse/tracecompass/internal/analysis/os/linux/core/kernel/handlers/SchedSwitchHandler.java @@ -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); diff --git a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestValues.java b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestValues.java index 1253e07dc3..ffdd3d8728 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestValues.java +++ b/lttng/org.eclipse.tracecompass.lttng2.kernel.core.tests/src/org/eclipse/tracecompass/lttng2/kernel/core/tests/analysis/kernel/statesystem/TestValues.java @@ -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),