Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] Implementing new trrace format viewing in Trace Compass

Hi Dave,

It appears our developer guide has not been kept up to date with some code changes. At one point we changed it so that the state systems are built from an analysis instead of explicitly from the trace implementation. The two other classes you refer to have been renamed to remove 'Tmf' prefix.

In your case, you do not need to register the state provider. You should create an analysis, and that analysis you register with the extension point org.eclipse.linuxtools.tmf.core.analysis. Then the analysis should be executed when the trace is opened if automatic=true (or when the view is opened if automatic=false). If your analysis module extends TmfAbstractAnalysisModule (or AbstractCallStackAnalysis) then you need to override createStateProvider() and that is where you reference your state provider.

If you use the Call Stack view, it will automatically look for an analysis that extends AbstractCallStackAnalysis. If you make your own view that extends AbstractTimeGraphView, then it is in overriding buildEntryList() that you make it look for your own analysis.

Patrick


On Mon, Jun 13, 2016 at 12:11 PM, David Wootton <dwootton@xxxxxxxxxx> wrote:

Patrick
I am able to create a trace from my input trace and get it to show up in the editor view. I can also add attributes to trace events and have them show up in the editor view after I defined the proper trace aspect objects.

I'm now trying to extend CallStackStateProvider and AbstractTimeGraphView as you suggested. I have written my class extending CallStackStateProvider, but I'm not sure how I register that class, which I'm guessing has to be registered in my class extending TmfTrace.The Trace Compass developer doc references a TmfTrace.buildStateSystems() method htat I'm supposed to call, but this does not seem to exist in the Trace Compass version 2.0 code. I also do not find the TmfStateSystemFactory or TmfStateSystem classes anywhere in the 2.0 code.

What do I need to do to get a working TimeGraphView?

Thanks

Dave

Inactive hide details for Patrick Tasse ---06/09/2016 11:48:51 AM---Hi David, Right now the triggers to get things going with aPatrick Tasse ---06/09/2016 11:48:51 AM---Hi David, Right now the triggers to get things going with a trace are based on

From: Patrick Tasse <patrick.tasse@xxxxxxxxx>
To: tracecompass developer discussions <tracecompass-dev@xxxxxxxxxxx>
Date: 06/09/2016 11:48 AM
Subject: Re: [tracecompass-dev] Implementing new trrace format viewing in Trace Compass
Sent by: tracecompass-dev-bounces@xxxxxxxxxxx





Hi David,

Right now the triggers to get things going with a trace are based on opening the trace in the tool from the Project view. This will open the trace in an editor (read-only), start the trace indexing which will read all events and update the number of events in the table.

Your new trace class has to be assigned a trace type using the org.eclipse.linuxtools.tmf.core.tracetype extension point.

The Time Chart view only knows about punctual events and their timestamps, so it will show ticks in a time line when events occur, in a single row for the trace. I don't think that's what you're trying to achieve.

What you're looking for is a view based on a time graph, that has time graph entries (rows) for threads and processes. In order to go from punctual events to states with duration, most views use a state system that is built using an analysis (you need to define it with extension point org.eclipse.linuxtools.tmf.core.analysis).

I think you might have some luck with creating an analysis that extends AbstractCallStackAnalysis. You will need to create a state provider (I suggest to extend CallStackStateProvider), which will populate the state system with attributes and intervals based on the events you identify in your trace. Then the overridable methods in AbstractCallStackAnalysis will identify which state system attributes will map to rows in the Call Stack view. If you're not really doing a full call stack model, you could 'fake it' in such a way that a thread start is seen as a function entry and a thread end is seen as a function exit.

You could also create your own view that extends AbstractTimeGraphView, then you need to implement the methods that create time graph entries (rows) and compute the time graph model time events (states) from your trace. Usually this is also done through a state system, but doesn't have to be.

And another completely different way to go about it, is to define your state system and your view in a data-driven way using XML (without writing code). There is documentation and an example of how to do this here:

http://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/Data-driven-analysis.html#Data_driven_analysis
https://www.eclipsecon.org/na2015/sites/default/files/slides/EclipseConAmerica2015.pdf

FYI, the Nexus sample code was lost in the move from Linux Tools to Trace Compass. I could point you to the last version in Linux Tools git but it would surely not compile in Trace Compass.

Patrick


On Wed, Jun 8, 2016 at 5:27 PM, David Wootton <dwootton@xxxxxxxxxx> wrote:
    Hi
    I am trying to implement viewers using Trace Compass for a trace file generated by my plugin and some backend tools.I am having troble understanding the high level model that I need to follow to get this work. I have downloaded the source for Trace Compass and Linux tools and cannot find the source for the Nexus sample anywhere. Is there any information available that explains at a high level what I need to to to implement a new trace reader and get it to properly interface with the viewers?

    My intent was to initially load the trace and have it display in a Time Chart view where I am trying to display a timeline for each thread in each process in the application that generated the trace. I'm trying to get a view that shows one timeline for each thread in each process in the traced application, so I think this is the view I want.

    I have an existing trace reader for my trace format which reads the trace into memory and then opens my plugin's trace viewer. I have modified it so that it generates trace events that are implementations of the ITmfEvent interface and have started to implement a class extending TmfTrace. However, it's unclear to me what I need to do in order to initiate the processing in my TmfTrace class once I create an instance of my class and call initTrace in that class. I'm expecting parseEvent to be called to read each event, but that is not happening. I'm also not sure how I notify the viewer that trace data is available. I'm not sure if I need to call some method in the viewer or if I need to do something to hook up with the Trace Compass signal processing.

    I also experimented with loading a sample Linux kernel trace in Trace Compass. It seems that when I load the trace, the initial view that gets loaded is the TmfEventsEditor and then other views seem to be populated from that editor. Therefore I'm wondering if I need to set my instance of a TmfTrace class as an editor input to that editor and then everything will run from there?

    Any assistance is appreciated.

    Dave


    _______________________________________________
    tracecompass-dev mailing list

    tracecompass-dev@xxxxxxxxxxx
    To change your delivery options, retrieve your password, or unsubscribe from this list, visit

    https://dev.eclipse.org/mailman/listinfo/tracecompass-dev
_______________________________________________
tracecompass-dev mailing list
tracecompass-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tracecompass-dev




_______________________________________________
tracecompass-dev mailing list
tracecompass-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tracecompass-dev



Back to the top