gem5-stat: update

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-22 00:00:00 +00:00
parent a33366d3e0
commit 040d37c766

View File

@@ -1,14 +1,26 @@
#!/usr/bin/env python3
import common
parser = self.get_argparse(
argparse_args={'description':'Get the value of a gem5 stat from the stats.txt file.'}
)
parser.add_argument(
'stat',
default=None,
help='Python regexp matching the full stat name of interest',
nargs='?',
)
args = self.setup(parser)
stats = self.get_stats(kwargs['stat'])
print('\n'.join(stats))
class Main(common.LkmcCliFunction):
def __init__(self):
super().__init__(
defaults={
'print_time': False,
},
description='''\
Get the value of a gem5 stat from the stats.txt file.
''',
)
self.add_argument(
'stat',
help='Python regexp matching the full stat name of interest',
nargs='?',
)
def timed_main(self):
stats = self.get_stats(self.env['stat'])
print('\n'.join(stats))
if __name__ == '__main__':
Main().cli()