Hi,
Any guidance or alternate approach suggestions?
~Vinod
Hi,
We already have a function flow graph using trace compass working, where we do analysis only once. What I’m trying to do is adding streaming support, when analysis in progress, new data coming and it’s getting
analysed and visualized. Obviously, new data can come or cannot.
Sorry to say that when you say “streaming is not supported out of the box & there is some code to achieve that”, It’s chaotic for me.
I’ve tried below, was expecting this to work. But I see no events coming for analysis, AbstractTMFStateProvider$EventProcessor#fEventsQueue has no data coming.
MyTrace extends TmfTrace{
@Override
public boolean isComplete() {
return false;
}
@Override
public long getStreamingInterval() {
//
TODO: What is the relevance of streaming interval?
return 300;
}
// Update as events coming, now a timer thread doing this
public void sendStreamingRangeUpdatedEvent() {
if (!isTraceOpened.getAndSet(true)) {
fNbEvents = functionEvents.size();
try {
seek(0);
final ITmfContext context = seekEvent(0);
getNext(context);
context.dispose();
} catch (IOException e) {
Activator.log(e);
}
TmfSignalManager.dispatchSignal(new TmfTraceOpenedSignal(this, this, null));
} else {
final TmfTimeRange timeRange = new TmfTimeRange(getStartTime(),
TmfTimestamp.fromNanos(System.currentTimeMillis() * 1000));
final TmfTraceRangeUpdatedSignal rangeUpdatedsignal = new TmfTraceRangeUpdatedSignal(this, this, timeRange);
broadcastAsync(rangeUpdatedsignal);
}
}
}
Your guidance will allow us to use the framework effectively!
~Vinod
First of all, what do you mean with streaming function flow trace? Do you mean that you have stream trace data into a trace that Trace Compass is then supposed to analyze and when new trace data arrives continue
with the analysis (live trace analysis)? Please clarify.
Streaming and live trace analysis is not fully supported at the moment. There is some code to achieve that and views are made to allow to display data while the trace (offline trace) is analysed. But handling
streamed trace is not supported out of the box.
If you store data in heap you run into issue of running out of heap, depending on trace size and size of heap. That's why in Trace Compass intermediate storages on disk like state system exists.
I think you can use the state system to store the data and then have data providers (another Trace Compass concept) to query the state system and further analyse or visualize the data.
Since you dealing with function entries/exits you might want to look into the flame chart analysis (or also called call stack analysis) and how it uses the state system apis to store that. In particular, it use
the pushAttribute and popAttribute feature of the state system.
Here is the state provider for the call stack analysis of LTTng UST traces with function entry/exit (from finstrument functions of gcc). It extends a generic CallStackStateProvider
I hope this helps. If you have any more questions please let us know
Hi,
I’m trying to implement a streaming function flow trace (function entry and exit), where the below specific case is getting handled.
- Now we keep function entry and exit it in a list in heap which is the data to be displayed, but obviously for large data, this is not enough.
- If we store the function entry and exit again into a file, which will affect the performance.
Below is what I’m trying to achieve in theory.
- Use state system itself as the cache, stream events and feed to the state system.
- Let the state system persist data to hard disk in its own format.
- One-time sequential analysis, I’ll discard the original data once analysis is done (Need to identify a point where this can be done too.)
Please share your thoughts, Could you please share the major areas I must investigate?
~Vinod