summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni.dodonov@intel.com>2011-11-04 20:19:00 -0200
committerEugeni Dodonov <eugeni.dodonov@intel.com>2012-01-06 13:34:40 -0200
commit49ac702236323c62a2ad2bfae62e6922a9c368db (patch)
treed6ae84d299950943b46dc898e8d7fbd7ecb953df
parente394e03dcc4170ffc244ac04dce2c59c2ff32f5e (diff)
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 <eugeni.dodonov@intel.com>
-rwxr-xr-xtools/intel_gpu_analyser.py55
1 files changed, 55 insertions, 0 deletions
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 <command to profile>" % sys.argv[0]
+ sys.exit(1)
+ results = collect(sys.argv[1])
+ analyse(results)
+ print results