Files
linux-kernel-module-cheat/bst-vs-heap-vs-hashmap-gem5-stats
Ciro Santilli 六四事件 法轮功 178a6681df bst vs heap: move in fully from cpp-cheat
2019-06-26 00:00:00 +00:00

38 lines
950 B
Python
Executable File

#!/usr/bin/env python3
import common
class Main(common.LkmcCliFunction):
def __init__(self):
super().__init__(
defaults={
'emulator': 'gem5',
'show_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 heap_num_cycles in it:
try:
bst_num_cycles = next(it)
hashmap_num_cycles = next(it)
except StopIteration:
# Automatic dumpstats at end may lead to one extra stat at the end.
break
print('{} {} {} {}'.format(
i,
heap_num_cycles,
bst_num_cycles,
hashmap_num_cycles,
))
i += 1
if __name__ == '__main__':
Main().cli()