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

Patrick
I have a time chart view that is showing me a single timeline with a number of events that look like they match to the events in the editor window. If I close the editor window the time chart view clears. So I think I have a basic implementation that gives me confidence I can make this work running end to end.

I did run into more problems along the way though.
1) After I added the org.eclipse.linuxtools.tmf.core.analysis extension to my plugin.xml, I tried to add the analysis as a child of the extendion. When I right clicked in the extensions editor window and clicked new, my only choices were listener, module, output, parameterProvider and source. If I tried adding them, the extension details had no fields related to analysis modules as far as I could tell. I ended up finding a use of this extension in org.eclipse.tracecompass.lttng2.ust.core/plugin.xml so I copied that into my plugin.xml. Then when I switched back to the extensions editor tab I was able to change the fields to reference my analysis module and to modify the fields in the child tracetype entry to reference my class extending TmfTrace.
2) I was expecting the time chart view to open automatically since I set the 'automatic' attribute to true. Does that attribute indicate views open automatically or is it only running the analysis? Does my code need to open the view itself somewhere? Do I have to implement the getAnalysisRequirements() method in my analysis class and do something there to have the view open automatically?

Once I open the view manually, by clicking Window->Show View and picking Time Chart view the view does open, populated with events. If I hover the mouse over events I get some popup detail about the event.

3) Is there a way to have the Time Chart view zoom in/out? I tried left clicking the mouse then drag right a bit and then release the mouse button to try to select a region to expand. There's nothing else in the view that I can click to zoom in/out.

4) If I scroll up and down in the editor view, I end up getting a progress monitor labeled 'Fetching Events' that remains running or is being repeatedly invoked such that the progress monitor appears in the lower right of the eclipse window for several minutes, it flickers a lot in the Progress view (which makes me think it is running repeatedly) and scrolling in the editor no longer works. Is this an indication I am doing something wrong, or am I just scrolling so fast I'm getting ahead of whatever is fetching events and there are a lot of 'fetch' requests pending?

At the moment, my trace data model is just a simple in memory array. I implement seek by either updating the current array index when seeking by index/rank and by lookup in a TreeMap object I use to initially merge my trace input streams into a single data stream in timestamp order when seeking by timestamp. So my 'seek' should be fast.

Also, my plugin has a RCP implementation which does not include the Project Explorer view, so I'm not invoking anything my mouse clicks in the Project Exploter view. At the moment I'm getting everything started by setting up my trace input and opening the editor via a call to IDE.openEditor(), where everything seems to work so far. I'm anticipating any additional processing by my code invoking methods that are driven by menu clicks in the TraceCompass perspective.

Dave



Inactive hide details for Patrick Tasse ---06/13/2016 04:19:23 PM---Hi Dave, It appears our developer guide has not been kept uPatrick Tasse ---06/13/2016 04:19:23 PM---Hi Dave, It appears our developer guide has not been kept up to date with some code

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





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
_______________________________________________
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