1 // 2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 3 // See https://llvm.org/LICENSE.txt for license information. 4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 5 // 6 //===----------------------------------------------------------------------===// 7 // fuzzer::FuzzingOptions 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLVM_FUZZER_OPTIONS_H 11 #define LLVM_FUZZER_OPTIONS_H 12 13 #include "FuzzerDefs.h" 14 15 namespace fuzzer { 16 17 struct FuzzingOptions { 18 int Verbosity = 1; 19 size_t MaxLen = 0; 20 size_t LenControl = 1000; 21 int UnitTimeoutSec = 300; 22 int TimeoutExitCode = 70; 23 int OOMExitCode = 71; 24 int InterruptExitCode = 72; 25 int ErrorExitCode = 77; 26 bool IgnoreTimeouts = true; 27 bool IgnoreOOMs = true; 28 bool IgnoreCrashes = false; 29 int MaxTotalTimeSec = 0; 30 int RssLimitMb = 0; 31 int MallocLimitMb = 0; 32 bool DoCrossOver = true; 33 int MutateDepth = 5; 34 bool ReduceDepth = false; 35 bool UseCounters = false; 36 bool UseMemmem = true; 37 bool UseCmp = false; 38 int UseValueProfile = false; 39 bool Shrink = false; 40 bool ReduceInputs = false; 41 int ReloadIntervalSec = 1; 42 bool ShuffleAtStartUp = true; 43 bool PreferSmall = true; 44 size_t MaxNumberOfRuns = -1L; 45 int ReportSlowUnits = 10; 46 bool OnlyASCII = false; 47 bool Entropic = false; 48 size_t EntropicFeatureFrequencyThreshold = 0xFF; 49 size_t EntropicNumberOfRarestFeatures = 100; 50 std::string OutputCorpus; 51 std::string ArtifactPrefix = "./"; 52 std::string ExactArtifactPath; 53 std::string ExitOnSrcPos; 54 std::string ExitOnItem; 55 std::string FocusFunction; 56 std::string DataFlowTrace; 57 std::string CollectDataFlow; 58 std::string FeaturesDir; 59 std::string StopFile; 60 bool SaveArtifacts = true; 61 bool PrintNEW = true; // Print a status line when new units are found; 62 bool PrintNewCovPcs = false; 63 int PrintNewCovFuncs = 0; 64 bool PrintFinalStats = false; 65 bool PrintCorpusStats = false; 66 bool PrintCoverage = false; 67 bool DumpCoverage = false; 68 bool DetectLeaks = true; 69 int PurgeAllocatorIntervalSec = 1; 70 int TraceMalloc = 0; 71 bool HandleAbrt = false; 72 bool HandleBus = false; 73 bool HandleFpe = false; 74 bool HandleIll = false; 75 bool HandleInt = false; 76 bool HandleSegv = false; 77 bool HandleTerm = false; 78 bool HandleXfsz = false; 79 bool HandleUsr1 = false; 80 bool HandleUsr2 = false; 81 }; 82 83 } // namespace fuzzer 84 85 #endif // LLVM_FUZZER_OPTIONS_H 86