lttng: Set the child process' syscall state during forks
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 31 May 2012 21:24:22 +0000 (17:24 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Thu, 31 May 2012 21:28:49 +0000 (17:28 -0400)
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java

index b3f62bebc274004d40d812ff262f2a0f101cb329..6574e232d6c05897f39f6bb069deddc1fa1c3000 100644 (file)
@@ -121,7 +121,7 @@ class CtfKernelHandler implements Runnable {
         int quark;
         ITmfStateValue value;
         Integer eventCpu = event.getCPU();
-        Integer currentCPUNode, currentThreadNode, tidNode;
+        Integer currentCPUNode, currentThreadNode;
 
         /* Adjust the current nodes Vectors if we see a new CPU in an event */
         if (eventCpu >= currentCPUNodes.size()) {
@@ -340,26 +340,28 @@ class CtfKernelHandler implements Runnable {
                 Integer parentTid = ((Long) content.getField(LttngStrings.PARENT_TID).getValue()).intValue();
                 Integer childTid = ((Long) content.getField(LttngStrings.CHILD_TID).getValue()).intValue();
 
-                tidNode = ss.getQuarkRelativeAndAdd(threadsNode, childTid.toString());
+                Integer parentTidNode = ss.getQuarkRelativeAndAdd(threadsNode, parentTid.toString());
+                Integer childTidNode = ss.getQuarkRelativeAndAdd(threadsNode, childTid.toString());
 
                 /* Assign the PPID to the new process */
-                quark = ss.getQuarkRelativeAndAdd(tidNode, Attributes.PPID);
+                quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.PPID);
                 value = TmfStateValue.newValueInt(parentTid);
                 ss.modifyAttribute(ts, value, quark);
 
                 /* Set the new process' exec_name */
-                quark = ss.getQuarkRelativeAndAdd(tidNode, Attributes.EXEC_NAME);
+                quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.EXEC_NAME);
                 value = TmfStateValue.newValueString(childProcessName);
                 ss.modifyAttribute(ts, value, quark);
 
                 /* Set the new process' status */
-                quark = ss.getQuarkRelativeAndAdd(tidNode, Attributes.STATUS);
+                quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.STATUS);
                 value = TmfStateValue.newValueInt(StateValues.PROCESS_STATUS_WAIT);
                 ss.modifyAttribute(ts, value, quark);
 
-                /* Set the process' syscall state */
-                quark = ss.getQuarkRelativeAndAdd(tidNode, Attributes.SYSTEM_CALL);
-                value = TmfStateValue.nullValue();
+                /* Set the process' syscall name, to be the same as the parent's */
+                quark = ss.getQuarkRelativeAndAdd(parentTidNode, Attributes.SYSTEM_CALL);
+                value = ss.queryOngoingState(quark);
+                quark = ss.getQuarkRelativeAndAdd(childTidNode, Attributes.SYSTEM_CALL);
                 ss.modifyAttribute(ts, value, quark);
             }
                 break;
This page took 0.028414 seconds and 5 git commands to generate.