From 49ac702236323c62a2ad2bfae62e6922a9c368db Mon Sep 17 00:00:00 2001 From: Eugeni Dodonov Date: Fri, 4 Nov 2011 20:19:00 -0200 Subject: tools: intel_gpu_analyser This tool is intended to analyse statistics collected by intel_gpu_top and kperf, and output summarized results for: - CPU usage (user and system time) - GPU usage (overall and per-ring) - Power usage in watts over time - Power usage relationship to CPU - Power usage relationship to GPU - Execution statistics For perf outputs, the entire recorded perf execution is processed in converted into a series of 'perf top'-like outputs for each process, for each second of the execution. Signed-off-by: Eugeni Dodonov --- tools/intel_gpu_analyser.py | 55 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 tools/intel_gpu_analyser.py diff --git a/tools/intel_gpu_analyser.py b/tools/intel_gpu_analyser.py new file mode 100755 index 0000000..a5b92f1 --- /dev/null +++ b/tools/intel_gpu_analyser.py @@ -0,0 +1,55 @@ +#!/usr/bin/python +# +# Intel GPU Top data analyser +# + +import sys +import os + +def collect(command): + """Collects statistics for a given command""" + print "Running %s" % command + fd = os.popen("intel_gpu_top -o - -e \"%s\"" % command) + results = {'time': [], + 'utime': [], + 'stime': [], + 'power': [], + 'render': [], + 'bitstr': [], + 'bitstr2': [], + 'blitter': [] + } + while True: + line = fd.readline() + if not line: + break + line.strip() + if line[0] == "#": + continue + data = line.split() + results['time'].append(float(data[0])) + results['utime'].append(float(data[1])) + results['stime'].append(float(data[2])) + results['power'].append(float(data[3])) + results['render'].append(float(data[4])) + results['bitstr'].append(float(data[6])) + results['bitstr2'].append(float(data[8])) + results['blitter'].append(float(data[10])) + return results + +def analyse(results): + """Analyses intel_gpu_top results""" + minpower = min(results['power']) + maxpower = max(results['power']) + avgpower = sum(results['power']) / len(results['power']) + print "Power: min %f, max %f, avg %f" % (minpower, maxpower, avgpower) + for iter in results: + pass + +if __name__ == "__main__": + if len(sys.argv) < 2: + print "Usage: %s " % sys.argv[0] + sys.exit(1) + results = collect(sys.argv[1]) + analyse(results) + print results -- cgit v1.2.3