summaryrefslogtreecommitdiff
path: root/util/stats/db.py
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2005-01-14 17:50:36 -0500
committerAli Saidi <saidi@eecs.umich.edu>2005-01-14 17:50:36 -0500
commitdfecc891509d318ffaefee95b6c6a1ec83b6f28d (patch)
tree5e99249c4f387962d276d902de9fde6bf1ab6ee5 /util/stats/db.py
parent3e5a3df24f06b22ee1c155f3e3d3948d9140754a (diff)
downloadgem5-dfecc891509d318ffaefee95b6c6a1ec83b6f28d.tar.xz
added stats code to check stability
util/stats/db.py: added working listticks (for printing) and retticks(for using in python) code util/stats/stats.py: added stability function that checks if all samples are within 10% of mean. --HG-- extra : convert_revision : 7eb1714db75e456f248fe7cae73db1c57642947d
Diffstat (limited to 'util/stats/db.py')
-rw-r--r--util/stats/db.py35
1 files changed, 31 insertions, 4 deletions
diff --git a/util/stats/db.py b/util/stats/db.py
index 495cdb5b5..ed5d10bc2 100644
--- a/util/stats/db.py
+++ b/util/stats/db.py
@@ -207,16 +207,43 @@ class Database(object):
# Name: listTicks
# Desc: Prints all samples for a given run
- def listTicks(self, run=None):
+ def listTicks(self, runs=None):
print "tick"
print "----------------------------------------"
- sql = 'select distinct dt_tick from data where dt_stat=1950'
- #if run != None:
- # sql += ' where dt_run=%d' % run
+ sql = 'select distinct dt_tick from data where dt_stat=1180 and ('
+ if runs != None:
+ first = True
+ for run in runs:
+ if first:
+ # sql += ' where'
+ first = False
+ else:
+ sql += ' or'
+ sql += ' dt_run=%s' % run.run
+ sql += ')'
self.query(sql)
for r in self.cursor.fetchall():
print r[0]
+ # Name: retTicks
+ # Desc: Prints all samples for a given run
+ def retTicks(self, runs=None):
+ sql = 'select distinct dt_tick from data where dt_stat=1180 and ('
+ if runs != None:
+ first = True
+ for run in runs:
+ if first:
+ first = False
+ else:
+ sql += ' or'
+ sql += ' dt_run=%s' % run.run
+ sql += ')'
+ self.query(sql)
+ ret = []
+ for r in self.cursor.fetchall():
+ ret.append(r[0])
+ return ret
+
# Name: liststats
# Desc: Prints all statistics that appear in the database,
# the optional argument is a regular expression that can