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 std::string OutputCorpus; 48 std::string ArtifactPrefix = "./"; 49 std::string ExactArtifactPath; 50 std::string ExitOnSrcPos; 51 std::string ExitOnItem; 52 std::string FocusFunction; 53 std::string DataFlowTrace; 54 std::string CollectDataFlow; 55 std::string FeaturesDir; 56 std::string StopFile; 57 bool SaveArtifacts = true; 58 bool PrintNEW = true; // Print a status line when new units are found; 59 bool PrintNewCovPcs = false; 60 int PrintNewCovFuncs = 0; 61 bool PrintFinalStats = false; 62 bool PrintCorpusStats = false; 63 bool PrintCoverage = false; 64 bool DumpCoverage = false; 65 bool DetectLeaks = true; 66 int PurgeAllocatorIntervalSec = 1; 67 int TraceMalloc = 0; 68 bool HandleAbrt = false; 69 bool HandleBus = false; 70 bool HandleFpe = false; 71 bool HandleIll = false; 72 bool HandleInt = false; 73 bool HandleSegv = false; 74 bool HandleTerm = false; 75 bool HandleXfsz = false; 76 bool HandleUsr1 = false; 77 bool HandleUsr2 = false; 78 }; 79 80 } // namespace fuzzer 81 82 #endif // LLVM_FUZZER_OPTIONS_H 83