tmf: Consolidate all state systems in ITmfTrace
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 19 Nov 2012 20:40:48 +0000 (15:40 -0500)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Mon, 10 Dec 2012 15:36:00 +0000 (10:36 -0500)
commita51b2b9f7cefd6ae08ba415f1c1bd3b0cdb46eca
tree450a9a2ef162c2d197d2e2ec1f6990073e085e73
parent06441eb5048c2d3c6a5e8779cbcb14fc76c661aa
tmf: Consolidate all state systems in ITmfTrace

In the initial design, a trace would have only one single
state system. ITmfTrace.getStateSystem() would do the job.

Then, the need for different state systems for different trace
types arose. Up until now, we've used a hybrid approach, where
we keep the interface method the same, but a given user/view
could access a specific state system by casting the trace
in the specific type. So far so good.

But now, we are reaching the point where we can need to define
*many* state systems for a single trace type (ie, Matthew's
CPU usage view). I think we now need to centralize all of a
trace's state systems in the ITmfTrace interface itself.

This patch changes ITmfTrace's getStateSystem() to add the
state's ID as parameter (state systems already define a unique
ID, so we can reuse that one). It also adds a listStateSystems()
method to list the current registered ones for this trace.

The implementation in TmfTrace uses a HashMap. It's very simple,
and gives a maximum amount of flexibility ; sub-classes can
decide to overwrite a superclass' state history, decide to run
them or not, etc.

Change-Id: I6c819ad8987767015543dc54b613ec3cdc6ea50d
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/8767
Tested-by: Hudson CI
Reviewed-by: Bernd Hufmann <bhufmann@gmail.com>
IP-Clean: Bernd Hufmann <bhufmann@gmail.com>
Tested-by: Bernd Hufmann <bhufmann@gmail.com>
org.eclipse.linuxtools.lttng2.kernel.core/src/org/eclipse/linuxtools/lttng2/kernel/core/trace/CtfKernelTrace.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowPresentationProvider.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java
org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfTraceTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfExperimentTest.java
org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/TmfTraceTest.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTrace.java
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java
This page took 0.027746 seconds and 5 git commands to generate.