for (std::map<std::string, int>::iterator i = type_count.begin(); i != type_count.end(); ++i) {
std::cout << " " << i->first << ": " << i->second << std::endl;
}
+
+ std::cout << "Errors: " << scan.errors.size() << std::endl;
+ if (scan.errors.size()) {
+ for (JournalScanner::ErrorMap::const_iterator i = scan.errors.begin();
+ i != scan.errors.end(); ++i) {
+ std::cout << " 0x" << std::hex << i->first << std::dec
+ << ": " << i->second.r << " "
+ << i->second.description << std::endl;
+ }
+ }
}
LogEvent *log_event;
uint32_t raw_size; //< Size from start offset including all encoding overhead
};
+
+ class EventError {
+ public:
+ int r;
+ std::string description;
+ EventError(int r_, const std::string &desc_)
+ : r(r_), description(desc_) {}
+ };
+
typedef std::map<uint64_t, EventRecord> EventMap;
+ typedef std::map<uint64_t, EventError> ErrorMap;
typedef std::pair<uint64_t, uint64_t> Range;
bool pointer_present;
bool pointer_valid;
std::vector<uint64_t> events_valid;
EventMap events;
+ // For events present in ::events (i.e. scanned successfully),
+ // any subsequent errors handling them (e.g. replaying)
+ ErrorMap errors;
+
+
private:
// Forbid copy construction because I have ptr members
JournalScanner(const JournalScanner &rhs);
if (r == 0) {
r = scav_r;
}
- // Our goal is to read all we can, so don't stop on errors
+ // Our goal is to read all we can, so don't stop on errors, but
+ // do record them for possible later output
+ js.errors.insert(std::make_pair(i->first,
+ JournalScanner::EventError(scav_r, cpp_strerror(r))));
}
}
}