Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] Question about creating XML stateProvider for custom trace format

Hi Robbert

Thanks for the interest in Trace Compass.

It is possible to create a XML analysis using custom text traces. There are a view things you need to know which are not obvious.

- the <traceType> attribute is: custom.txt.trace:<category>:<parserName>
where <category> is the category that you specified in the custom text parser
           <parser name> is the custom parser name

- the eventName is the same for all events and it is the custom parser name <parserName> from above.  So for the state changes in the state provider you need work with the event fields. The event field names in custom parsers are the column names. (BTW, different event names is currently discussed as Genevieve pointed out in her answer)

I've done this for traces generated by Trace Compass when enabling the debug information. I've attached a tar file with the custom parser, the state provider and an example trace. Please have look and take it as a reference for your state provider. If you want to try it, import the custom parser (TmfRequest-saved.xml), then import the state provider (TmfRequestState.xml) and finally open trace TmfTraceRequest.log. Open the XML view as usual.

Please let us know how it goes.


On 06/02/2016 08:08 AM, Robbert Jongeling wrote:

Dear TraceCompass developers,

I would like to ask you for some help with creating an XML state provider.
Specifically, how to get an eventHandler to recognize an eventName.

The traces I am using are in CSV format, which I have parsed using the wizard.
To create a Gantt-chart of the events in this trace, I have then created a stateProvider.
I have managed to get this stateProvider to work by creating only events with the same name (the Trace Type as indicated in the wizard)
and then in each handler conditionally check for a different field, e.g.:

<eventHandler eventName="MyCustomTextTraceType">
<field name="someField"/>
<stateValue type="string" value="thisIsTheEventIWant"/>
<stateAttribute type="constant" value="Foo"/>
<stateAttribute type="eventField" value="someOtherField"/>
<stateValue type="int" value="someOtherValue"/>

(And this repeated for each possible value of "someField")

I would like to distinguish between the events as is done in the example in the user guide:

<eventHandler eventName="thisIsTheEventIWant">
<stateAttribute type="constant" value="Foo"/>
<stateAttribute type="eventField" value="someOtherField"/>
<stateValue type="int" value="someOtherValue"/>

It feels as if there should be a very simple solution here, just "tell" the stateProvider where to look for the eventName.
However, I have not managed to find this solution.
I would greatly appreciate any help.

Kind regards,


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

Attachment: xml-analysis-with-custom-text.tar.gz
Description: application/gzip

Back to the top