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>2011-11-09 11:44:32 -0200
commit3ae38a52d31014cf7ae3cf9f43f51e50468144c0 (patch)
tree080b185be115b52f8b92513a780f3a834e6925fc
parentdaadc63a1c391b9e1c587c7187ecbda51677e500 (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