Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Montplaisir2012-05-28 22:29:54 +0000
committerAlexandre Montplaisir2012-05-28 22:35:07 +0000
commitc9cdc75b04d90102b1d6fede8fb94ec8d30dcf12 (patch)
treef9ca0db601c2a135856dedb7792214203d2360ed /lttng/org.eclipse.linuxtools.lttng2.kernel.core
parenteae2be03b6bc6b9fac1e1b042a5aaaed21c4b00a (diff)
downloadorg.eclipse.linuxtools-c9cdc75b04d90102b1d6fede8fb94ec8d30dcf12.tar.gz
org.eclipse.linuxtools-c9cdc75b04d90102b1d6fede8fb94ec8d30dcf12.tar.xz
org.eclipse.linuxtools-c9cdc75b04d90102b1d6fede8fb94ec8d30dcf12.zip
lttng: Correctly track user <-> kernel transitions for CPUs
In addition to the change in the previous commit, we also want to split one "busy" interval in many smaller intervals that represent successive transitions from user mode to kernel mode and vice versa. While at it, replaced the currentNodes vectors by arraylists, we don't need the synchronization here. Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng2.kernel.core')
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java b/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java
index d68ec2cef4..221b68964b 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelHandler.java
@@ -12,8 +12,9 @@
package org.eclipse.linuxtools.internal.lttng2.kernel.core.stateprovider;
+import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Vector;
+import java.util.List;
import java.util.concurrent.BlockingQueue;
import org.eclipse.linuxtools.internal.lttng2.kernel.core.Attributes;
@@ -45,8 +46,8 @@ class CtfKernelHandler implements Runnable {
* We can keep handles to some Attribute Nodes so these don't need to be
* re-found (re-hashed Strings etc.) every new event
*/
- Vector<Integer> currentCPUNodes;
- Vector<Integer> currentThreadNodes;
+ List<Integer> currentCPUNodes;
+ List<Integer> currentThreadNodes;
/* Event names HashMap. TODO: This can be discarded once we move to Java 7 */
private final HashMap<String, Integer> knownEventNames;
@@ -60,8 +61,8 @@ class CtfKernelHandler implements Runnable {
CtfKernelHandler(BlockingQueue<CtfTmfEvent> eventsQueue) {
assert (eventsQueue != null);
this.inQueue = eventsQueue;
- currentCPUNodes = new Vector<Integer>();
- currentThreadNodes = new Vector<Integer>();
+ currentCPUNodes = new ArrayList<Integer>();
+ currentThreadNodes = new ArrayList<Integer>();
knownEventNames = fillEventNames();
}
@@ -158,6 +159,11 @@ class CtfKernelHandler implements Runnable {
quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
value = TmfStateValue.newValueInt(StateValues.PROCESS_STATUS_RUN_USERMODE);
ss.modifyAttribute(ts, value, quark);
+
+ /* Put the CPU's status back to user mode */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ value = TmfStateValue.newValueInt(StateValues.CPU_STATUS_RUN_USERMODE);
+ ss.modifyAttribute(ts, value, quark);
}
break;
@@ -420,6 +426,11 @@ class CtfKernelHandler implements Runnable {
quark = ss.getQuarkRelativeAndAdd(currentThreadNode, Attributes.STATUS);
value = TmfStateValue.newValueInt(StateValues.PROCESS_STATUS_RUN_SYSCALL);
ss.modifyAttribute(ts, value, quark);
+
+ /* Put the CPU in system call (kernel) mode */
+ quark = ss.getQuarkRelativeAndAdd(currentCPUNode, Attributes.STATUS);
+ value = TmfStateValue.newValueInt(StateValues.CPU_STATUS_RUN_SYSCALL);
+ ss.modifyAttribute(ts, value, quark);
}
}
break;

Back to the top