DESCRIPTION

TMF: Add the XML analysis module source

This patch allows the importation of XML files from the TMF GUI. Analysis
modules described in those XML files will appear under the trace, if
applicable.

Change-Id: I0910946f35fe921c22b319b77ab2aefeb385edf3
Signed-off-by: Aryana Jones xxx@xxx.xxx
Signed-off-by: Ayanna Reed xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2014-01-14 03:06:35.000000000

Uploaded patch set 4.

-------------------------------------
author: Annalise Jimenez
date: 2014-01-14 03:19:46.000000000

Patch Set 4:

Ready for further review (rffr?)
or
Please take a look (ptal)

-------------------------------------
author: Brenden Conley
date: 2014-01-14 03:44:17.000000000

Patch Set 4:

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

-------------------------------------
author: Brenden Conley
date: 2014-01-14 04:11:11.000000000

Patch Set 4: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/5023/ : FAILURE

-------------------------------------
author: Brenden Conley
date: 2014-01-14 14:02:05.000000000

Patch Set 4: -Verified

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

-------------------------------------
author: Brenden Conley
date: 2014-01-14 14:40:11.000000000

Patch Set 4: Verified+1

Build Successful 

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

-------------------------------------
author: Braxton Mccarthy
date: 2014-01-14 22:31:00.000000000

Patch Set 4: Code-Review-1

(11 comments)

Line:49, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlAnalysisModuleSource.java -> Why is fModules static? The list of modules is really the same for all XML modules? In this case, the getAnalysisModules() method here should be a static method also (and not using the interface method).

And the whole class ends up being a "static" class, so it could have an empty private constructor to prevent instantiation.

Also this method should be synchronized, to avoid the risk of two threads calling it at the same time and both entering the if block.

Line:71, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlAnalysisModuleSource.java -> do not wrap this

it's possible we need to update/fix the formatter settings for this plugin

Line:78, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlAnalysisModuleSource.java -> no wrappy

Line:90, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlAnalysisModuleSource.java -> you can use Java 7 multiple-type clauses if you handle every exception the same way:

 } catch (ParserConfigurationException | SAXException | IOException e) {
   log(...)
 }

Line:42, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/TmfAnalysisModuleHelperXml.java -> This class is to define analyses defined by a XML file, right?

If so, why does it need to have a "type"? An anlysis module could use a state system (if it has a <stateprovider> in its XML), or it could not.

For example, if we have 1 XML file, which represents one analysis, but it has two <stateprovider> entries, would those 2 state providers be handle by separate analysis helpers?

Line:23, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui.tests/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/tests/module/AllTests.java -> format this like the other files, for consistency's sake ( "})" on its own line, empty line before "public class")

Line:45, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/ui/Activator.java -> we already have this in tmf.core.Activator now. Since this plugin depends on tmf.core, it will already be loaded. Is this necessary to call this again?

Line:34, lttng/org.eclipse.linuxtools.tmf.analysis.xml.core/src/org/eclipse/linuxtools/tmf/analysis/xml/core/stateprovider/model/TmfXmlStrings.java -> for elements in an interface, you don't need to say "public" (it's automatically public).

The other existing ones could be fixed later.

Line:20, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui.tests/META-INF/MANIFEST.MF -> Both these package are part of the Eclipse distribution (or the lttng plugins themselves), so they should go in Require-Bundle. Import-Package is for external dependencies (like SWTChart), that might be installed from external sources (like distribution packages for example).

Line:59, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlHeadInfoUi.java -> wrapping after a ( is fine, but in this case I don't think it really improves readability (it's fine to go up to 120~ columns).

A good metric is: if Gerrit wraps it, you should wrap it.

Line:61, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlHeadInfoUi.java -> You could put both these check in one if with a &&

-------------------------------------
author: Annalise Jimenez
date: 2014-01-17 17:57:31.000000000

Patch Set 4:

(3 comments)

Line:49, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlAnalysisModuleSource.java -> There should only be one instance of this class in existence at any moment (managed by the analysis manager). I'll rewrite it so it looks more like its sister class TmfAnalysisModuleSourceConfigElement

Line:42, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/TmfAnalysisModuleHelperXml.java -> For now, we will support only 1 stateprovider => 1 analysis.

We would need to update the XML to define analysis, their content, their views, etc.

It's not just adding one level <analysis> in the XML, it's also how to handle its execution, for more than 2 state systems for example, so we'll work on that support later on.

Line:45, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/internal/tmf/analysis/xml/ui/Activator.java -> Indeed, these are the remains of old stuff I guess

-------------------------------------
author: Annalise Jimenez
date: 2014-01-17 18:04:16.000000000

Patch Set 4:

(1 comment)

Line:49, lttng/org.eclipse.linuxtools.tmf.analysis.xml.ui/src/org/eclipse/linuxtools/tmf/analysis/xml/ui/module/XmlAnalysisModuleSource.java -> I spoke too soon. Actually, it's because of the notifyModuleChange() method that fModules is static. The list of modules is unique for the whole application, there is only one instance of this class in the analysis manager. And the analysis manager requests the list of modules using this method.

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