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

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.


On Wed, Jun 8, 2016 at 5:27 PM, David Wootton <dwootton@xxxxxxxxxx> wrote:

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.


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

Back to the top