DESCRIPTION

tmf: Provide a static method to retrieve state systems

This new method in TmfStateSystemAnalysisModule will:

- Null check the analysis module, so callers don't all have to do it.
- Start the execution of the module, if required (calling schedule()
  after it has already been started is a no-op).
- Avoid exposing a ITmfAnalysisModule object, which is Closeable
  because it hold disposable resources.

This fixes a bunch of the new potential leaks warnings. Eventually
the analysis module API might have to be reworked, to either never
expose the analysis module objects publicly, or to separate the
"accessor" objects from the ones holding the resources.

Change-Id: I693d233f02a8f53c49c5dc429a84c098bd35f004
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2014-05-13 22:00:34.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-05-14 00:06:23.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-05-14 00:52:28.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Annalise Jimenez
date: 2014-05-14 01:06:36.000000000

Patch Set 1: Code-Review-1

Ouch, I'm not sure I like it at all!

Modules are meant to provide some functionnality (see LttngKernelCpuAnalysisModule#getCpuUsageInRange), they are not mere state system providers. Static accessors will not cover all cases. Don't you still have warnings in the CPU usage views?

I guess we'll have to rethink the whole API, but luna is coming too fast. I'd leave it as it is now because this is a weird temporary API to expose.

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-22 17:55:40.000000000

Patch Set 1:

If you look at *every* single view implementation, they all do the following sequence:
  null check
  schedule()
  waitForInitializtion()
  getStateSystem()

It does look like an ugly workaround to "hide" the resources warnings. But if you look at it as a standard way of retrieving state system objects, it doesn't look as bad ;)

I think even once we do rework the API to not trigger those resource warnings, this method would still be useful (and we will be free to change it internally without breaking the API).

-------------------------------------
author: Braxton Mccarthy
date: 2014-06-13 16:28:39.000000000

Patch Set 1: Code-Review-1

The added method may be useful, but it should not suppress the warning. The problem of exposing closeable objects directly is still present.

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