Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] Use Trace compass internal storage for large trace streaming mode
  • From: Bernd Hufmann <bernd.hufmann@xxxxxxxxxxxx>
  • Date: Tue, 20 Aug 2024 13:34:11 +0000
  • Accept-language: en-CA, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ericsson.com; dmarc=pass action=none header.from=ericsson.com; dkim=pass header.d=ericsson.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RZ+33Mw3e7irmsNl+zmxB+pASq270A7TNAhISLDHVc8=; b=GIkk1zdrS7MjJeWLidyQuYGTN5Yu4X4MoMzfzXMabxML9YNDoHNMLd9HsvoGya4uof9VUFH5wPZwCJbi+mZWjw+QUQEzijuPPwyVF62usubg5xuA+dJDao8mKnbvpX8Q2dJsyPBSqtaTETvPNySpk4p0NN+8KVMfE/puNFy2UpBgAdAsShKb+iVHKvUi9R2J1iBQM8Ph4pyHfYf+wFSr8yhQWpGM2p+nfgHnOYat5gJcvGuuKd47KfDQHP8nPc38pdxchZjELXEGua0I73+aIeIuho80ZB7QSKKGrUErIQx5geUpV/7N84QUTiwMjDJDGlCcjEIKoeXeK8alteuDhw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G1vbMYao62NG6xxePvwvUrpGRJWFxiIiSiUv16QsPcFBnXuJoD6noqRz2Ip+NifYrXI/vAzln4Afjcy1EPf/LQOcjxUJevJQYJkADlCMfcAIj8Pvieoj92GYHU81Y2+yYeC7bgH8Cg4NlfKwDOomHdGWeXC90npfVBZNdh/Ml+tAWkZxW3l9bd9Nqp3KAV+1TsX1E4G1+MEOgdTBqSeERd1j2Be5rNFFNgkmbTsy5VlO2zIlMRj3Q822QN8aWKBIOkRlN6CSTEbG7EUdryJpMrIO6u0PELGvAQ3NuW+2oNA6abine6YwaE6IMwNEHsQIev+JpXRmDVQc/l24mpYLFA==
  • Delivered-to: tracecompass-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/tracecompass-dev/>
  • List-help: <mailto:tracecompass-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tracecompass-dev>, <mailto:tracecompass-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tracecompass-dev>, <mailto:tracecompass-dev-request@eclipse.org?subject=unsubscribe>
  • Msip_labels:
  • Thread-index: AQHa5vaot+DFjNivWEK23V0KmjFcbrInHI49gAWx/QCAAzgLAIAAM55H
  • Thread-topic: Use Trace compass internal storage for large trace streaming mode

Hi,

Not sure what is going on and why it's not working. The signal TmfTraceRangeUpdatedSignal is the right one to notify the analysis modules that new trace data is available. It is supposed to create a request to read the trace from the provide start and end time. In streaming mode, this signal is sent repeatedly, every time new trace data is available which you have some kind of logic implemented. In non-streaming mode, this signal is only sent once when the trace (or experiment) instance handles the TmfTraceOpenedSignal.

To figure out what is going on, I would suggest to debug and have a breakpoint when the TmfTraceRangeUpdatedSignal is sent and received. Analysis modules of type TmfStateSystemAnalysisModule handle that signal in method traceRangeUpdated() (see here https://github.com/eclipse-tracecompass/org.eclipse.tracecompass/blob/5704617daf69f3e5951b38180cec21340ba7b99b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/tmf/core/statesystem/TmfStateSystemAnalysisModule.java#L820)

Maybe also check if the TmfTraceOpenedSignal was handled (TmfTrace or TmfExperiment in case of an experiment)

BTW, The getStreamingInterval() method of TmfTrace / TmfExperiment determines if it's a streaming trace (value > 0) or a offline trace (value = 0). 

I hope this helps.

Regards
Bernd


From: Vinod Appu <vinod.appu@xxxxxxxxxxx>
Sent: August 20, 2024 6:18 AM
To: Bernd Hufmann <bernd.hufmann@xxxxxxxxxxxx>; Matthew Khouzam <matthew.khouzam@xxxxxxxxxxxx>; tracecompass-dev@xxxxxxxxxxx <tracecompass-dev@xxxxxxxxxxx>
Subject: RE: Use Trace compass internal storage for large trace streaming mode
 

Hi,

 

Any guidance or alternate approach suggestions?

 

~Vinod

 

From: Vinod Appu
Sent: Sunday, August 18, 2024 2:39 PM
To: Bernd Hufmann <bernd.hufmann@xxxxxxxxxxxx>; Matthew Khouzam <matthew.khouzam@xxxxxxxxxxxx>; tracecompass-dev@xxxxxxxxxxx
Subject: RE: Use Trace compass internal storage for large trace streaming mode

 

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

 

From: Bernd Hufmann <bernd.hufmann@xxxxxxxxxxxx>
Sent: Thursday, August 15, 2024 12:01 AM
To: Matthew Khouzam <matthew.khouzam@xxxxxxxxxxxx>; tracecompass-dev@xxxxxxxxxxx
Cc: Vinod Appu <vinod.appu@xxxxxxxxxxx>
Subject: Re: Use Trace compass internal storage for large trace streaming mode

 

Hi,

 

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

  

Once you have created your own state provider extending the CallStackStateProvider then you can create an analysis module extending https://github.com/eclipse-tracecompass/org.eclipse.tracecompass/blob/master/analysis/org.eclipse.tracecompass.analysis.profiling.core/src/org/eclipse/tracecompass/analysis/profiling/core/instrumented/InstrumentedCallStackAnalysis.java. After adding the analysis module to your plugin.xml then you should be able to see the a call stack view out-of-the-box in Trace Compass

 

I hope this helps. If you have any more questions please let us know

 

Regards

Bernd

 


From: tracecompass-dev <tracecompass-dev-bounces@xxxxxxxxxxx> on behalf of Vinod Appu via tracecompass-dev <tracecompass-dev@xxxxxxxxxxx>
Sent: August 5, 2024 1:16 AM
To: Matthew Khouzam <matthew.khouzam@xxxxxxxxxxxx>; tracecompass-dev@xxxxxxxxxxx <tracecompass-dev@xxxxxxxxxxx>
Cc: Vinod Appu <vinod.appu@xxxxxxxxxxx>
Subject: [tracecompass-dev] Use Trace compass internal storage for large trace streaming mode

 

Hi,

 

I’m trying to implement a streaming function flow trace (function entry and exit), where the below specific case is getting handled.

 

  1. 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.
  2. 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.

 

  1. Use state system itself as the cache, stream events and feed to the state system.
  2. Let the state system persist data to hard disk in its own format.
  3. 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


Back to the top