import-trace: split into public and protected iface
Change-Id: I4b7d15f9181b1485d0546a77bd8d4f400b2fa880
This commit is contained in:
@ -45,6 +45,8 @@ class AdvancedMemoryImporter : public MemoryImporter {
|
||||
|
||||
public:
|
||||
AdvancedMemoryImporter() : m_last_was_conditional_branch(false) {}
|
||||
|
||||
protected:
|
||||
virtual std::string database_additional_columns();
|
||||
virtual void database_insert_columns(std::string& sql, unsigned& num_columns);
|
||||
virtual bool database_insert_data(Trace_Event &ev, MYSQL_BIND *bind, unsigned num_columns, bool is_fake);
|
||||
|
||||
@ -64,17 +64,7 @@ protected:
|
||||
instruction_count_t m_last_instr;
|
||||
fail::simtime_t m_last_time;
|
||||
|
||||
public:
|
||||
Importer() : m_sanitychecks(false), m_extended_trace(false), m_row_count(0), m_time_trace_start(0) {}
|
||||
bool init(const std::string &variant, const std::string &benchmark, fail::Database *db);
|
||||
|
||||
/**
|
||||
* Callback function that can be used to add command line options
|
||||
* to the cmd interface
|
||||
*/
|
||||
virtual bool cb_commandline_init() { return true; }
|
||||
|
||||
virtual bool create_database();
|
||||
protected:
|
||||
/**
|
||||
* Allows specialized importers to add more table columns instead of
|
||||
* completely overriding create_database(). The returned SQL CREATE TABLE
|
||||
@ -95,8 +85,6 @@ public:
|
||||
* columns specified by database_insert_columns().
|
||||
*/
|
||||
virtual bool database_insert_data(Trace_Event &ev, MYSQL_BIND *bind, unsigned num_columns, bool is_fake) { return true; }
|
||||
virtual bool copy_to_database(fail::ProtoIStream &ps);
|
||||
virtual bool clear_database();
|
||||
/**
|
||||
* Use this variant if passing through the IP/MEM event does not make any
|
||||
* sense for your Importer implementation.
|
||||
@ -122,6 +110,20 @@ public:
|
||||
*/
|
||||
virtual bool trace_end_reached() { return true; }
|
||||
|
||||
public:
|
||||
Importer() : m_sanitychecks(false), m_extended_trace(false), m_row_count(0), m_time_trace_start(0) {}
|
||||
bool init(const std::string &variant, const std::string &benchmark, fail::Database *db);
|
||||
|
||||
/**
|
||||
* Callback function that can be used to add command line options
|
||||
* to the cmd interface
|
||||
*/
|
||||
virtual bool cb_commandline_init() { return true; }
|
||||
|
||||
virtual bool create_database();
|
||||
virtual bool copy_to_database(fail::ProtoIStream &ps);
|
||||
virtual bool clear_database();
|
||||
|
||||
void set_elf(fail::ElfReader *elf) { m_elf = elf; }
|
||||
|
||||
void set_memorymap(fail::MemoryMap *mm) { m_mm = mm; }
|
||||
|
||||
@ -9,7 +9,7 @@ class InstructionImporter : public Importer {
|
||||
llvm::OwningPtr<llvm::object::Binary> binary;
|
||||
llvm::OwningPtr<fail::LLVMDisassembler> disas;
|
||||
|
||||
public:
|
||||
protected:
|
||||
virtual bool handle_ip_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
Trace_Event &ev);
|
||||
virtual bool handle_mem_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
|
||||
@ -6,8 +6,7 @@
|
||||
|
||||
class MemoryImporter : public Importer {
|
||||
|
||||
public:
|
||||
|
||||
protected:
|
||||
virtual bool handle_ip_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
Trace_Event &ev);
|
||||
virtual bool handle_mem_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
|
||||
@ -23,6 +23,7 @@ public:
|
||||
*/
|
||||
virtual bool cb_commandline_init();
|
||||
|
||||
protected:
|
||||
virtual bool handle_ip_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
Trace_Event &ev);
|
||||
virtual bool handle_mem_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
|
||||
@ -28,6 +28,7 @@ public:
|
||||
*/
|
||||
virtual bool cb_commandline_init();
|
||||
|
||||
protected:
|
||||
virtual bool handle_ip_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
Trace_Event &ev);
|
||||
virtual bool handle_mem_event(fail::simtime_t curtime, instruction_count_t instr,
|
||||
|
||||
Reference in New Issue
Block a user