summaryrefslogtreecommitdiff
path: root/util/stats
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2005-10-18 15:01:51 -0400
committerNathan Binkert <binkertn@umich.edu>2005-10-18 15:01:51 -0400
commit31d13e9a9b2a9624eec4e5bca6069f9779def3cf (patch)
tree857e66d58358df45b2bc0e51d96bccf882ecb968 /util/stats
parent2a1350e1682e3423718ae07e65855a1c3247105e (diff)
downloadgem5-31d13e9a9b2a9624eec4e5bca6069f9779def3cf.tar.xz
Improvements to the graphing output
util/stats/output.py: Create the graph directory if it doesn't exist Don't write out a graph if all of the jobs for that graph are missing --HG-- extra : convert_revision : 7993baf1a4be33a062f86a4f09791f01eaafa43c
Diffstat (limited to 'util/stats')
-rw-r--r--util/stats/output.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/util/stats/output.py b/util/stats/output.py
index 44dba5d15..f793749f7 100644
--- a/util/stats/output.py
+++ b/util/stats/output.py
@@ -96,10 +96,10 @@ class StatOutput(object):
self.printdata(printmode=printmode)
def graph(self, graphdir):
- from os.path import expanduser, join as joinpath
+ from os.path import expanduser, isdir, join as joinpath
from barchart import BarChart
- from matplotlib.numerix import Float, zeros
- import re
+ from matplotlib.numerix import Float, array, zeros
+ import os, re
confgroups = self.jobfile.groups()
ngroups = len(confgroups)
@@ -130,6 +130,8 @@ class StatOutput(object):
raise AttributeError, 'No group selected for graph bars'
directory = expanduser(graphdir)
+ if not isdir(directory):
+ os.mkdir(directory)
html = file(joinpath(directory, '%s.html' % self.name), 'w')
print >>html, '<html>'
print >>html, '<title>Graphs for %s</title>' % self.name
@@ -143,6 +145,8 @@ class StatOutput(object):
for g,gopt in enumerate(groupopts):
for b,bopt in enumerate(baropts):
job = self.jobfile.job(options + [ gopt, bopt ])
+ if not job:
+ continue
val = self.info.get(job, self.stat)
if val is None:
@@ -156,6 +160,10 @@ class StatOutput(object):
data[g][b] = val
+ data = array(data)
+ if data.sum() == 0:
+ continue
+
bar_descs = [ opt.desc for opt in baropts ]
group_descs = [ opt.desc for opt in groupopts ]
if stacked: