From 950adac80e3089678efa373b0e67dc23d55a320c Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Wed, 8 May 2013 16:55:48 +0200 Subject: [PATCH] tools/import-trace: cover complete fault space We need to cover the complete fault space when a memory map is provided. This means fake trace entries for completely unaccessed addresses (e.g., unused parts of the stack), and makes sure we include all of our fault space in the statistics later. Without a memory map, we just don't know the extents of our fault space; just guessing by using the minimum and maximum addresses is not a good idea, we might have large holes in the fault space. Change-Id: Ieb4b30a2e41a9921b969bf88513bfbacfc290c93 --- tools/import-trace/Importer.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/import-trace/Importer.cc b/tools/import-trace/Importer.cc index d872eb58..66fc8edb 100644 --- a/tools/import-trace/Importer.cc +++ b/tools/import-trace/Importer.cc @@ -125,6 +125,21 @@ bool Importer::copy_to_database(fail::ProtoIStream &ps) { } } + // Create an open EC for every entry in the memory map we didn't encounter + // in the trace. If we don't, non-accessed rows in the fault space will be + // missing later (e.g., unused parts of the stack). Without a memory map, + // we just don't know the extents of our fault space; just guessing by + // using the minimum and maximum addresses is not a good idea, we might + // have large holes in the fault space. + if (m_mm) { + for (MemoryMap::iterator it = m_mm->begin(); it != m_mm->end(); ++it) { + if (open_ecs.count(*it) == 0) { + open_ecs[*it].dyninstr = 0; + open_ecs[*it].time = time_trace_start; + } + } + } + // Close all open intervals (right end of the fault-space) with fake trace // event. This ensures we have a rectangular fault space (important for, // e.g., calculating the total SDC rate), and unknown memory accesses after