29a30,31
> import m5
>
33c35
< from m5.util import attrdict
---
> from m5.util import attrdict, fatal
34a37
> outputList = []
36c39,40
< internal.stats.initText(filename, desc)
---
> output = internal.stats.initText(filename, desc)
> outputList.append(output)
44,45c48,50
< internal.stats.initMySQL(host, database, user, passwd, project, name,
< sample)
---
> output = internal.stats.initMySQL(host, database, user, passwd,
> project, name, sample)
> outputList.append(output)
72a78,84
> for stat in stats_list:
> if not stat.check() or not stat.baseCheck():
> fatal("stat check failed for '%s' %d\n", stat.name, stat.id)
>
> if not (stat.flags & flags.display):
> stat.name = "__Stat%06d" % stat.id
>
80a93
> stat.enable()
82c95,97
< internal.stats.enable()
---
> def prepare():
> '''Prepare all stats for data access. This must be done before
> dumping and serialization.'''
83a99,102
> for stat in stats_list:
> stat.prepare()
>
> lastDump = 0
85,86c104
< # Currently prepare happens in the dump, but we should maybe move
< # that out.
---
> '''Dump all statistics data to the registered outputs'''
88,89c106
< #internal.stats.prepare()
< internal.stats.dump()
---
> curTick = m5.curTick()
90a108,122
> global lastDump
> assert lastDump <= curTick
> if lastDump == curTick:
> return
> lastDump = curTick
>
> prepare()
>
> for output in outputList:
> if output.valid():
> output.begin()
> for stat in stats_list:
> output.visit(stat)
> output.end()
>
91a124,125
> '''Reset all statistics to the base state'''
>
98c132,133
< internal.stats.reset()
---
> for stat in stats_list:
> stat.reset()
99a135,136
> internal.stats.processResetQueue()
>