From 71f2da63ae7eb674ec19d47a431ae443e66a84b5 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Fri, 28 Sep 2012 11:13:04 -0400 Subject: [PATCH] tmf: Add an ID to the AbstractStateChangeInput 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 Reviewed-on: https://git.eclipse.org/r/7977 --- .../kernel/core/stateprovider/CtfKernelStateInput.java | 2 +- .../tmf/core/statesystem/AbstractStateChangeInput.java | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java index b27f120fea..2d48bbb3b7 100644 --- a/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java +++ b/org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/internal/lttng2/kernel/core/stateprovider/CtfKernelStateInput.java @@ -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(); } diff --git a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java index 30d1d8a5a3..aea775e9a1 100644 --- a/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java +++ b/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/statesystem/AbstractStateChangeInput.java @@ -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 eventType) { + public AbstractStateChangeInput(ITmfTrace trace, + Class eventType, String id) { this.trace = trace; this.eventType = eventType; eventsQueue = new ArrayBlockingQueue(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 -- 2.34.1