Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass-dev] Problems importing simple values from

Hi Joerg,


Few things:


1) Your parser currently does not handle timestamps correctly. In the editor in Trace Compass, you can select the type of the group to be "TimeStamp". Then, on the place where you have currently specified the time stamp, you can specify the format for the output format, that is, how it will show in your graphs. (e.g. hh:mm:ss:SSSSSS).


2) For your analysis to show up in below your trace, I had to specifcy the trace type as: <traceType id="custom.txt.trace:CSV:MyDebugTrace"/> (but I may not be on the latest release)


3) In this case, the "eventName" of your eventHandler should correspond to a the name of your tracing as defined in your parser, in this case "MyDebugTrace"


4) In the event handler, to track only the uservalue, you don't need the valueid field. Furthermore, the uservalue should be of type "eventField" since you want to show a variable, rather than a constant. 

There is another argument you can use to force the field to be read as int, which is forcedType="int"


5) In the view definition, the display value should refer to one of the values specified in the event handler, or should just show everything (display type="self")


See below for a revised version of your parser, analysis and view definition (don't forget to change your parser too):


parser:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CustomTxtTraceDefinitionList>
<Definition category="CSV" name="MyDebugTrace">
<TimeStampOutputFormat>hh:mm:ss:SSSSSS</TimeStampOutputFormat>
<InputLine>
<Cardinality max="2147483647" min="0"/>
<RegEx>([0-9.]*),UserValue,Id=(\d+),Value=(\d+)\S*</RegEx>
<InputData action="" format="Tm.SS" name="Time Stamp"/>
<InputData action="" format="" name="ValueId"/>
<InputData action="" format="" name="UserValue"/>
</InputLine>
<OutputColumn name="ValueId"/>
<OutputColumn name="UserValue"/>
<OutputColumn name="Time Stamp"/>
</Definition>
</CustomTxtTraceDefinitionList>


analysis: 


<?xml version="1.0" encoding="UTF-8"?>
<tmfxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/xmlDefinition.xsd">

    <stateProvider version="0" id="org.eclipse.tracecompass.uservalue.analysis">
        <head>
            <!--<traceType id="mytrace:CSV:MyDebugTrace" />-->
<traceType id="custom.txt.trace:CSV:MyDebugTrace"/>
            <label value="My TraceLog Analysis" />
        </head>
        
<!--<eventHandler eventName="EvUserValue">-->
        <eventHandler eventName="MyDebugTrace">
            <stateChange>
<stateAttribute type="constant" value="UserValues" />
            <!--<stateAttribute type="eventField" value="ValueId" />
                <stateValue type="int" value="UserValue" />-->
<stateAttribute type="constant" value="UserValue - or another name for the line"/>
                <stateValue type="eventField" value="UserValue" forcedType="int"/>
            </stateChange>
       </eventHandler>
    </stateProvider>
    
    <xyView id="my.test.xy.chart.view">
        <head>
            <analysis id="org.eclipse.tracecompass.uservalue.analysis" />
            <label value="User value XY view" />
        </head>

<entry path="UserValues/*">
            <!--<display type="constant" value="value" />
            <name type="self" />-->
<display type="self"/>
        </entry>
    </xyView>

</tmfxml>



Kind regards,


Robbert


Van: tracecompass-dev-bounces@xxxxxxxxxxx <tracecompass-dev-bounces@xxxxxxxxxxx> namens Jörg Weinhardt <jw@xxxxxxxxxxxxxxx>
Verzonden: donderdag 27 oktober 2016 22:44:21
Aan: tracecompass-dev@xxxxxxxxxxx
Onderwerp: Re: [tracecompass-dev] Problems importing simple values from
 
Hi Robbert,

thank you for your hints. I alread read that docs and could get my task switch logs into a timeGraphView. But I have no Idea how to
configure the a stateProvider for a kind of value "pass through" to a XY chart.

Here is my current test environment:

input Log data:
002.3,UserValue,Id=1,Value=0
005.2,UserValue,Id=1,Value=100
008.0,UserValue,Id=1,Value=120
010.0,UserValue,Id=2,Value=1

The parser:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CustomTxtTraceDefinitionList>

<Definition category="CSV" name="MyDebugTrace">
<TimeStampOutputFormat>Tm.SS</TimeStampOutputFormat>
<InputLine>
<Cardinality max="2147483647" min="0"/>
<RegEx>([0-9.]*),UserValue,Id=(\d+),Value=(\d+)\S*</RegEx>
<EventType>EvUserValue</EventType>
<InputData action="" format="Tm.SS" name="Timestamp" tag="TIMESTAMP"/>
<InputData action="" format="" name="ValueId" tag="OTHER"/>
<InputData action="" format="" name="UserValue" tag="OTHER"/>
</InputLine>
<OutputColumn name="Timestamp" tag="TIMESTAMP"/>
<OutputColumn name="ValueId" tag="OTHER"/>
<OutputColumn name="UserValue" tag="OTHER"/>
</Definition>
</CustomTxtTraceDefinitionList>


.. and the analysis XML (not working):

<?xml version="1.0" encoding="UTF-8"?>
<tmfxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../org.eclipse.tracecompass.tmf.analysis.xml.core/src/org/eclipse/tracecompass/tmf/analysis/xml/core/module/xmlDefinition.xsd">

    <stateProvider version="0" id="org.eclipse.tracecompass.uservalue.analysis">
        <head>
            <traceType id="mytrace:CSV:MyDebugTrace" />
            <label value="My TraceLog Analysis" />
        </head>
       
        <eventHandler eventName="EvUserValue">
            <stateChange>
                <stateAttribute type="constant" value="UserValues" />
                <stateAttribute type="eventField" value="ValueId" />
                <stateValue type="int" value="UserValue" />
            </stateChange>
       </eventHandler>
    </stateProvider>
   
    <xyView id="my.test.xy.chart.view">
        <head>
            <analysis id="org.eclipse.tracecompass.uservalue.analysis" />
            <label value="User value XY view" />
        </head>

        <entry path="UserValues/*">
            <display type="constant" value="value" />
            <name type="self" />
        </entry>
    </xyView>

</tmfxml>

What I want is simply track the value "UserValue" from the Log entries at a XY chart over the time.

kind regards,
Joerg

Am 27.10.2016 um 18:00 schrieb tracecompass-dev-request@xxxxxxxxxxx:
> ------------------------------
>
> Message: 2
> Date: Thu, 27 Oct 2016 10:11:54 +0000
> From: Robbert Jongeling <robbert.jongeling@xxxxxxxx>
> To: "tracecompass-dev@xxxxxxxxxxx" <tracecompass-dev@xxxxxxxxxxx>
> Subject: Re: [tracecompass-dev] Problems importing simple values from
>        CSV
> Message-ID:
>        <HE1PR08MB0505554ECEB1BAADA8AE23D691AA0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
>       
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Joerg,
>
>
> Have you checked the User Guide on creating a state provider http://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/Data-driven-analysis.html#Defining_an_XML_state_provider and on defining an XY chart http://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/Data-driven-analysis.html#Defining_an_XML_XY_chart ?
>
>
> There is also an example XML state provider and view definition available here: https://github.com/tracecompass/xml-analysis-example/blob/master/xml/ust-example-analysis.xml
>
>
>
> It's difficult to say what the problem is without your XML state provider and view definition :)
>
>
>
> 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

Back to the top