gem5-stat 604 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python3
  2. import common
  3. class Main(common.LkmcCliFunction):
  4. def __init__(self):
  5. super().__init__(
  6. defaults={
  7. 'show_time': False,
  8. },
  9. description='''\
  10. Get the value of a gem5 stat from the stats.txt file.
  11. ''',
  12. )
  13. self.add_argument(
  14. 'stat',
  15. help='Python regexp matching the full stat name of interest',
  16. nargs='?',
  17. )
  18. def timed_main(self):
  19. stats = self.get_stats(self.env['stat'])
  20. print('\n'.join(stats))
  21. if __name__ == '__main__':
  22. Main().cli()