| 457 | } |
| 458 | |
| 459 | void Fuzzer::PrintPulseAndReportSlowInput(const uint8_t *Data, size_t Size) { |
| 460 | auto TimeOfUnit = |
| 461 | duration_cast<seconds>(UnitStopTime - UnitStartTime).count(); |
| 462 | if (!(TotalNumberOfRuns & (TotalNumberOfRuns - 1)) && |
| 463 | secondsSinceProcessStartUp() >= 2) |
| 464 | PrintStats("pulse "); |
| 465 | auto Threshhold = |
| 466 | static_cast<long>(static_cast<double>(TimeOfLongestUnitInSeconds) * 1.1); |
| 467 | if (TimeOfUnit > Threshhold && TimeOfUnit >= Options.ReportSlowUnits) { |
| 468 | TimeOfLongestUnitInSeconds = TimeOfUnit; |
| 469 | Printf("Slowest unit: %ld s:\n", TimeOfLongestUnitInSeconds); |
| 470 | WriteUnitToFileWithPrefix({Data, Data + Size}, "slow-unit-"); |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | static void WriteFeatureSetToFile(const std::string &FeaturesDir, |
| 475 | const std::string &FileName, |