diff -r 9835f2157f30 -r f69f7b67823f src/python/m5/stats/sql.py --- a/src/python/m5/stats/sql.py Tue Jan 15 18:36:36 2013 +0000 +++ b/src/python/m5/stats/sql.py Tue Jan 15 18:37:43 2013 +0000 @@ -86,6 +86,7 @@ Column('y', Integer), Column('type', String), Column('formula', String), + Column('length', Integer), ) # Stores scalar values @@ -155,6 +156,7 @@ y = Column(Integer) type = Column(String) formula = Column(String) + length = Column(Integer) def __init__(self, stat): self.name = stat.name @@ -172,6 +174,12 @@ self.prereq = stat.prereq self.type = stat.type + if stat.type == "VectorInfo" or stat.type == "FormulaInfo" \ + or stat.type == "Vector2dInfo": + self.length = len(stat.value) + else: + self.length = 1 + if stat.type == "VectorInfo": self.subnames = ','.join(stat.subnames) self.subdescs = ','.join(stat.subdescs) @@ -201,9 +209,9 @@ def __repr__(self): return "" % (self.id, self.name, self.desc, self.subnames, + '%s','%s', '%d')>" % (self.id, self.name, self.desc, self.subnames, self.y_subnames, self.subdescs, self.precision, self.prereq, - self.flags, self.x, self.y, self.type, self.formula) + self.flags, self.x, self.y, self.type, self.formula, self.length) # @brief Class used to insert scalar stats into the database.