tracelttng

What's wrong with my trace compass analysis?


I've generated an event stream with an lttng-ust, using the header file, contatining the following event declaration:

TRACEPOINT_EVENT(
random_chart,
point,
TP_ARGS(
    int, value_arg
),
TP_FIELDS(
    ctf_integer( int, value, value_arg )
))

After successfully opening it in a TraceCompass, I've tried to write an analysis with an XYChart, showing this value stream as a simple plot. My XML file contains the following:

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

<!-- The state provider assigns states from events -->
<stateProvider id="org.eclipse.linuxtools.ust.random_chart" version="1">
    <head>
        <traceType id="org.eclipse.linuxtools.lttng2.ust.tracetype" />
        <label value="Value chart analysis" />
    </head>

    <!-- Event handlers -->
    <eventHandler eventName="random_chart:point">
        <stateChange>               
            <stateAttribute type="constant" value="Dummy" />
            <stateAttribute type="constant" value="Value" />
            <stateValue type="eventField" value="value" />
        </stateChange>
    </eventHandler>
</stateProvider>

<!-- This is the definition of the XY chart view -->
<xyView id="my.test.xy.chart.view">
    <head>
        <analysis id="org.eclipse.linuxtools.ust.random_chart" />
    </head>

    <entry path="Dummy/Value">
        <display type="constant" value="Value" />
        <name type="self" />
    </entry>
</xyView>

I can't see what's wrong with it (even after reading all the related xml-schema files in a git-repository).

I can import this successfully, but after clicking on an 'XML XY Chart View' I see an empty plot and a single (last in the event stream) value under the 'type filter text'.

AFAIK the 'State System Explorer' shows me correct 'Value at timestamp' corresponding to the 'Full attribute path' equal to 'Dummy/Value'. Probably I miss something.

EDIT1: I've tried to fix, but still have no luck:

<entry path="Dummy"> <display type="constant" value="Value" /> <name type="self" /> </entry>

EDIT2: Same problem with:

<entry path="Dummy/Value">
   <display type="self" />
   <name type="self" />
</entry>

Solution

  • You have 2 possibilities to fix the problem, given that you have only one attribute with data:

    1- Change the <entry path="Dummy/Value"> to <entry path="Dummy"> and keep the rest

    or

    2- Keep your entry and change the display element to <display type="self" />

    A display of type constant means it tries to read an attribute of that name under the main path, so here, it was trying to read "Dummy/Value/Value", which doesn't exist

    EDIT: Here's a working example of the view part for your analysis:

    <xyView id="my.test.xy.chart.view">
    <head>
        <analysis id="org.eclipse.linuxtools.ust.random_chart" />
        <label value="Random view" />
    </head>
    
    <entry path="Dummy">
        <display type="constant" value="Value" />
        <name type="self" />
    </entry>
    </xyView>