# # Copyright (c) 2010-2024 Antmicro # # This file is licensed under the MIT License. # Full license text is available in 'licenses/MIT.txt'. # from struct import * class BaseEntry(Struct): def __init__(self, format): super(BaseEntry, self).__init__(format) self.realTime = 0 self.virtualTime = 0 self.entryType = -1 class MetricsParser: def __init__(self, filePath): self.filePath = filePath def get_instructions_entries(self): with open(self.filePath, "rb") as f: cpus, _ = self._parseHeader(f) return cpus, self._parse(f, b'\x00', '