DESCRIPTION

TMF: Correct bug when synchronizing more than 2 traces

Previously, when synchronizing more than 2 traces, it would return false
results when not all traces had a path to all others. Some timestamp transforms
need composition to be accurate wrt the reference trace

Change-Id: Ie71c4063970af5db1b1476d72351639342a149d8
Signed-off-by: Adonis Kirk xxx@xxx.xxx
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2014-08-25 14:32:06.000000000

Uploaded patch set 8.

-------------------------------------
author: Brenden Conley
date: 2014-08-25 15:18:47.000000000

Patch Set 8:

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

-------------------------------------
author: Brenden Conley
date: 2014-08-25 16:08:39.000000000

Patch Set 8: Verified+1

Build Successful 

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

-------------------------------------
author: Ivy Mitchell
date: 2014-08-25 17:35:30.000000000

Patch Set 8: Code-Review-1

(12 comments)

edge and syncGraph need to be with our coding style. Does it really need, to be a generic. 

Are the labels in the edges for debug reasons?

Line:20, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/Edge.java -> does this need weight?

Line:26, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/Edge.java -> fFrom

Line:41, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/Edge.java -> remove this

Line:43, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncSpanningTree.java -> Maybe a sortedset if the order is important. That way you can get first()?
If not maybe use a hashset()?

Line:87, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncSpanningTree.java -> This is what I'm talking about! thanks!

Line:105, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncSpanningTree.java -> How is this a root? I could say that anything is a root then, fHosts appears to be an String and so this should give the first element in the list, sorted. So "v", "b", "6" would give "6"

Line:58, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> why not call it "source" or from then?

Line:60, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> why not call it to or dest then?

Line:113, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> avoiding recursion and making a breadth first insertion? I think...

Line:128, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> how about while (edge != null && node != start) with an initial assignment to edge on top of this?

Line:144, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> what does no partitions mean?

This is a non-trivial algo, I would suggest mentionning it's cyclomatic complexity

Line:151, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> please indicate that this is an iterative depth first search in comments.

-------------------------------------
author: Ivy Mitchell
date: 2014-08-25 17:40:51.000000000

Patch Set 8:

I also would like to highlight that I think we don't need the generics here. It is a little over-optimized at the expense of readability.

-------------------------------------
author: Adonis Kirk
date: 2014-08-25 18:51:21.000000000

Patch Set 8:

Generic is not mandatory, but IMHO it is not bad either in this case. I don't think it is an issue.

-------------------------------------
author: Adonis Kirk
date: 2014-08-25 18:54:52.000000000

Patch Set 8:

The edges on the SyncGraph are actually there to compute the overall transform: 

SyncAlgorithmFullyIncremental.getTimestampTransform():

List<Edge<String, ITmfTimestampTransform>> path = fSyncGraph.path(fRootNode, hostId);
/*
 * Compute the resulting transform by chaining each transforms on
 * the path.
 */
for (Edge<String, ITmfTimestampTransform> edge : path) {
    result = result.composeWith(edge.getLabel());
}

-------------------------------------
author: Annalise Jimenez
date: 2014-08-26 20:06:07.000000000

Patch Set 8:

I'll modify SyncGraph and Edge so they are more along the TMF coding style. But keep in mind this is [probably] just a short term solution to this bug. The more middle/long term solution involves a real graph library that will do most of the work for us. I'm looking into adding a dependency to jgrapht in TMF so our algorithms can use it.

-------------------------------------
author: Kaeden Tapia
date: 2014-08-26 20:20:02.000000000

Patch Set 8:

"I'm looking into adding a dependency to jgrapht in TMF so our algorithms can use it."

BTW. My suggestion to use m2e so that it can find the dependency will work only for building, not at run-time. Unless there is some more m2e/Tycho magic that I don't know about. So...it sounds like adding the library to Orbit is the way to go.

-------------------------------------
author: Annalise Jimenez
date: 2014-08-27 02:35:10.000000000

Patch Set 8:

(9 comments)

Added a few comments and TODOs in the code.

Line:20, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/Edge.java -> No, not with the current algorithm

Line:26, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/Edge.java -> Done

Line:41, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/Edge.java -> Done

Line:43, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncSpanningTree.java -> Done

Line:105, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncSpanningTree.java -> Added a comment

Line:58, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> Done

Line:60, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> Done

Line:128, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> Done

Line:151, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/synchronization/graph/SyncGraph.java -> Done

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