import-trace: add --no-write-ecs switch

If you only need raw failure counts, no-effect write equivalence classes
are redundant and only slow down access to the trace and fspgroup tables.
This switch prevents any accesstype='W' entries from finding their way into
the trace table.

Change-Id: Ifb415994063a2107769bc80ebd2fd780de5a4dda
This commit is contained in:
Horst Schirmeier
2013-07-09 19:29:00 +02:00
parent d39a9278ff
commit d961ac0a72
3 changed files with 12 additions and 1 deletions

View File

@ -249,6 +249,10 @@ bool Importer::add_trace_event(margin_info_t &begin, margin_info_t &end,
bool Importer::add_trace_event(margin_info_t &begin, margin_info_t &end,
Trace_Event &event, bool is_fake) {
if (!m_import_write_ecs && event.accesstype() == event.WRITE) {
return true;
}
// insert extended trace info if configured and available
bool extended = m_extended_trace && event.has_trace_ext();

View File

@ -23,6 +23,7 @@ protected:
fail::MemoryMap *m_mm;
char m_faultspace_rightmargin;
bool m_sanitychecks;
bool m_import_write_ecs;
bool m_extended_trace;
fail::Database *db;
fail::Architecture m_arch;
@ -111,7 +112,7 @@ protected:
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) {}
Importer() : m_sanitychecks(false), m_import_write_ecs(true), 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);
/**
@ -129,6 +130,7 @@ public:
void set_memorymap(fail::MemoryMap *mm) { m_mm = mm; }
void set_faultspace_rightmargin(char accesstype) { m_faultspace_rightmargin = accesstype; }
void set_sanitychecks(bool enabled) { m_sanitychecks = enabled; }
void set_import_write_ecs(bool enabled) { m_import_write_ecs = enabled; }
void set_extended_trace(bool enabled) { m_extended_trace = enabled; }
};

View File

@ -87,6 +87,10 @@ int main(int argc, char *argv[]) {
CommandLine::option_handle NO_DELETE =
cmd.addOption("", "no-delete", Arg::None,
"--no-delete \tAssume there are no DB entries for this variant/benchmark, don't issue a DELETE");
CommandLine::option_handle NO_WRITE_ECS =
cmd.addOption("", "no-write-ecs", Arg::None,
"--no-write-ecs \tDo not import any write ECs into the database; "
"results in a perforated fault space and is OK if you only use absolute failure numbers");
CommandLine::option_handle EXTENDED_TRACE =
cmd.addOption("", "extended-trace", Arg::None,
"--extended-trace \tImport extended trace information if available");
@ -214,6 +218,7 @@ int main(int argc, char *argv[]) {
importer->set_sanitychecks(cmd[ENABLE_SANITYCHECKS]);
importer->set_extended_trace(cmd[EXTENDED_TRACE]);
importer->set_import_write_ecs(!cmd[NO_WRITE_ECS]);
if (!importer->init(variant, benchmark, db)) {
LOG << "importer->init() failed" << endl;