DESCRIPTION

TMF: Add utility method to return trace set, including experiment

And add the experiment state systems in the state system explorer

Change-Id: I0470804d2057b25a778f04c195661d505fdaf7be
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2014-07-03 14:43:40.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2014-07-03 14:43:46.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/7592/

-------------------------------------
author: Brenden Conley
date: 2014-07-03 15:25:10.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/7592/ : SUCCESS

-------------------------------------
author: Braxton Mccarthy
date: 2014-07-03 18:14:14.000000000

Patch Set 2: Code-Review-1

(3 comments)

Some comments on the implementation, for review's sake.

But from a higher-level perspective, getTraceSet() vs. getCompleteTraceSet() is quite confusing and seems redundant. If the "experiment" is now a concept on its own, could getTraceSet() also include the experiment?

or, if it's a method that is not called often, we could keep the old getTraceSet() and just add the experiment to the Set (changing to Set, plz) if needed?

Line:220, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> Let's not continue the bad habit of using inflexible [] arrays as parameters and return values... It could be a Set<ITmfTrace> here (same with the above method).

Line:227, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> Here if the iteration order is important (ie, you want the traces in order, and the experiment at the end), you can use LinkedHashSet, which keeps iteration order = insertion order.

Line:231, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> and here you can do Collections.singleton(trace);

-------------------------------------
author: Annalise Jimenez
date: 2014-07-03 19:30:01.000000000

Patch Set 2:

(1 comment)

There are situations where we want the experiment along with the trace set and other cases where we only want the final traces, so that's 2 use cases.

I wouldn't add the experiment in getTraceSet that would change the behavior, which is worst than breaking the API because much less possible to detect.

And it is called somewhat often in the upcoming analysis (critical path, VM). I added this because otherwise the code looks ugly (if (trace instanceof TmfExperiment) { copy the array and add the experiment })

maybe I should call it getTraceSetWithExperiment?

Line:220, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTraceManager.java -> :p fair enough

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