src/worker.cc
// Print error information about a data miscompare.
Print error information about a data miscompare.
Print error information about a data miscompare .
void FileThread::ProcessError(struct ErrorRecord *error,
                              int priority,
                              const char *message) {
  char dimm_string[256] = "";
  os_->Flush(error->vaddr);
  error->reread = *(error->vaddr);
  char *good = reinterpret_cast<char*>(&(error->expected));
  char *bad = reinterpret_cast<char*>(&(error->actual));
  sat_assert(error->expected != error->actual);
  unsigned int offset = 0;
  for (offset = 0; offset < (sizeof(error->expected) - 1); offset++) {
    if (good[offset] != bad[offset])
      break;
  }
  error->vbyteaddr = reinterpret_cast<char*>(error->vaddr) + offset;
  error->paddr = os_->VirtualToPhysical(error->vbyteaddr);
  os_->FindDimm(error->paddr, dimm_string, sizeof(dimm_string));
  if (crc_page_ != -1) {
    int miscompare_byteoffset = static_cast<char*>(error->vbyteaddr) -
                                static_cast<char*>(page_recs_[crc_page_].dst);
    os_->error_diagnoser_->AddHDDMiscompareError(devicename_,
                                                 crc_page_,
                                                 miscompare_byteoffset,
                                                 page_recs_[crc_page_].src,
                                                 page_recs_[crc_page_].dst);
  } else {
    os_->error_diagnoser_->AddMiscompareError(dimm_string,
                                              reinterpret_cast<uint64>
                                              (error->vaddr), 1);
  }
  logprintf(priority,
            "%s: miscompare on %s at %p(0x%llx:%s): read:0x%016llx, "
            "reread:0x%016llx expected:0x%016llx\n",
            message,
            devicename_.c_str(),
            error->vaddr,
            error->paddr,
            dimm_string,
            error->actual,
            error->reread,
            error->expected);
  *(error->vaddr) = error->expected;
  os_->Flush(error->vaddr);
}
void FileThread :: ProcessError ( struct ErrorRecord * error , int priority , const char * message ) { char dimm_string [ 256 ] = " " ; os_ -> Flush ( error -> vaddr ) ; error -> reread = * ( error -> vaddr ) ; char * good = reinterpret_cast < char * > ( & ( error -> expected ) ) ; char * bad = reinterpret_cast < char * > ( & ( error -> actual ) ) ; sat_assert ( error -> expected != error -> actual ) ; unsigned int offset = 0 ; for ( offset = 0 ; offset < ( sizeof ( error -> expected ) - 1 ) ; offset ++ ) { if ( good [ offset ] != bad [ offset ] ) break ; } error -> vbyteaddr = reinterpret_cast < char * > ( error -> vaddr ) + offset ; error -> paddr = os_ -> VirtualToPhysical ( error -> vbyteaddr ) ; os_ -> FindDimm ( error -> paddr , dimm_string , sizeof ( dimm_string ) ) ; if ( crc_page_ != -1 ) { int miscompare_byteoffset = static_cast < char * > ( error -> vbyteaddr ) - static_cast < char * > ( page_recs_ [ crc_page_ ] . dst ) ; os_ -> error_diagnoser_ -> AddHDDMiscompareError ( devicename_ , crc_page_ , miscompare_byteoffset , page_recs_ [ crc_page_ ] . src , page_recs_ [ crc_page_ ] . dst ) ; } else { os_ -> error_diagnoser_ -> AddMiscompareError ( dimm_string , reinterpret_cast < uint64 > ( error -> vaddr ) , 1 ) ; } logprintf ( priority , " " " \n " , message , devicename_ . c_str ( ) , error -> vaddr , error -> paddr , dimm_string , error -> actual , error -> reread , error -> expected ) ; * ( error -> vaddr ) = error -> expected ; os_ -> Flush ( error -> vaddr ) ; }
Print error information about a data miscompare.
Print error information about a data miscompare .
// Determine if this is a write or read error. // Find physical address if possible. // Pretty print DIMM mapping if available. // If crc_page_ is valid, ie checking content read back from file, // track src/dst memory addresses. Otherwise catagorize as general // mememory miscompare for CRC checking everywhere else. // Overwrite incorrect data with correct data to prevent // future miscompares when this data is reused.