10b57cec5SDimitry Andric // 20b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 30b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 40b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 50b57cec5SDimitry Andric // 60b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 70b57cec5SDimitry Andric // fuzzer::FuzzingOptions 80b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 90b57cec5SDimitry Andric 100b57cec5SDimitry Andric #ifndef LLVM_FUZZER_OPTIONS_H 110b57cec5SDimitry Andric #define LLVM_FUZZER_OPTIONS_H 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #include "FuzzerDefs.h" 140b57cec5SDimitry Andric 150b57cec5SDimitry Andric namespace fuzzer { 160b57cec5SDimitry Andric 170b57cec5SDimitry Andric struct FuzzingOptions { 180b57cec5SDimitry Andric int Verbosity = 1; 190b57cec5SDimitry Andric size_t MaxLen = 0; 200b57cec5SDimitry Andric size_t LenControl = 1000; 21e8d8bef9SDimitry Andric bool KeepSeed = false; 220b57cec5SDimitry Andric int UnitTimeoutSec = 300; 230b57cec5SDimitry Andric int TimeoutExitCode = 70; 240b57cec5SDimitry Andric int OOMExitCode = 71; 250b57cec5SDimitry Andric int InterruptExitCode = 72; 260b57cec5SDimitry Andric int ErrorExitCode = 77; 270b57cec5SDimitry Andric bool IgnoreTimeouts = true; 280b57cec5SDimitry Andric bool IgnoreOOMs = true; 290b57cec5SDimitry Andric bool IgnoreCrashes = false; 300b57cec5SDimitry Andric int MaxTotalTimeSec = 0; 310b57cec5SDimitry Andric int RssLimitMb = 0; 320b57cec5SDimitry Andric int MallocLimitMb = 0; 330b57cec5SDimitry Andric bool DoCrossOver = true; 34e8d8bef9SDimitry Andric bool CrossOverUniformDist = false; 350b57cec5SDimitry Andric int MutateDepth = 5; 360b57cec5SDimitry Andric bool ReduceDepth = false; 370b57cec5SDimitry Andric bool UseCounters = false; 380b57cec5SDimitry Andric bool UseMemmem = true; 390b57cec5SDimitry Andric bool UseCmp = false; 400b57cec5SDimitry Andric int UseValueProfile = false; 410b57cec5SDimitry Andric bool Shrink = false; 420b57cec5SDimitry Andric bool ReduceInputs = false; 430b57cec5SDimitry Andric int ReloadIntervalSec = 1; 440b57cec5SDimitry Andric bool ShuffleAtStartUp = true; 450b57cec5SDimitry Andric bool PreferSmall = true; 460b57cec5SDimitry Andric size_t MaxNumberOfRuns = -1L; 470b57cec5SDimitry Andric int ReportSlowUnits = 10; 480b57cec5SDimitry Andric bool OnlyASCII = false; 49e8d8bef9SDimitry Andric bool Entropic = true; 50*349cc55cSDimitry Andric bool ForkCorpusGroups = false; 515ffd83dbSDimitry Andric size_t EntropicFeatureFrequencyThreshold = 0xFF; 525ffd83dbSDimitry Andric size_t EntropicNumberOfRarestFeatures = 100; 53e8d8bef9SDimitry Andric bool EntropicScalePerExecTime = false; 540b57cec5SDimitry Andric std::string OutputCorpus; 550b57cec5SDimitry Andric std::string ArtifactPrefix = "./"; 560b57cec5SDimitry Andric std::string ExactArtifactPath; 570b57cec5SDimitry Andric std::string ExitOnSrcPos; 580b57cec5SDimitry Andric std::string ExitOnItem; 590b57cec5SDimitry Andric std::string FocusFunction; 600b57cec5SDimitry Andric std::string DataFlowTrace; 610b57cec5SDimitry Andric std::string CollectDataFlow; 620b57cec5SDimitry Andric std::string FeaturesDir; 63e8d8bef9SDimitry Andric std::string MutationGraphFile; 640b57cec5SDimitry Andric std::string StopFile; 650b57cec5SDimitry Andric bool SaveArtifacts = true; 660b57cec5SDimitry Andric bool PrintNEW = true; // Print a status line when new units are found; 670b57cec5SDimitry Andric bool PrintNewCovPcs = false; 680b57cec5SDimitry Andric int PrintNewCovFuncs = 0; 690b57cec5SDimitry Andric bool PrintFinalStats = false; 700b57cec5SDimitry Andric bool PrintCorpusStats = false; 710b57cec5SDimitry Andric bool PrintCoverage = false; 72e8d8bef9SDimitry Andric bool PrintFullCoverage = false; 730b57cec5SDimitry Andric bool DumpCoverage = false; 740b57cec5SDimitry Andric bool DetectLeaks = true; 750b57cec5SDimitry Andric int PurgeAllocatorIntervalSec = 1; 760b57cec5SDimitry Andric int TraceMalloc = 0; 770b57cec5SDimitry Andric bool HandleAbrt = false; 78e8d8bef9SDimitry Andric bool HandleAlrm = false; 790b57cec5SDimitry Andric bool HandleBus = false; 800b57cec5SDimitry Andric bool HandleFpe = false; 810b57cec5SDimitry Andric bool HandleIll = false; 820b57cec5SDimitry Andric bool HandleInt = false; 830b57cec5SDimitry Andric bool HandleSegv = false; 840b57cec5SDimitry Andric bool HandleTerm = false; 850b57cec5SDimitry Andric bool HandleXfsz = false; 860b57cec5SDimitry Andric bool HandleUsr1 = false; 870b57cec5SDimitry Andric bool HandleUsr2 = false; 88e8d8bef9SDimitry Andric bool HandleWinExcept = false; 890b57cec5SDimitry Andric }; 900b57cec5SDimitry Andric 910b57cec5SDimitry Andric } // namespace fuzzer 920b57cec5SDimitry Andric 930b57cec5SDimitry Andric #endif // LLVM_FUZZER_OPTIONS_H 94