hyperplatform_log_parser/log_line_parser.cpp
// Attempts to parse a line reported by MemoryMonRWE
Attempts to parse a line reported by MemoryMonRWE
Attempts to parse a line reported by MemoryMonRWE
bool LogLineParser::TryParseRweLog() {
  std::regex regex(
    "[SR]= ([[:xdigit:]]{" + pointer_size_ + "}) "
       "\\(([[:xdigit:]]{" + pointer_size_ + "})\\), "
     "[D]= ([[:xdigit:]]{" + pointer_size_ + "}) "
       "\\(([[:xdigit:]]{" + pointer_size_ + "})\\), "
    "T= [RWE]");
  std::smatch match;
  if (!std::regex_match(message_, match, regex)) {
    return false;
  }
  const auto s_address = std::stoull(match[1].str(), nullptr, 16);
  const auto s_base = std::stoull(match[2].str(), nullptr, 16);
  const auto d_address = std::stoull(match[3].str(), nullptr, 16);
  const auto d_base = std::stoull(match[4].str(), nullptr, 16);
  const auto s_symbol = driver_symbol_resolver_.GetName(s_address, s_base);
  const auto d_symbol = driver_symbol_resolver_.GetName(d_address, d_base);
  const std::string format_string = "%s %5u:%5u S= %-50S, D= %-50S\n";
  printf(format_string.c_str(), time_.c_str(), pid_, tid_, s_symbol.c_str(),
         d_symbol.c_str());
  return true;
}
bool LogLineParser :: TryParseRweLog ( ) { std :: regex regex ( " " + pointer_size_ + " " " \\ " + pointer_size_ + " \\ " " " + pointer_size_ + " " " \\ " + pointer_size_ + " \\ " " " ) ; std :: smatch match ; if ( ! std :: regex_match ( message_ , match , regex ) ) { return false ; } const auto s_address = std :: stoull ( match [ 1 ] . str ( ) , nullptr , 16 ) ; const auto s_base = std :: stoull ( match [ 2 ] . str ( ) , nullptr , 16 ) ; const auto d_address = std :: stoull ( match [ 3 ] . str ( ) , nullptr , 16 ) ; const auto d_base = std :: stoull ( match [ 4 ] . str ( ) , nullptr , 16 ) ; const auto s_symbol = driver_symbol_resolver_ . GetName ( s_address , s_base ) ; const auto d_symbol = driver_symbol_resolver_ . GetName ( d_address , d_base ) ; const std :: string format_string = " \n " ; printf ( format_string . c_str ( ) , time_ . c_str ( ) , pid_ , tid_ , s_symbol . c_str ( ) , d_symbol . c_str ( ) ) ; return true ; }
Attempts to parse a line reported by MemoryMonRWE
Attempts to parse a line reported by MemoryMonRWE
// clang-format off // clang-format on // Successfully parsed. Print it to STDIO