diff options
author | Kostya Serebryany <kcc@google.com> | 2015-08-05 21:43:48 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2015-08-05 21:43:48 +0000 |
commit | 70926aed6bf3819c4b23ee0ae6cc510dbecba96e (patch) | |
tree | ae9ab03b96684ae836384d39bf35140a96f78893 /llvm/lib/Fuzzer/FuzzerLoop.cpp | |
parent | 1ce0035bf0cbbe3709473578a13e00b0731e8140 (diff) | |
download | bcm5719-llvm-70926aed6bf3819c4b23ee0ae6cc510dbecba96e.tar.gz bcm5719-llvm-70926aed6bf3819c4b23ee0ae6cc510dbecba96e.zip |
[libFuzzer] add option -report_slow_units=Nsec to control when slow units are printed
llvm-svn: 244152
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerLoop.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/FuzzerLoop.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerLoop.cpp b/llvm/lib/Fuzzer/FuzzerLoop.cpp index 5e8e2e4aae3..69b49b025a0 100644 --- a/llvm/lib/Fuzzer/FuzzerLoop.cpp +++ b/llvm/lib/Fuzzer/FuzzerLoop.cpp @@ -159,12 +159,13 @@ size_t Fuzzer::RunOne(const Unit &U) { auto UnitStopTime = system_clock::now(); auto TimeOfUnit = duration_cast<seconds>(UnitStopTime - UnitStartTime).count(); - if (TimeOfUnit > TimeOfLongestUnitInSeconds) { + if (TimeOfUnit > TimeOfLongestUnitInSeconds && + TimeOfUnit >= Options.ReportSlowUnits) { TimeOfLongestUnitInSeconds = TimeOfUnit; - Printf("Longest unit: %zd s:\n", TimeOfLongestUnitInSeconds); + Printf("Slowest unit: %zd s:\n", TimeOfLongestUnitInSeconds); if (U.size() <= kMaxUnitSizeToPrint) Print(U, "\n"); - WriteUnitToFileWithPrefix(U, "long-running-unit-"); + WriteUnitToFileWithPrefix(U, "slow-unit-"); } return Res; } |