SchedSwitchHandler: update the exec name of the former process
authorRaphaël Beamonte <raphael.beamonte@gmail.com>
Tue, 12 Apr 2016 20:32:53 +0000 (16:32 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Thu, 14 Apr 2016 16:14:37 +0000 (12:14 -0400)
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 <raphael.beamonte@gmail.com>
Reviewed-on: https://git.eclipse.org/r/70513
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 bccb673c2233d4314a6ff46c83f8677fb40a57a5..52a83aab94b04161f9eff211cc575de2281e3745 100644 (file)
@@ -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);
 
index ffdd3d8728050c4e590e7acd434bdb14e99eec8b..050c700638a8abc8b4a8d76514dfce7a2a702c66 100644 (file)
@@ -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),
This page took 0.028087 seconds and 5 git commands to generate.