Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tracecompass.incubator-dev] Plotting a Simple XY Chart

Hi  Geneviève,

I have attached the script (Script.txt) and trace (Sample Trace.txt) files and also a screenshot of the XY chart (trace_XY_chart.PNG) that I am getting. As you can see in the screenshot, the Y axis is taking the quark values. How can I make it take the cpu_load values instead? (The third column in the trace file represents the cpu loads.) 

I have also attached the custom parser that I have used (sample_trace_custom_parser.xml).

Thanks,
Basavaraj


On Sat, 16 Nov 2019 at 01:52, Geneviève Bastien <gbastien+lttng@xxxxxxxxxxxx> wrote:

Hi Basavaraj,


It's hard to answer your question without seeing what you did, maybe you could share a screenshot or the script? In any case, make sure the content of the state system that you are trying to display is OK.

Which examples have you used? How did you get to know about EASE? Have you seen this tutorial lab about writing EASE analyses: https://github.com/tuxology/tracevizlab/tree/master/labs/204-scripted-analysis-for-custom-instrumentation

Look at task 6, that shows how to view what's inside your state system before building a data provider. The next task creates a time graph data provider, which could as well be an XY data provider.


HTH,

Geneviève


On 11/15/19 2:22 AM, Basavaraj Munnoli wrote:
Hello community,

I have a simple trace that has some event types along with their cpu loads (in percentages) and timestamps. I want to plot a simple line graph (timpestamp vs cpu load in %) for each event type. I have followed the example scripts and by using createXYProvider(analysis, map) and openXYChartView(provider) functions I have been able to get a line graph for each event type, with time stamp on the X axis. However, the Y axis displays quark values. I am not getting how to make my Y axis use the cpu load values instead of quark values. Need support in this regard.

P.S.: I am using _javascript_ in EASE framework.

Thanks,
Basavaraj Munnoli



_______________________________________________
tracecompass.incubator-dev mailing list
tracecompass.incubator-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/tracecompass.incubator-dev
_______________________________________________
tracecompass.incubator-dev mailing list
tracecompass.incubator-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/tracecompass.incubator-dev
//This is the javascript file

loadModule("/TraceCompass/Trace");
loadModule('/TraceCompass/Analysis');
loadModule('/TraceCompass/DataProvider');
loadModule('/TraceCompass/View');

// Get the currently active trace
var trace = getActiveTrace();

if (trace == null) {
	  print("Trace is null");
	  exit();
} 

// Get the Statistics module (by name) for that trace
var analysis = getTraceAnalysis(trace, 'Statistics');
print(analysis);
print(trace);
if (analysis == null) {
	  print("Statistics analysis not found");
	  exit();
}

// Prepare the parameters for the data provider:
var map = new java.util.HashMap();
print(map);
map.put(ENTRY_PATH, 'event_types/*');
map.put(ENTRY_DELTA, false);
print(map);
// create a XY data provider
var provider = createXYProvider(analysis, map);

// Open an XY chart with this data provider
if (provider != null) {
	  openXYChartView(provider);
}

Attachment: trace_XY_chart.PNG
Description: PNG image

13:32:25.257000 Line1 0.39 
13:32:25.257000 Line2 0.31 
13:32:25.257000 Line3 94.66 
13:32:25.257000 Line4 94.56 
13:32:25.258000 Line5 95.93 
13:32:25.258000 Line6 97.36 
13:32:25.258000 Line7 95.97 
13:32:25.258000 Line8 95.55 
13:32:25.258000 Line9 0.47 
13:32:25.258000 Line10 4.85 
13:32:25.258000 Line11 0.24 
13:32:25.258000 Line12 0.23 
13:32:25.258000 Line13 0.93 
13:32:25.258000 Line14 5.07 
13:32:25.258000 Line15 0.48 
13:32:25.258000 Line16 1.23 
13:32:25.258000 Line17 0.69 
13:32:25.259000 Line18 97.50 
13:32:25.259000 Line19 74.91 
13:32:25.306000 Line20 1.72 
13:32:25.306000 Line21 1.29 
13:32:25.306000 Line22 1.62 
13:32:25.306000 Line23 9.57 
13:32:25.306000 Line24 1.31 
13:32:25.306000 Line25 1.98 
13:32:25.306000 Line26 77.78 
13:32:25.362000 Line27 1.02 
13:32:25.362000 Line28 83.33 
13:32:25.362000 Line29 3.50 
13:32:25.362000 Line30 83.17 
13:32:25.457000 Line31 2.78 
13:32:25.457000 Line32 96.73 
13:32:25.457000 Line33 96.48 
13:32:25.457000 Line34 96.76 
13:32:25.457000 Line35 2.80 
13:32:25.457000 Line36 95.67 
13:32:25.457000 Line37 96.73 
13:32:25.457000 Line38 2.79 
13:32:25.457000 Line39 96.54 
13:32:25.457000 Line40 1.51 
13:32:25.457000 Line41 2.02 
13:32:25.457000 Line42 3.25 
13:32:25.458000 Line43 8.42 
13:32:25.458000 Line44 85.74 
13:32:25.458000 Line45 3.73 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<CustomTxtTraceDefinitionList>
<Definition category="Custom Text" name="sample">
<InputLine>
<Cardinality max="2147483647" min="0"/>
<RegEx>\s*(\d{2}:\d{2}:\d{2}.\d{6})\s+([\.\_a-zA-Z0-9]+)\s+([0-9.]+)\s</RegEx>
<InputData action="0" format="hh:mm:ss.SSSSSS" name="Timestamp" tag="TIMESTAMP"/>
<InputData action="0" format="" name="Event type" tag="EVENT_TYPE"/>
<InputData action="0" format="" name="load" tag="OTHER"/>
</InputLine>
<OutputColumn name="Timestamp" tag="TIMESTAMP"/>
<OutputColumn name="Event type" tag="EVENT_TYPE"/>
<OutputColumn name="load" tag="OTHER"/>
</Definition>
</CustomTxtTraceDefinitionList>

Back to the top