DESCRIPTION

[WIP] tmf: Introduce a central trace manager

This manager will track all currently opened traces and their
currently selected timestamps and time ranges.

This will also give both views and *.core analysis plugins
a centralized way to get the current active trace/experiment.
This was not an easy thing to do reliably if you were not an
instance of TmfView.

Unit tests are still WIP.

Change-Id: Ie0056252908ae8bb9e5da33242c3141665eb161c
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2013-04-24 15:23:13.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-04-24 15:23:20.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/2030/ 

-------------------------------------
author: Braxton Mccarthy
date: 2013-04-24 15:28:58.000000000

Patch Set 2:

Rebased (with its dependency) on latest master.

-------------------------------------
author: Brenden Conley
date: 2013-04-24 15:42:39.000000000

Patch Set 2: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/2030/ : SUCCESS

-------------------------------------
author: Ricky Reeves
date: 2013-04-24 18:07:49.000000000

Patch Set 2: I would prefer that you didn't submit this

(9 inline comments)

First set of comments.

Line:245, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> you have to get the current range from the new trace manager not from the signal

Line:71, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> For a singleton class you only have the getInstance() method that creates the instance if the instance variable is null. So remove the static initialize mehtod and put the creation of the instance in the getInstance() method. Then there is no need for the restriction that initialize has to be called before getInstance(). getInstance() will take care the the instance created when needed.

Line:77, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> The method needs to be synchronized to have thread-safe creation of the instance (after the change of comment above)

Line:166, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> fCurrentTrace has to be set here to the new trace. Otherwise the HistogramView (also others) will get the TmfTraceContext from the previous selected trace when handling the TmfTraceOpenedSignal.

Line:204, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> In previous implementation, we had a different behaviour: all open traces will be updated in case their current time intersect with new range.

Line:215, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> timeRangeUpdated

Line:219, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> remove whitespaces

Line:222, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> remove whitespaces

Line:224, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> In previous implementation, we had a different behaviour: all open traces will be updated in case their time ranges intersect with new range.

-------------------------------------
author: Braxton Mccarthy
date: 2013-04-24 21:12:06.000000000

Patch Set 2: (5 inline comments)

Thanks for the comments, I will go back to it once I fix the unit test breakage in the previous patch...

Line:245, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/viewers/statistics/TmfStatisticsViewer.java -> Both ranges should be the same, no? But I agree, for consistency with the other views.

Line:71, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> True. It could have caused problems if someone else creates the instance, but since now it's the Activator that creates it we should be safe...

Line:166, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> Wouldn't that be the work of the traceSelected signal? Or do we want to do it at both places to be safe?

Line:204, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> Hmm, this could make sense. Might be something we'd want to discuss with the others.

Line:219, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> woah, I have no idea how that happened....

-------------------------------------
