diff options
author | Nathan Binkert <binkertn@umich.edu> | 2005-12-19 02:02:58 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2005-12-19 02:02:58 -0500 |
commit | adf47c95b0e1cdea9f17569f6c26a118f32f574b (patch) | |
tree | 67e39325f7f589d4b5f9acd68f7acd82577ab671 /util | |
parent | a95fcf7df03fc1a876169e42ad6f38919cd9af74 (diff) | |
download | gem5-adf47c95b0e1cdea9f17569f6c26a118f32f574b.tar.xz |
Add a little bit of support to grab info for making graphs
without using the jobfile.
util/stats/db.py:
util/stats/profile.py:
Make it possible to send job as a string and to set the system
separately from the job.
--HG--
extra : convert_revision : 08aaebd3f9a1643bd41953b43f3b80dc97e6592f
Diffstat (limited to 'util')
-rw-r--r-- | util/stats/db.py | 23 | ||||
-rw-r--r-- | util/stats/profile.py | 13 |
2 files changed, 23 insertions, 13 deletions
diff --git a/util/stats/db.py b/util/stats/db.py index 8e57f9043..d9b78c7d1 100644 --- a/util/stats/db.py +++ b/util/stats/db.py @@ -152,17 +152,24 @@ class Database(object): self.method = 'sum' self._method = type(self).sum - def get(self, job, stat): - run = self.allRunNames.get(job.name, None) + def get(self, job, stat, system=None): + run = self.allRunNames.get(str(job), None) if run is None: return None - from info import scalar, vector, value, values, total, len - stat.system = self[job.system] - if scalar(stat): - return value(stat, run.run) - if vector(stat): - return values(stat, run.run) + from info import ProxyError, scalar, vector, value, values, total, len + if system is None and hasattr('system', job): + system = job.system + + if system is not None: + stat.system = self[system] + try: + if scalar(stat): + return value(stat, run.run) + if vector(stat): + return values(stat, run.run) + except ProxyError: + return None return None diff --git a/util/stats/profile.py b/util/stats/profile.py index 151170280..f28c5867c 100644 --- a/util/stats/profile.py +++ b/util/stats/profile.py @@ -283,13 +283,16 @@ class Profile(object): for cpu,data in cpus.iteritems(): yield run,cpu,data - def get(self, job, stat): - if job.system is None: + def get(self, job, stat, system=None): + if system is None and hasattr('system', job): + system = job.system + + if system is None: raise AttributeError, 'The job must have a system set' - run = job.name - cpu = '%s.run%d' % (job.system, self.cpu) - data = self.getdata(run, cpu) + cpu = '%s.run%d' % (system, self.cpu) + + data = self.getdata(str(job), cpu) if not data: return None |