mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-29 04:54:27 +01:00
mtops.h is perfect now
This commit is contained in:
44
bst-vs-heap
44
bst-vs-heap
@@ -1,17 +1,31 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import common
|
||||
parser = self.get_argparse(
|
||||
argparse_args={'description':'Convert a BST vs heap stat file into a gnuplot input'}
|
||||
)
|
||||
args = self.setup(parser)
|
||||
stats = self.get_stats()
|
||||
it = iter(stats)
|
||||
i = 1
|
||||
for stat in it:
|
||||
try:
|
||||
next_stat = next(it)
|
||||
except StopIteration:
|
||||
# Automatic dumpstats at end may lead to odd number of stats.
|
||||
break
|
||||
print('{} {} {}'.format(i, stat, next_stat))
|
||||
i += 1
|
||||
|
||||
class Main(common.LkmcCliFunction):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
defaults={
|
||||
'emulator': 'gem5',
|
||||
'print_time': False,
|
||||
},
|
||||
description='''\
|
||||
Convert a BST vs heap stat file into a gnuplot input
|
||||
''',
|
||||
)
|
||||
|
||||
def timed_main(self):
|
||||
stats = self.get_stats()
|
||||
it = iter(stats)
|
||||
i = 1
|
||||
for stat in it:
|
||||
try:
|
||||
next_stat = next(it)
|
||||
except StopIteration:
|
||||
# Automatic dumpstats at end may lead to odd number of stats.
|
||||
break
|
||||
print('{} {} {}'.format(i, stat, next_stat))
|
||||
i += 1
|
||||
|
||||
if __name__ == '__main__':
|
||||
Main().cli()
|
||||
|
||||
Reference in New Issue
Block a user