mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-26 11:41:35 +01:00
ported bst-vs-heap
This commit is contained in:
18
gem5-stat
18
gem5-stat
@@ -1,20 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
import re
|
||||
import common
|
||||
parser = common.get_argparse(
|
||||
argparse_args={'description':'Get the value of a gem5 stat from the stats.txt file.'}
|
||||
)
|
||||
parser.add_argument(
|
||||
'stat',
|
||||
default='^system.cpu[0-9]*.numCycles$',
|
||||
help='Python regexp matching the full stat name of interest',
|
||||
nargs='?',
|
||||
'stat',
|
||||
default=None,
|
||||
help='Python regexp matching the full stat name of interest',
|
||||
nargs='?',
|
||||
)
|
||||
args = common.setup(parser)
|
||||
stat_re = re.compile(args.stat)
|
||||
with open(common.stats_file, 'r') as statfile:
|
||||
for line in statfile:
|
||||
if line[0] != '-':
|
||||
cols = line.split()
|
||||
if len(cols) > 1 and stat_re.search(cols[0]):
|
||||
print(cols[1])
|
||||
stats = common.get_stats(args.stat)
|
||||
print('\n'.join(stats))
|
||||
|
||||
Reference in New Issue
Block a user