mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-22 17:55:57 +01:00
bst vs heap: move in fully from cpp-cheat
This commit is contained in:
37
bst-vs-heap-vs-hashmap-gem5-stats
Executable file
37
bst-vs-heap-vs-hashmap-gem5-stats
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user