DESCRIPTION

TMF: Refresh only the supplementary files for the current trace in TmfTrace

Also corrected a typo in a constant name.

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


COMMENTS

author: Annalise Jimenez
date: 2014-03-26 17:56:59.000000000

Uploaded patch set 2.

-------------------------------------
author: Annalise Jimenez
date: 2014-03-26 18:00:31.000000000

Patch Set 2:

(1 comment)

I'm looking for the best way to do this. Supplementary files path is decided by UI classes and the full path is saved in a persistent property, that's all good if you want to access it, but to get to the resource itself, it's kind of twisted, as you'll see in the patch...

Line:739, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> This is not entirely satisfactory... Will it work also on Windows?

Any idea?

-------------------------------------
author: Brenden Conley
date: 2014-03-26 19:37:46.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2014-03-26 20:25:27.000000000

Patch Set 2: Verified+1

Build Successful 

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

-------------------------------------
author: Ricky Reeves
date: 2014-03-27 14:01:37.000000000

Patch Set 2: Code-Review-1

(2 comments)

This change makes sense and it will be faster. Each trace only refreshes it own supplementary directory instead of the whole .tracing directory. I'm definitely for it. We just have to iron-out the details of the implementation. 

BTW, Matthew found that initially while profiling TMF.

Line:736, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> Could we have refresh method in TmfTraceManager which is called here?
i.e. TmfSupplmentaryFiles.refreshSupplementaryFiles(trace).

Line:739, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> Do we actually need this check?  The supplFolder.exists() would fail below if it is not in the workspace. By the way, only in tests the suppl. directory will be outside the project. 

You could use IPath interface:
IPath result = new Path(supplFolderPath);
String osString = result.toOSString();

-------------------------------------
author: Annalise Jimenez
date: 2014-03-27 17:31:19.000000000

Patch Set 2:

(2 comments)

Line:736, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> +1 to this idea. Then we can send an ITmfTrace and the instanceof check can be done there instead of in the analysis module before calling this method.

Line:739, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> Actually, to get to the resource in order to refresh it, we need the path relative to the workspace project, but the path returned by the getSupplementaryFileDir is the absolute path. The check is just to make sure the suppl folder path is in the workspace, otherwise we don't know what the substring would do.

It should indeed return true 99.99999% of the time, but between should and will, better be safe.

As for the IPath suggestion... The line is just to match what has been set in the setPersistentProperty in TmfCommonProjectElement#createSupplementaryDirectory(): supplFolder.getLocationURI().getPath()

Maybe it should be changed there as well to go with the toOSString()?

-------------------------------------
author: Ivy Mitchell
date: 2014-03-27 17:57:01.000000000

Patch Set 2:

the problem, fyi: is that File.List is slow, and it's called n2 times at the opening of a new experiment. If we have 100 traces, this will happen 10000 times.

-------------------------------------
author: Annalise Jimenez
date: 2014-03-27 18:12:37.000000000

Patch Set 2:

And does this patch reduce the number of Files.List to at least n?

-------------------------------------
author: Ricky Reeves
date: 2014-04-09 13:17:55.000000000

Patch Set 2:

Sorry for the late reply.

I tried it on Windows and it works there too. Please rebase it and provide the final patch. Then we can merge it.

I didn't profile the code. But by just looking at the code it will reduce the number of refresh of the trace supplementary directories because only the trace supplementary directory is refreshed instead of the parent directory.

Thanks
Meredith Scott

-------------------------------------
author: Gerrit Code Review
date: 2014-04-22 13:34:28.000000000

The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review.

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