This tutorial aims to show how RTApp performance metrics are computed and reported by the perf analysis module provided by LISA.
In [1]:
import logging
from conf import LisaLogging
LisaLogging.setup()
In [2]:
# Execute this cell to report devlib debugging information
logging.getLogger('ssh').setLevel(logging.DEBUG)
In [3]:
# Generate plots inline
%pylab inline
import json
import os
In [9]:
# Let's use an example trace
res_dir = './example_rtapp'
trace_file = os.path.join(res_dir, 'trace.dat')
platform_file = os.path.join(res_dir, 'platform.json')
!tree {res_dir}
In [11]:
# Inspect the JSON file used to run the application
with open('{}/simple_00.json'.format(res_dir), 'r') as fh:
rtapp_json = json.load(fh, )
logging.info('Generated RTApp JSON file:')
print json.dumps(rtapp_json, indent=4, sort_keys=True)
In [12]:
# Suport for FTrace events parsing and visualization
import trappy
# NOTE: The interactive trace visualization is available only if you run
# the workload to generate a new trace-file
trappy.plotter.plot_trace(res_dir)
In [13]:
# Support for performance analysis of RTApp workloads
from perf_analysis import PerfAnalysis
# Parse the RT-App generate log files to compute performance metrics
pa = PerfAnalysis(res_dir)
# For each task which has generated a logfile, plot its performance metrics
for task in pa.tasks():
pa.plotPerf(task, "Performance plots for task [{}] ".format(task))