void Fuzzer::ShuffleAndMinimize() { size_t MaxCov = 0; bool PreferSmall = (Options.PreferSmallDuringInitialShuffle == 1 || (Options.PreferSmallDuringInitialShuffle == -1 && rand() % 2)); if (Options.Verbosity) std::cerr << "PreferSmall: " << PreferSmall << "\n"; PrintStats("READ ", 0); std::vector<Unit> NewCorpus; std::random_shuffle(Corpus.begin(), Corpus.end()); if (PreferSmall) std::stable_sort( Corpus.begin(), Corpus.end(), [](const Unit &A, const Unit &B) { return A.size() < B.size(); }); Unit &U = CurrentUnit; for (const auto &C : Corpus) { for (size_t First = 0; First < 1; First++) { U.clear(); size_t Last = std::min(First + Options.MaxLen, C.size()); U.insert(U.begin(), C.begin() + First, C.begin() + Last); size_t NewCoverage = RunOne(U); if (NewCoverage) { MaxCov = NewCoverage; NewCorpus.push_back(U); if (Options.Verbosity >= 2) std::cerr << "NEW0: " << NewCoverage << " L " << U.size() << "\n"; } } } Corpus = NewCorpus; PrintStats("INITED", MaxCov); }
static BOOL WINAPI ConsoleCtrlHandler(DWORD ControlType) { switch (ControlType) { case CTRL_C_EVENT: PrintStats(); ConResPrintf(StdOut, IDS_CTRL_C); return FALSE; case CTRL_BREAK_EVENT: PrintStats(); ConResPrintf(StdOut, IDS_CTRL_BREAK); return TRUE; case CTRL_CLOSE_EVENT: PrintStats(); return FALSE; default: return FALSE; } }
void Fuzzer::ShuffleAndMinimize() { bool PreferSmall = (Options.PreferSmallDuringInitialShuffle == 1 || (Options.PreferSmallDuringInitialShuffle == -1 && USF.GetRand().RandBool())); if (Options.Verbosity) Printf("PreferSmall: %d\n", PreferSmall); PrintStats("READ "); std::vector<Unit> NewCorpus; if (Options.ShuffleAtStartUp) { std::random_shuffle(Corpus.begin(), Corpus.end(), USF.GetRand()); if (PreferSmall) std::stable_sort( Corpus.begin(), Corpus.end(), [](const Unit &A, const Unit &B) { return A.size() < B.size(); }); } Unit &U = CurrentUnit; for (const auto &C : Corpus) { for (size_t First = 0; First < 1; First++) { U.clear(); size_t Last = std::min(First + Options.MaxLen, C.size()); U.insert(U.begin(), C.begin() + First, C.begin() + Last); if (Options.OnlyASCII) ToASCII(U); if (RunOne(U)) { NewCorpus.push_back(U); if (Options.Verbosity >= 2) Printf("NEW0: %zd L %zd\n", LastRecordedBlockCoverage, U.size()); } } } Corpus = NewCorpus; for (auto &X : Corpus) UnitHashesAddedToCorpus.insert(Hash(X)); PrintStats("INITED"); }
void StatBooster::ProcessKeyStrokes(HANDLE processHandle, HWND windowHandle, int memoryAddress, bool &stopped, bool &active, bool &activeStatusChanged, CharStats *charStats, CharStats *storedCharStats, Stats *stats, POINT &store_btn_coord, POINT &recall_btn_coord, POINT &reroll_btn_coord) { int escKeyState = GetAsyncKeyState(VK_ESCAPE); int f1KeyState = GetKeyState(VK_F1); int f2KeyState = GetAsyncKeyState(VK_F2); int f5KeyState = GetAsyncKeyState(VK_F5); int f6KeyState = GetAsyncKeyState(VK_F6); int f7KeyState = GetAsyncKeyState(VK_F7); int f8KeyState = GetAsyncKeyState(VK_F8); if (escKeyState != 0) { stopped = true; } if (f1KeyState == 0 || f1KeyState == 1) { if (active != (f1KeyState == 1)) { active = (f1KeyState == 1); activeStatusChanged = true; } } if (f2KeyState != 0 && !charStats->isBg1TomesUsed()) { charStats->setBg1TomesUsed(true); system("cls"); UpdateStats(processHandle, memoryAddress, charStats, stats, true); AddBG1TomeStats(processHandle, memoryAddress, charStats->getStrength(), charStats->getDexterity(), charStats->getConstitution(), charStats->getIntelligence(), charStats->getWisdom(), charStats->getCharisma()); UpdateStats(processHandle, memoryAddress, charStats, stats, false); PrintStats(charStats, storedCharStats, stats); } if (f5KeyState != 0) { UpdateMouseCoord(windowHandle, store_btn_coord); } if (f6KeyState != 0) { UpdateMouseCoord(windowHandle, recall_btn_coord); } if (f7KeyState != 0) { UpdateMouseCoord(windowHandle, reroll_btn_coord); } if (f8KeyState != 0) { storedCharStats->reset(); system("cls"); PrintStats(charStats, storedCharStats, stats); } }
int main(const int argc, const char *argv[]) { int nextarg; NaClLogModuleInit(); NaClLogSetVerbosity(LOG_FATAL); if (0 != setvbuf(stdout, g_standard_output_buffer, _IOLBF, sizeof g_standard_output_buffer)) { NaClLog(LOG_FATAL, "vdiff: setvbuf failed\n"); } #if NACL_LINUX || NACL_OSX srandom(time(NULL)); #endif VDiffInitializeAvailableDecoders(); nextarg = ParseArgv(argc, argv); if (nextarg == argc) { if (gPrefix == 0) RunRegressionTests(); TestAllInstructions(); } else { int i; gVerbose = TRUE; for (i = nextarg; i < argc; ++i) { TestOneInstruction(argv[i]); } } PrintStats(); /* exit with non-zero error code if there were errors. */ exit(gVDiffStats.errors != 0); }
/******************************************************************* * Function Name: PrintStats * Return Type : int * Created On : Oct 27, 2013 * Created By : hrushi * Comments : Prints the Mean, Median, Standard Dev. the EM Score * Arguments : *******************************************************************/ int GroundTruth::PrintStats( const Args& args ) const { vector<double> AllScoreVal; string ScoreSavePath = GetSavePath( args ); cout << "Saving to: " << ScoreSavePath << endl; cv::FileStorage fScore; fScore.open(ScoreSavePath, cv::FileStorage::WRITE); AllScoreVal.reserve(m_vScores.size()); for( auto ClassName : RGN_TYPES ) { vector<double> ClassScoreVal; for(const auto& val : m_vScores ) { AllScoreVal.push_back( val.second ); ClassScoreVal.push_back( val.second ); } PrintAllVals(args, fScore, ClassName, ClassScoreVal); } fScore.release(); PrintStats(args, AllScoreVal); return EXIT_SUCCESS; }
void Fuzzer::RereadOutputCorpus() { if (Options.OutputCorpus.empty()) return; std::vector<Unit> AdditionalCorpus; ReadDirToVectorOfUnits(Options.OutputCorpus.c_str(), &AdditionalCorpus, &EpochOfLastReadOfOutputCorpus); if (Corpus.empty()) { Corpus = AdditionalCorpus; return; } if (!Options.Reload) return; if (Options.Verbosity >= 2) Printf("Reload: read %zd new units.\n", AdditionalCorpus.size()); for (auto &X : AdditionalCorpus) { if (X.size() > (size_t)Options.MaxLen) X.resize(Options.MaxLen); if (UnitHashesAddedToCorpus.insert(Hash(X)).second) { CurrentUnit.clear(); CurrentUnit.insert(CurrentUnit.begin(), X.begin(), X.end()); if (RunOne(CurrentUnit)) { Corpus.push_back(X); if (Options.Verbosity >= 1) PrintStats("RELOAD"); } } } }
void Fuzzer::RereadOutputCorpus(size_t MaxSize) { if (Options.OutputCorpus.empty()) return; std::vector<Unit> AdditionalCorpus; ReadDirToVectorOfUnits(Options.OutputCorpus.c_str(), &AdditionalCorpus, &EpochOfLastReadOfOutputCorpus, MaxSize); if (Corpus.empty()) { Corpus = AdditionalCorpus; return; } if (!Options.Reload) return; if (Options.Verbosity >= 2) Printf("Reload: read %zd new units.\n", AdditionalCorpus.size()); for (auto &X : AdditionalCorpus) { if (X.size() > MaxSize) X.resize(MaxSize); if (UnitHashesAddedToCorpus.insert(Hash(X)).second) { if (RunOne(X)) { Corpus.push_back(X); UpdateCorpusDistribution(); PrintStats("RELOAD"); } } } }
// Finds minimal number of units in 'Extra' that add coverage to 'Initial'. // We do it by actually executing the units, sometimes more than once, // because we may be using different coverage-like signals and the only // common thing between them is that we can say "this unit found new stuff". UnitVector Fuzzer::FindExtraUnits(const UnitVector &Initial, const UnitVector &Extra) { UnitVector Res = Extra; size_t OldSize = Res.size(); for (int Iter = 0; Iter < 10; Iter++) { ShuffleCorpus(&Res); ResetCoverage(); for (auto &U : Initial) RunOne(U); Corpus.clear(); for (auto &U : Res) if (RunOne(U)) Corpus.push_back(U); char Stat[7] = "MIN "; Stat[3] = '0' + Iter; PrintStats(Stat); size_t NewSize = Corpus.size(); assert(NewSize <= OldSize); Res.swap(Corpus); if (NewSize + 5 >= OldSize) break; OldSize = NewSize; } return Res; }
///===================================================== /// ///===================================================== SignpostMemoryManager::~SignpostMemoryManager() { #ifndef NDEBUG m_criticalSection.Enter(); delete m_allocationTracking; m_allocationTracking = nullptr; m_criticalSection.Exit(); #endif PrintStats(); if (firstSignpost->m_next != nullptr) { __debugbreak(); } if (firstSignpost->m_prev != nullptr) { __debugbreak(); } if (firstSignpost->m_isFree != true) { __debugbreak(); } if (firstSignpost->m_size != m_size - sizeof(Signpost)) { __debugbreak(); } free(m_buffer); ConsolePrintf("\nSUCCESSFULLY SHUTDOWN MEMORY MANAGER\n\n"); }
static void LoopTransfer() { printf("* Loop Transfers -- reading & writing alternately.\n"); T_0 = time(NULL); // starting time while (dwRC == USBIO_ERR_SUCCESS) { static DWORD n = 0; // First we get the length (+ the packet size) GetLength(); if (dwRC == USBIO_ERR_SUCCESS) { // Then we read 'Length' bytes ReadData(); } if (dwRC == USBIO_ERR_SUCCESS) { // Now we send the received data back to the client. WriteData(); } if (dwRC == USBIO_ERR_SUCCESS) { // Finally, sometimes we print some statistics if (TransferMode == ELoopDebug) PrintStatsEveryLoop(); else if ((++n % KLoopModeDisplayUpdate) == 0) PrintStats(); } } }
static void NET_Stats_f (void) { qsocket_t *s; if (Cmd_Argc () == 1) { Con_Printf("unreliable messages sent = %i\n", unreliableMessagesSent); Con_Printf("unreliable messages recv = %i\n", unreliableMessagesReceived); Con_Printf("reliable messages sent = %i\n", messagesSent); Con_Printf("reliable messages received = %i\n", messagesReceived); Con_Printf("packetsSent = %i\n", packetsSent); Con_Printf("packetsReSent = %i\n", packetsReSent); Con_Printf("packetsReceived = %i\n", packetsReceived); Con_Printf("receivedDuplicateCount = %i\n", receivedDuplicateCount); Con_Printf("shortPacketCount = %i\n", shortPacketCount); Con_Printf("droppedDatagrams = %i\n", droppedDatagrams); } else if (Q_strcmp(Cmd_Argv(1), "*") == 0) { for (s = net_activeSockets; s; s = s->next) PrintStats(s); for (s = net_freeSockets; s; s = s->next) PrintStats(s); } else { for (s = net_activeSockets; s; s = s->next) { if (q_strcasecmp(Cmd_Argv(1), s->address) == 0) break; } if (s == NULL) { for (s = net_freeSockets; s; s = s->next) { if (q_strcasecmp(Cmd_Argv(1), s->address) == 0) break; } } if (s == NULL) return; PrintStats(s); } }
MemPoolDebug::~MemPoolDebug() { myAliveCheck(); if (myVerbosityLevel > 0) LogStream() << "[Log] MemPoolDebug(\"" << myName << "\"): dtor commencing" << endl; if (myInUseCount != 0) DtorErrorMesg(); if (myVerbosityLevel > 0) PrintStats(); if (myVerbosityLevel > 0) LogStream() << "[Log] MemPoolDebug(\"" << myName << "\"): dtor completed" << endl; myAliveOrDead = ~AliveMark; // Useful telltale for debugging }
void Fuzzer::PrintStatusForNewUnit(const Unit &U) { if (!Options.PrintNEW) return; PrintStats("NEW ", ""); if (Options.Verbosity) { Printf(" L: %zd ", U.size()); MD.PrintMutationSequence(); Printf("\n"); } }
void TakeAShot(CS170::WarBoats::Ocean &ocean, const CS170::WarBoats::Point& pt) { CS170::WarBoats::ShotResult sr; std::cout << "Shot: " << pt.x << ", " << pt.y << " "; sr = CS170::WarBoats::TakeShot(ocean, pt); PrintShotResult(sr); PrintStats(GetShotStats(ocean)); CS170::WarBoats::DumpOcean(ocean); std::cout << std::endl; }
// Experimental search heuristic: drilling. // - Read, shuffle, execute and minimize the corpus. // - Choose one random unit. // - Reset the coverage. // - Start fuzzing as if the chosen unit was the only element of the corpus. // - When done, reset the coverage again. // - Merge the newly created corpus into the original one. void Fuzzer::Drill() { // The corpus is already read, shuffled, and minimized. assert(!Corpus.empty()); Options.PrintNEW = false; // Don't print NEW status lines when drilling. Unit U = ChooseUnitToMutate(); CHECK_WEAK_API_FUNCTION(__sanitizer_reset_coverage); __sanitizer_reset_coverage(); std::vector<Unit> SavedCorpus; SavedCorpus.swap(Corpus); Corpus.push_back(U); assert(Corpus.size() == 1); RunOne(U); PrintStats("DRILL "); std::string SavedOutputCorpusPath; // Don't write new units while drilling. SavedOutputCorpusPath.swap(Options.OutputCorpus); Loop(); __sanitizer_reset_coverage(); PrintStats("REINIT"); SavedOutputCorpusPath.swap(Options.OutputCorpus); for (auto &U : SavedCorpus) { CurrentUnit = U; RunOne(U); } PrintStats("MERGE "); Options.PrintNEW = true; size_t NumMerged = 0; for (auto &U : Corpus) { CurrentUnit = U; if (RunOne(U)) { PrintStatusForNewUnit(U); NumMerged++; WriteToOutputCorpus(U); } } PrintStats("MERGED"); if (NumMerged && Options.Verbosity) Printf("Drilling discovered %zd new units\n", NumMerged); }
/******************************************************************* * Function Name: Print_ConfusionMat * Return Type : int * Created On : Jul 8, 2013 * Created By : hrushi * Comments : Print the Confusion Matrix * Arguments : *******************************************************************/ int GroundTruth::Print_ConfusionMat( const Args& args ) const { cout << "Confusion Matrix is : " << endl; cout << " *****" << " Predicted " << "*****" << endl; for( UINT i = 0; i < GND_CATEGORIES; i++ ) { cout << m_RowHeader.at(i) << "\t"; UINT Row_Sum(0); for( UINT j = 0; j < GND_CATEGORIES; j++ ) { cout << std::setw(4) << m_ConfusionMat[i][j] << " & "; Row_Sum += m_ConfusionMat[i][j]; if( j == (GND_CATEGORIES - 1) ) { cout << std::setw(4) << Row_Sum; } } cout << endl; } cout << endl; UINT TotalSum(0); cout << "Total \t"; for( UINT j = 0; j < GND_CATEGORIES; j++ ) { UINT Col_Sum(0); for( UINT i = 0; i < GND_CATEGORIES; i++ ) { Col_Sum += m_ConfusionMat[i][j]; TotalSum += m_ConfusionMat[i][j]; } cout << std::setw(4) << Col_Sum << " & "; if( j == (GND_CATEGORIES - 1) ) { cout << std::setw(4) << TotalSum; } } cout << endl; PrintStats( args ); return EXIT_SUCCESS; }
void Fuzzer::ShuffleAndMinimize() { PrintStats("READ "); std::vector<Unit> NewCorpus; if (Options.ShuffleAtStartUp) ShuffleCorpus(&Corpus); for (const auto &U : Corpus) { if (RunOne(U)) { NewCorpus.push_back(U); if (Options.Verbosity >= 2) Printf("NEW0: %zd L %zd\n", MaxCoverage.BlockCoverage, U.size()); } } Corpus = NewCorpus; UpdateCorpusDistribution(); for (auto &X : Corpus) UnitHashesAddedToCorpus.insert(Hash(X)); PrintStats("INITED"); CheckForMemoryLeaks(); }
void FeaturesStatistics::Compute() { UInt32 tr,gr; ExecuteParalelCommand(THREAD_COMMAND_COMPUTE); MEMSET(Feats.GetPtrToObject(0),0,sizeof(GML::ML::FeatureInformation)*con->GetFeatureCount()); for (tr=0;tr<threadsCount;tr++) { for (gr=0;gr<con->GetFeatureCount();gr++) { Feats[gr].countPozitive += ((FeaturesStatisticsThreadData *)ThData[tr].Context)->Feats[gr].countPozitive; Feats[gr].totalPozitive += ((FeaturesStatisticsThreadData *)ThData[tr].Context)->Feats[gr].totalPozitive; Feats[gr].countNegative += ((FeaturesStatisticsThreadData *)ThData[tr].Context)->Feats[gr].countNegative; Feats[gr].totalNegative += ((FeaturesStatisticsThreadData *)ThData[tr].Context)->Feats[gr].totalNegative; } } notif->Info("[%s] -> DataBase processed ok",ObjectName); for (tr=0;tr<con->GetFeatureCount();tr++) { ComputedData[tr].Index = tr; for (gr=0;gr<statFuncCount;gr++) ComputedData[tr].fnValue[gr] = GML::ML::FeatStatsFunctions::GetFunctionPointer(gr)(Feats.GetPtrToObject(tr)) * multiplyFactor; if (sortBy<0xFFFF) ComputedData[tr].compareValue = ComputedData[tr].fnValue[sortBy]; } // am calculat si valorile // verific daca am vreun weight de salvat if (saveFeatureWeightFile<statFuncCount) { if (FeaturesWeightFile.Len()==0) { notif->Error("[%s] In order to save '%s' values for a feature you have to complete 'FeaturesWeightFile' property with the name of the file where the features will be saved", ObjectName, GML::ML::FeatStatsFunctions::GetFunctionName(saveFeatureWeightFile)); } else { SaveFeatureWeightFile(); } } // sortez if (sortBy!=0xFFFF) { notif->Info("[%s] -> Sorting data ... ",ObjectName); ComputedData.Sort(Compare_FeaturesInformations,sortDirection==0); } notif->Info("[%s] -> Saving result ... ",ObjectName); // printez if (notifyResults) PrintStats(); // salvez if (ResultFile.Len()>0) SaveToFile(); }
void Fuzzer::PrintStatusForNewUnit(const Unit &U) { if (!Options.PrintNEW) return; PrintStats("NEW ", ""); if (Options.Verbosity) { Printf(" L: %zd", U.size()); if (U.size() < 30) { Printf(" "); PrintUnitInASCII(U, "\t"); Print(U); } Printf("\n"); } }
void Display(){ // main drawing routine - called every frame glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glLoadIdentity(); // camera at default (zero) position and orientation RenderModel(); PrintStats(); glLoadIdentity(); RenderStrings(); glPopMatrix(); glFlush(); SwapBuffers(hDC); /* nop if singlebuffered */ }
void StatDump(void) { FILE *dumpfile; int i; //! // @category compat // @arg <filename> // // Dump statistics information to the specified file on the levels // that were played. The output from this option matches the output // from statdump.exe (see ctrlapi.zip in the /idgames archive). // i = M_CheckParmWithArgs("-statdump", 1); if (i > 0) { printf("Statistics captured for %i level(s)\n", num_captured_stats); // We actually know what the real gamemission is, but this has // to match the output from statdump.exe. DiscoverGamemode(captured_stats, num_captured_stats); // Allow "-" as output file, for stdout. if (strcmp(myargv[i + 1], "-") != 0) { dumpfile = fopen(myargv[i + 1], "w"); } else { dumpfile = NULL; } for (i = 0; i < num_captured_stats; ++i) { PrintStats(dumpfile, &captured_stats[i]); } if (dumpfile != NULL) { fclose(dumpfile); } } }
void Fuzzer::ReportNewCoverage(size_t NewCoverage, const Unit &U) { if (!NewCoverage) return; Corpus.push_back(U); UnitHashesAddedToCorpus.insert(Hash(U)); PrintStats("NEW ", NewCoverage, ""); if (Options.Verbosity) { Printf(" L: %zd", U.size()); if (U.size() < 30) { Printf(" "); PrintUnitInASCIIOrTokens(U, "\t"); Print(U); } Printf("\n"); } WriteToOutputCorpus(U); if (Options.ExitOnFirst) exit(0); }
void Fuzzer::ReportNewCoverage(size_t NewCoverage, const Unit &U) { if (!NewCoverage) return; Corpus.push_back(U); UnitsAddedAfterInitialLoad.insert(U); PrintStats("NEW ", NewCoverage, ""); if (Options.Verbosity) { std::cerr << " L: " << U.size(); if (U.size() < 30) { std::cerr << " "; PrintUnitInASCIIOrTokens(U, "\t"); Print(U); } std::cerr << "\n"; } WriteToOutputCorpus(U); if (Options.ExitOnFirst) exit(0); }
int main(int argc, char *argv[]) { #if EXPORT_OBJS ExportMeshes(); #endif #if EXPORT_IMAGES ExportErrorImages(); #endif #if PRINT_STATS PrintStats(); #endif #if PRINT_CREATION_TIMES PrintCreationTimes(); #endif return 0; }
static int HandleTimer(zloop_t *wloop, int timer_id, void *arg) { if(!gHeartBeat){ printf("Connection lost, reconnecting...\n"); gExit = false; return -1; } { proto::Request req; req.set_type(proto::Request::STATS); req.set_reqid(++gNextReqID); req.set_version(gClientVersion); req.set_height(gBlock.height()); proto::ClientStats& stats = *req.mutable_stats(); int ngpus = gClient->GetStats(stats); stats.set_addr(gAddr); stats.set_name(gClientName); stats.set_clientid(gClientID); stats.set_instanceid(gInstanceID); stats.set_version(gClientVersion); stats.set_latency(gLatency); stats.set_ngpus(ngpus); stats.set_height(gBlock.height()); GetNewReqNonce(req); Send(req, gServer); } PrintStats(); gHeartBeat = false; //ReConnectSignals(); return 0; }
size_t Fuzzer::RunOneMaximizeTotalCoverage(const Unit &U) { size_t NumCounters = __sanitizer_get_number_of_counters(); if (Options.UseCounters) { CounterBitmap.resize(NumCounters); __sanitizer_update_counter_bitset_and_clear_counters(0); } size_t OldCoverage = __sanitizer_get_total_unique_coverage(); ExecuteCallback(U); size_t NewCoverage = __sanitizer_get_total_unique_coverage(); size_t NumNewBits = 0; if (Options.UseCounters) NumNewBits = __sanitizer_update_counter_bitset_and_clear_counters( CounterBitmap.data()); if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1)) && Options.Verbosity) PrintStats("pulse ", NewCoverage); if (NewCoverage > OldCoverage || NumNewBits) return NewCoverage; return 0; }
HError(2319,"HERest: HMM file extension expected"); newExt = GetStrArg(); break; case 'p': parMode = GetChkedInt(0,500,s); break; case 'r': twoDataFiles = TRUE; break; case 's': stats = TRUE; if (NextArg()!=STRINGARG) HError(2319,"HERest: Stats file name expected"); statFN = GetStrArg(); break;
int main(int argc, char **argv) { parse_commandline(argc, argv); //dump_options(); if (!std::strlen(gFile)) { usage(); std::exit(1); } acquire_board(gFile); Sudoku board(BASESIZE, SYMBOL_TYPE, Callback); board.SetupBoard(gBoard, std::strlen(gBoard)); board.Solve(); PrintStats(board); std::cout << std::endl; delete [] gBoard; return 0; }
bool Fuzzer::RunOne(const uint8_t *Data, size_t Size) { TotalNumberOfRuns++; // TODO(aizatsky): this Reset call seems to be not needed. CoverageController::ResetCounters(Options); ExecuteCallback(Data, Size); bool Res = UpdateMaxCoverage(); auto UnitStopTime = system_clock::now(); auto TimeOfUnit = duration_cast<seconds>(UnitStopTime - UnitStartTime).count(); if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1)) && secondsSinceProcessStartUp() >= 2) PrintStats("pulse "); if (TimeOfUnit > TimeOfLongestUnitInSeconds && TimeOfUnit >= Options.ReportSlowUnits) { TimeOfLongestUnitInSeconds = TimeOfUnit; Printf("Slowest unit: %zd s:\n", TimeOfLongestUnitInSeconds); WriteUnitToFileWithPrefix({Data, Data + Size}, "slow-unit-"); } return Res; }