DESCRIPTION

TMF: Add a getTrace() method to TmfTraceElement

This will return the corresponding opened and instantiated trace from the
trace manager.

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


COMMENTS

author: Annalise Jimenez
date: 2013-08-15 20:38:47.000000000

Uploaded patch set 6.

-------------------------------------
author: Annalise Jimenez
date: 2013-08-15 20:41:01.000000000

Patch Set 6:

I'll put the unit tests in a separate patch (it's more complicated than just unit testing this new method, besides, it does not even test it fully).  

This one is required for the analysis framework and it will get in more easily like this I think

-------------------------------------
author: Luciana Barry
date: 2013-08-15 22:17:48.000000000

Patch Set 6:

I don't really like this idea of blocking on the opening of a trace. Would there be a way to avoid it?
For example, first call this new getTrace(), if the trace is opened, then you can use it, otherwise, the caller may decide to trigger the opening of the trace with the helper. But then you just let that proceed by itself, and if need be, use a signal handler to get notified when the trace is opened.

-------------------------------------
author: Annalise Jimenez
date: 2013-08-15 23:59:40.000000000

Patch Set 6:

If I added a boolean parameter to getTrace() openIfNecessary that would be false by default, would that be all right?

This way a caller can still use the getTrace but would need to explicitly say he wants the callee to open the trace and block until available.

Otherwise I'll need to see in the analysis framework if I can "schedule" an analysis using either the already available trace or a signal to wait for opening.

-------------------------------------
author: Luciana Barry
date: 2013-08-16 18:40:32.000000000

Patch Set 6:

If the caller wants to open the trace if getTrace() returns null, it can do that itself, we don't have to create a new method for every use case ;)

But that doesn't soothe our apprehension regarding the blocking call. I think we would prefer a solution where we just trigger opening the trace, and that process takes care of building whatever analysis is required, whenever it is ready to do so.

-------------------------------------
author: Braxton Mccarthy
date: 2013-08-16 23:05:05.000000000

Patch Set 6:

Just to add to the mix, I'm considering working on an approach where state systems are built in-band with the trace (trace calls buildStateSystem(), construction starts. trace calls dispose(), construction stops if applicable, files and closed and cleaned up if needed). a.k.a do away with the HistoryBuilder abomination entirely.

We're having a bug right now with traces with 0 events: one part of the system is still waiting for the signal to start, and another part is trying to close it. Pain and tears ensue. Moving to the in-band approach would undoubtedly be the correct way to fix this.

(those is-the-statesystem-started-yet? latches make me cringe ;) )

However, this is a very big undertaking. It might be worth focusing on the future instead, where the "analysis" is the owner of the state system. Where it would control and know when construction is started and when it's done. We could learn from history, and do it right this time.

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