Hi Dave,
1) When I switch to my second analysis, the view updates, but no
intervals are shown and the tree in the left hand side of my view, where
the processes and threads tree would be shown only has a line 'Stack
info not available ...'. It looks like this results from two places in
CallStackView.buildEntryList, when the result of getCallStackModule() is
null and when module.getStateSystem() returns null. As far as I can
tell by debugging, getAnalysisModules() should be returning an analysis
module since my implementation of TmfTrace.getAnalysisModules() is
returning a list of modules, and my modules have a valid state system in
the fStateSystem field.
I suspect your cloned trace doesn't have its fAnalysisModules set, maybe executeAnalysis() was never called on it, but should it, or should it reuse the original's trace analyses?
2) When my first analysis displays, showing thread timelines, the thread
id in the process/thread tree is a ':' instead of a thread number.
That should come from the state system's attribute name, is it the same you see in the State System Explorer view?
I think my two trace objects (original and clone) have to have unique
names. When the TraceEntry objects are created they are assigned the
trace name. So if the names are the same I have no way to tell the
TraceEntry objects apart in TimeGraphContentProvider.getElements();
Indeed, the TraceEntry doesn't have any reference to the ITmfTrace object. Perhaps you can have an algorithm that filters out the n'th occurrence of trace entries with the same name, where 'n' depends on the selected analysis?
One thing I ran into when trying to add events to an existing trace is
that the TmfEvent objects contain a reference to the trace that contains
them. In order to be able to add events, I had to create a new trace
and then create new TmfEvent objects to add to the new trace. I don't
know if anything is looking at TmfEvents in the process of building the
data for the CallStackView and failing.
The Call Stack view only uses the data from the state system provided by the module, it does not read the trace events itself.
The module reads events to build the state system, but this should happen before the changes you are doing here.
Patrick