mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
gem5-stat: update
This commit is contained in:
36
gem5-stat
36
gem5-stat
@@ -1,14 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import common
|
import common
|
||||||
parser = self.get_argparse(
|
|
||||||
argparse_args={'description':'Get the value of a gem5 stat from the stats.txt file.'}
|
class Main(common.LkmcCliFunction):
|
||||||
)
|
def __init__(self):
|
||||||
parser.add_argument(
|
super().__init__(
|
||||||
'stat',
|
defaults={
|
||||||
default=None,
|
'print_time': False,
|
||||||
help='Python regexp matching the full stat name of interest',
|
},
|
||||||
nargs='?',
|
description='''\
|
||||||
)
|
Get the value of a gem5 stat from the stats.txt file.
|
||||||
args = self.setup(parser)
|
''',
|
||||||
stats = self.get_stats(kwargs['stat'])
|
)
|
||||||
print('\n'.join(stats))
|
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user