diff options
author | Eugeni Dodonov <eugeni.dodonov@intel.com> | 2011-11-07 23:48:28 -0200 |
---|---|---|
committer | Eugeni Dodonov <eugeni.dodonov@intel.com> | 2011-11-09 11:50:00 -0200 |
commit | 0c76e249ac3b9103a17a0cfcfd7e46d98da2e9dc (patch) | |
tree | 4d87138dd355667c9aa5b6e281e3511353f2f39f /tools | |
parent | 25b0c3737f889d4bdae3eced2e8b5b668d590a02 (diff) |
intel_gpu_analyze: improve graphics appearance
Proper time plotting and labels positions
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/intel_gpu_analyze.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/intel_gpu_analyze.py b/tools/intel_gpu_analyze.py index 7cfbe69..7189aac 100755 --- a/tools/intel_gpu_analyze.py +++ b/tools/intel_gpu_analyze.py @@ -160,21 +160,21 @@ def analyse_perf(logfile, out_dir, perf="perf.html"): time_prev = time # all done, now process the results + seconds = results.keys() + seconds.sort() output = open("%s/%s" % (out_dir, perf), "w") print >>output, HEADER % {'title': 'Perf results for %s' % logfile, - 'duration': len(results.keys()) + 'duration': len(seconds) } - seconds = results.keys() - seconds.sort() for sec in seconds: # print TOC - print >>output, PERF_SECOND_TITLE % {'sec': sec} + print >>output, PERF_SECOND_TITLE % {'sec': sec - seconds[0]} for sec in seconds: - print >>output, PERF_ITERATION % {'sec': sec, 'processes': ', '.join(results[sec].keys())} + print >>output, PERF_ITERATION % {'sec': sec - seconds[0], 'processes': ', '.join(results[sec].keys())} for process in results[sec]: - print >>output, PERF_PROCESS_REF % {'sec': sec, 'process': process} + print >>output, PERF_PROCESS_REF % {'sec': sec - seconds[0], 'process': process} for process in results[sec]: - print >>output, PERF_PROCESS % {'sec': sec, 'process': process} + print >>output, PERF_PROCESS % {'sec': sec - seconds[0], 'process': process} # let's sort functions functions_by_time = sorted(results[sec][process], key=lambda key: results[sec][process][key], reverse=True) top = "" @@ -243,6 +243,7 @@ def analyse(results, title, out_dir, perf_logfile=None, summary="index.html"): return fig = pylab.figure() ax = pylab.subplot(111) + box = ax.get_position() pylab.title("Summary of CPU/GPU/Power usage") pylab.ylabel("Usage (%)") pylab.xlabel("Time (s)") @@ -262,10 +263,10 @@ def analyse(results, title, out_dir, perf_logfile=None, summary="index.html"): ax2 = ax.twinx() ax2.plot(results['time'], results["power"], label="Power (W)", color='red') ax2.set_ylabel('Watts') + ax2.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) pylab.grid() # Shink current axis's height by 10% on the bottom - box = ax.get_position() ax.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) ax.legend(loc = 'upper center', ncol=num_axis, fancybox=True, shadow=True, bbox_to_anchor = (0.5, -0.1)) pylab.savefig("%s/plot_summary.svg" % out_dir, format="svg", dpi=200) @@ -368,6 +369,7 @@ def analyse(results, title, out_dir, perf_logfile=None, summary="index.html"): # Shink current axis's height by 10% on the bottom box = ax.get_position() ax.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) + ax2.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) ax.legend(loc = 'upper center', ncol=num_axis, fancybox=True, shadow=True, bbox_to_anchor = (0.5, -0.1)) ax2.legend(loc = 'upper center', ncol=3, fancybox=True, shadow=True, bbox_to_anchor = (0.5, 0.2)) pylab.savefig("%s/plot_power_gpu.svg" % out_dir, format="svg", dpi=200) @@ -399,6 +401,7 @@ def analyse(results, title, out_dir, perf_logfile=None, summary="index.html"): # Shink current axis's height by 10% on the bottom box = ax.get_position() ax.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) + ax2.set_position([box.x0, box.y0 + box.height * 0.1, box.width, box.height * 0.9]) ax.legend(loc = 'upper center', ncol=1, fancybox=True, shadow=True, bbox_to_anchor = (0.5, -0.1)) ax2.legend(loc = 'upper center', ncol=3, fancybox=True, shadow=True, bbox_to_anchor = (0.5, 0.2)) pylab.savefig("%s/plot_power_gpu_%s.svg" % (out_dir, ring), format="svg", dpi=200) |