mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
[fuzzer] when a single unit takes over 1 second to run and it is the slowest one so far, print it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233637 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0a8ff297ad
commit
e6d25ad0e0
@ -114,6 +114,7 @@ class Fuzzer {
|
|||||||
FuzzingOptions Options;
|
FuzzingOptions Options;
|
||||||
system_clock::time_point ProcessStartTime = system_clock::now();
|
system_clock::time_point ProcessStartTime = system_clock::now();
|
||||||
static system_clock::time_point UnitStartTime;
|
static system_clock::time_point UnitStartTime;
|
||||||
|
long TimeOfLongestUnitInSeconds = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}; // namespace fuzzer
|
}; // namespace fuzzer
|
||||||
|
@ -96,11 +96,23 @@ void Fuzzer::ShuffleAndMinimize() {
|
|||||||
size_t Fuzzer::RunOne(const Unit &U) {
|
size_t Fuzzer::RunOne(const Unit &U) {
|
||||||
UnitStartTime = system_clock::now();
|
UnitStartTime = system_clock::now();
|
||||||
TotalNumberOfRuns++;
|
TotalNumberOfRuns++;
|
||||||
|
size_t Res = 0;
|
||||||
if (Options.UseFullCoverageSet)
|
if (Options.UseFullCoverageSet)
|
||||||
return RunOneMaximizeFullCoverageSet(U);
|
Res = RunOneMaximizeFullCoverageSet(U);
|
||||||
if (Options.UseCoveragePairs)
|
else if (Options.UseCoveragePairs)
|
||||||
return RunOneMaximizeCoveragePairs(U);
|
Res = RunOneMaximizeCoveragePairs(U);
|
||||||
return RunOneMaximizeTotalCoverage(U);
|
else
|
||||||
|
Res = RunOneMaximizeTotalCoverage(U);
|
||||||
|
auto UnitStopTime = system_clock::now();
|
||||||
|
auto TimeOfUnit =
|
||||||
|
duration_cast<seconds>(UnitStopTime - UnitStartTime).count();
|
||||||
|
if (TimeOfUnit > TimeOfLongestUnitInSeconds) {
|
||||||
|
TimeOfLongestUnitInSeconds = TimeOfUnit;
|
||||||
|
std::cerr << "Longest unit: " << TimeOfLongestUnitInSeconds
|
||||||
|
<< " s:\n";
|
||||||
|
Print(U, "\n");
|
||||||
|
}
|
||||||
|
return Res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uintptr_t HashOfArrayOfPCs(uintptr_t *PCs, uintptr_t NumPCs) {
|
static uintptr_t HashOfArrayOfPCs(uintptr_t *PCs, uintptr_t NumPCs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user