tmf: Add an ID to the AbstractStateChangeInput
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Fri, 28 Sep 2012 15:13:04 +0000 (11:13 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Fri, 5 Oct 2012 19:46:27 +0000 (15:46 -0400)
The Abstract version was still, wrongly, using "CTF Kernel"
as its identifier. Replace this with a configurable name,
provided as a constructor parameter.

It's only used for naming the thread that it starts, but it
makes it a bit more clear what is happening when debugging.

Change-Id: I3317d82c366915e4eaa08a5fa65a8379f92e062f
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/7977

org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java

index b27f120fea893e55c11801162aabfcc71e2121ea..2d48bbb3b7d0d4e090f179df35a41d4586a341e7 100644 (file)
@@ -57,7 +57,7 @@ public class CtfKernelStateInput extends AbstractStateChangeInput {
      *            The LTTng 2.0 kernel trace directory
      */
     public CtfKernelStateInput(CtfTmfTrace trace) {
-        super(trace, CtfTmfEvent.class);
+        super(trace, CtfTmfEvent.class, "LTTng Kernel"); //$NON-NLS-1$
         knownEventNames = fillEventNames();
     }
 
index 30d1d8a5a32cc5053f03ee85b92f05609d7fc05a..aea775e9a19c5e405eccb4697e06c7b3801dd88f 100644 (file)
@@ -54,13 +54,19 @@ public abstract class AbstractStateChangeInput implements IStateChangeInput {
      * @param eventType
      *            The specific class for the event type that will be used within
      *            the subclass
+     * @param id
+     *            Name given to this state change input. Only used internally.
      */
-    public AbstractStateChangeInput(ITmfTrace trace, Class<? extends ITmfEvent> eventType) {
+    public AbstractStateChangeInput(ITmfTrace trace,
+            Class<? extends ITmfEvent> eventType, String id) {
         this.trace = trace;
         this.eventType = eventType;
         eventsQueue = new ArrayBlockingQueue<ITmfEvent>(DEFAULT_EVENTS_QUEUE_SIZE);
-        eventHandlerThread = new Thread(new EventProcessor(), "CTF Kernel Event Handler"); //$NON-NLS-1$
         ssAssigned = false;
+
+        String id2 = (id == null ? "Unamed" : id); //$NON-NLS-1$
+        eventHandlerThread = new Thread(new EventProcessor(), id2 + " Event Handler"); //$NON-NLS-1$
+
     }
 
     @Override
This page took 0.026191 seconds and 5 git commands to generate.