summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/intel_gpu_analyze.py28
1 files changed, 23 insertions, 5 deletions
diff --git a/tools/intel_gpu_analyze.py b/tools/intel_gpu_analyze.py
index a9edcfe..c2e60e9 100755
--- a/tools/intel_gpu_analyze.py
+++ b/tools/intel_gpu_analyze.py
@@ -31,6 +31,12 @@ p {
<h3>Execution lasted %(duration).2f seconds</h3>
"""
+PERF_REFERENCE="""
+<p>
+<a href="%(perf)s">Kernel perf results analysis</a>
+</p>
+"""
+
MINMAXAVG="""
<p>
<h3>%(descr)s:</h3>
@@ -54,8 +60,8 @@ PERF_ITERATION="""
<a name="%(sec)d">
<h3>Second %(sec)d</h3>
</a>
-Processes in execution: <i>%(processes)s</i>
-<br/>
+
+Processes in execution:
"""
PERF_SECOND_TITLE="""
@@ -63,8 +69,14 @@ PERF_SECOND_TITLE="""
<br/>
"""
+PERF_PROCESS_REF="""
+<a href="#%(sec)d.%(process)s">%(process)s</a>
+"""
+
PERF_PROCESS="""
+<a name="%(sec)d.%(process)s">
<h3>Process %(process)s</h3>
+</a>
"""
PERF_TOP="""
@@ -174,7 +186,9 @@ def analyse_perf(logfile, out_dir, perf="perf.html"):
for sec in seconds:
print >>output, PERF_ITERATION % {'sec': sec, 'processes': ', '.join(results[sec].keys())}
for process in results[sec]:
- print >>output, PERF_PROCESS % {'process': process}
+ print >>output, PERF_PROCESS_REF % {'sec': sec, 'process': process}
+ for process in results[sec]:
+ print >>output, PERF_PROCESS % {'sec': sec, 'process': process}
# let's sort functions
functions_by_time = sorted(results[sec][process], key=lambda key: results[sec][process][key], reverse=True)
top = ""
@@ -184,7 +198,7 @@ def analyse_perf(logfile, out_dir, perf="perf.html"):
print >>output, TAIL
output.close()
-def analyse(results, title, out_dir, summary="index.html"):
+def analyse(results, title, out_dir, perf_logfile=None, summary="index.html"):
"""Analyses intel_gpu_top results"""
# calculate min/max/avg values
keys = results.keys()
@@ -231,6 +245,10 @@ def analyse(results, title, out_dir, summary="index.html"):
'avg': avgval_s,
}
+ # Do we have perf results?
+ if perf_logfile:
+ print >>output, PERF_REFERENCE % {'perf': 'perf.html'}
+
# graphics
try:
import pylab
@@ -461,6 +479,6 @@ if __name__ == "__main__":
pass
if logfile:
results = collect(logfile)
- analyse(results, title, output)
+ analyse(results, title, output, perf_logfile=perf_logfile)
if perf_logfile:
analyse_perf(perf_logfile, output)