2017-06-04 20:38:34 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
#include <cstdint>
|
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
namespace EightBit {
|
|
|
|
class Profiler {
|
|
|
|
public:
|
|
|
|
Profiler();
|
|
|
|
~Profiler();
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
void addInstruction(uint8_t instruction);
|
|
|
|
void addAddress(uint16_t address);
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
void dump() const;
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
private:
|
|
|
|
std::array<uint64_t, 0x100> m_instructions;
|
|
|
|
std::array<uint64_t, 0x10000> m_addresses;
|
2017-06-04 20:38:34 +00:00
|
|
|
|
2017-06-05 21:39:15 +00:00
|
|
|
void dumpInstructionProfiles() const;
|
|
|
|
void dumpAddressProfiles() const;
|
|
|
|
};
|
|
|
|
}
|