tools/import-trace: new tool to import traces into MySQL database
The import tool does support the following import strategies: - BasicImporter: generates def-use equivalence classes for read and write memory accesses - DCiAOKernelImporter: generates equivalence classes for read access in the ciao kernel space. Change-Id: I8960561d3e14dcf5dffa3ff7a59b61a5e8f7e719
This commit is contained in:
36
tools/import-trace/Importer.hpp
Normal file
36
tools/import-trace/Importer.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef __IMPORTER_H__
|
||||
#define __IMPORTER_H__
|
||||
|
||||
#include <mysql/mysql.h>
|
||||
#include <map>
|
||||
#include "util/ProtoStream.hpp"
|
||||
#include "util/ElfReader.hpp"
|
||||
#include "sal/SALConfig.hpp"
|
||||
#include "util/Database.hpp"
|
||||
#include "trace.pb.h"
|
||||
|
||||
|
||||
class Importer {
|
||||
protected:
|
||||
int m_variant_id;
|
||||
fail::ElfReader *m_elf;
|
||||
fail::Database *db;
|
||||
|
||||
public:
|
||||
typedef unsigned instruction_count_t;
|
||||
|
||||
void init(const std::string &variant, const std::string &benchmark, fail::Database *db);
|
||||
|
||||
virtual bool create_database() = 0;
|
||||
virtual bool copy_to_database(fail::ProtoIStream &ps);
|
||||
virtual bool clear_database();
|
||||
virtual bool add_trace_event(instruction_count_t begin, instruction_count_t end,
|
||||
const Trace_Event &event, bool is_fake = false) = 0;
|
||||
|
||||
void set_elf_file(fail::ElfReader *elf) {m_elf = elf;};
|
||||
protected:
|
||||
private:
|
||||
typedef std::map<fail::address_t, instruction_count_t> AddrLastaccessMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user