DESCRIPTION

tmf: Allow the experiment to have a state system

Some modifications were required for an experiment itself to have a state
system.  Maybe a more general approach would be required instead of those
very local changes, so that experiments can have the same behavior and
functionnalities as the traces.

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


COMMENTS

author: Braxton Mccarthy
date: 2013-07-18 20:06:22.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-07-18 20:06:28.000000000

Patch Set 3:

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

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-18 20:07:34.000000000

Patch Set 3: Verified+1 Code-Review+1 IP-Clean+1

Small rework, we can do away with the instanceof check completely.

-------------------------------------
author: Annalise Jimenez
date: 2013-07-18 20:18:36.000000000

Patch Set 3: Code-Review-1

(1 comment)

Line:196, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java -> if sender is an experiment getTraceSet does not return the experiment itself so if sp.getTrace() happens to be the experiment, it will return false, while it should be true.

We could just remove the if instanceof in the else...

-------------------------------------
author: Brenden Conley
date: 2013-07-18 20:22:50.000000000

Patch Set 3: Verified+1

Build Successful 

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

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-18 21:46:41.000000000

Patch Set 3: -Verified -Code-Review -IP-Clean

(1 comment)

Line:196, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java -> Ah true. I did that at first, but then though the for on .getTraceSet() would be enough...

-------------------------------------
author: Annalise Jimenez
date: 2013-07-19 13:42:01.000000000

Patch Set 3:

(1 comment)

Line:196, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/HistoryBuilder.java -> So do we revert to patchset 2 or remove the instanceof check which would mean that for one single trace, the check would be done twice, which may still be less costly than an instanceof check... for what it's worth here ;-)

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-19 17:24:58.000000000

Patch Set 3:

I was preparing the patch adding a

  if (sp.getTrace() == sender) {
    return true;
  }

before the for loop, but then this made me realize: if the experiment has a state system, and one of its sub-traces also does. If someone opens (or manually starts the building of) the trace only, won't this also trigger building the experiment's state system? Which is not what we want...

I'll start writing a small test with an experiment stub that has a specific state system, so that we can at least cover this with testing before proceeding.

-------------------------------------
author: Annalise Jimenez
date: 2013-07-19 17:42:15.000000000

Patch Set 3:

Well, if one opens the trace only, then the sender is the trace, so getTraceSet will return the trace only.  We don't have the information that the trace is part of an experiment at all so it should not trigger the the state system of the experiment.  

The state system of the experiment is triggered only if sender is TmfExperiment.

But I agree that having unit tests for this is necessary ;-)

-------------------------------------
author: Annalise Jimenez
date: 2013-07-30 18:26:38.000000000

Patch Set 3:

Alex, any further comment on this?  Otherwise I'd go back to patchset 2 and merge it

-------------------------------------
author: Braxton Mccarthy
date: 2013-07-30 20:54:56.000000000

Patch Set 3:

Yes, patch set 2 would be fine too, but I think we should really have a unit test for this. My main concern was that building the SS for a sub-trace would trigger building it for the experiment, which we clearly don't want.

I have a partial patch for such a test, but I haven't had time to finish it yet. I'll send it to you by email if you want to take a look at it.

-------------------------------------
author: Annalise Jimenez
date: 2013-07-30 20:57:45.000000000

Patch Set 3:

Sure send me the unit test please

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