From: Raphaël Beamonte Date: Tue, 12 Apr 2016 20:32:53 +0000 (-0400) Subject: SchedSwitchHandler: update the exec name of the former process X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=5dbb9ef2d1f9277f149f64f38b56f72cf6fadbcf;p=deliverable%2Ftracecompass.git SchedSwitchHandler: update the exec name of the former process Update the SchedSwitchHandler class to update the exec name of the former process as well as the one of the new one. This allows to keep a 'sort of' up to date exec name in the absence of other events updating it. Change-Id: Ie0a1ebc5b64214150edb0b41b62ccaab4447b041 Signed-off-by: Raphaël Beamonte Reviewed-on: https://git.eclipse.org/r/70513 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 bccb673c22..52a83aab94 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 @@ -48,6 +48,7 @@ public class SchedSwitchHandler extends KernelEventHandler { } ITmfEventField content = event.getContent(); + String prevProcessName = checkNotNull((String) content.getField(getLayout().fieldPrevComm()).getValue()); 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(); @@ -70,6 +71,9 @@ public class SchedSwitchHandler extends KernelEventHandler { /* Set the status of the new scheduled process */ KernelEventHandlerUtils.setProcessToRunning(timestamp, newCurrentThreadNode, ss); + /* Set the exec name of the former process */ + setNewProcessExecName(ss, prevProcessName, formerThreadNode, timestamp); + /* Set the exec name of the new process */ setNewProcessExecName(ss, nextProcessName, 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 ffdd3d8728..050c700638 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, + 1331668247314046266L, 1331668247399148733L, 1331668247316120937L, 1331668247314038062L, @@ -63,6 +64,7 @@ interface TestValues { 1331668247314038062L, 1331668248013353414L, 1331668247314607227L, + 1331668247314607227L, 1331668247314038062L, 1331668248014184526L, 1331668248014130616L, @@ -100,10 +102,8 @@ interface TestValues { 1331668247316553071L, 1331668247314038062L, 1331668247399743968L, - 1331668247316925661L, 1331668247314038062L, 1331668247314038062L, - 1331668247317063795L, 1331668247314038062L, 1331668247314038062L, 1331668247999256178L, @@ -1078,6 +1078,7 @@ interface TestValues { 1331668259054285979L, 1331668259054285979L, 1331668259054285979L, + 1331668259054285979L, 1331668259054130388L, 1331668259054285979L, 1331668259054285979L, @@ -1107,6 +1108,7 @@ interface TestValues { 1331668248015333196L, 1331668259054285979L, 1331668259054285979L, + 1331668259054285979L, 1331668248014548923L, 1331668248014188534L, 1331668259054285979L, @@ -1147,8 +1149,6 @@ interface TestValues { 1331668259054285979L, 1331668259054285979L, 1331668259054285979L, - 1331668259054285979L, - 1331668259054285979L, 1331668248016556933L, 1331668248016556933L, 1331668248016592456L, @@ -2120,6 +2120,7 @@ interface TestValues { TmfStateValue.newValueInt(1), TmfStateValue.newValueString("sys_poll"), TmfStateValue.newValueInt(1), + TmfStateValue.newValueString("lttng-sessiond"), TmfStateValue.newValueString("lttng-consumerd"), TmfStateValue.newValueInt(20), TmfStateValue.newValueInt(20), @@ -2148,6 +2149,7 @@ interface TestValues { TmfStateValue.nullValue(), TmfStateValue.nullValue(), TmfStateValue.newValueInt(5), + TmfStateValue.newValueString("swapper/1"), TmfStateValue.newValueInt(20), TmfStateValue.nullValue(), TmfStateValue.newValueInt(1432), @@ -2186,10 +2188,8 @@ interface TestValues { TmfStateValue.newValueString("alsa-sink"), TmfStateValue.nullValue(), TmfStateValue.newValueString("sys_epoll_wait"), - TmfStateValue.newValueString("lttng-sessiond"), TmfStateValue.nullValue(), TmfStateValue.nullValue(), - TmfStateValue.newValueString("swapper/1"), TmfStateValue.nullValue(), TmfStateValue.nullValue(), TmfStateValue.newValueInt(1),