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.

Thanks
Bernd


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">
<stateChange>
<if>
<condition>
<field name="someField"/>
<stateValue type="string" value="thisIsTheEventIWant"/>
</condition>
</if>
<then>
<stateAttribute type="constant" value="Foo"/>
<stateAttribute type="eventField" value="someOtherField"/>
<stateValue type="int" value="someOtherValue"/>
</then>
</stateChange>
</eventHandler>

(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">
<stateChange>
<stateAttribute type="constant" value="Foo"/>
<stateAttribute type="eventField" value="someOtherField"/>
<stateValue type="int" value="someOtherValue"/>
</stateChange>
</eventHandler>

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,

Robbert




_______________________________________________
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

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


Back to the top