tools/import-trace: import timing information + various additions

- Import timing information from traces that were recorded with timing.
- Allow restricting import to a memory map ("vertical" restriction).
- Proper fault-space right-margin handling.
- Cleanups, data-type usage, etc.

Change-Id: I7a49e8e9e49894c458e884bfc234f36b9ba8b130
This commit is contained in:
Horst Schirmeier
2013-04-08 15:02:53 +02:00
parent 0f16f18d75
commit 9273872d43
6 changed files with 193 additions and 77 deletions

View File

@ -7,17 +7,19 @@
#include "util/ElfReader.hpp"
#include "sal/SALConfig.hpp"
#include "util/Database.hpp"
#include "util/MemoryMap.hpp"
#include "comm/TracePlugin.pb.h"
class Importer {
protected:
int m_variant_id;
fail::ElfReader *m_elf;
fail::MemoryMap *m_mm;
char m_faultspace_rightmargin;
fail::Database *db;
public:
typedef unsigned instruction_count_t;
typedef unsigned instruction_count_t; //!< not big enough for some benchmarks
bool init(const std::string &variant, const std::string &benchmark, fail::Database *db);
@ -25,12 +27,16 @@ public:
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,
fail::simtime_t time_begin, fail::simtime_t time_end,
const Trace_Event &event, bool is_fake = false) = 0;
void set_elf_file(fail::ElfReader *elf) { m_elf = elf; }
void set_memorymap(fail::MemoryMap *mm) { m_mm = mm; }
void set_faultspace_rightmargin(char accesstype) { m_faultspace_rightmargin = accesstype; }
protected:
private:
typedef std::map<fail::address_t, instruction_count_t> AddrLastaccessMap;
struct leftmargin_info_t { instruction_count_t dyninstr; fail::simtime_t time; };
typedef std::map<fail::address_t, leftmargin_info_t> AddrLastaccessMap;
};
#endif