xref: /freebsd/contrib/llvm-project/compiler-rt/lib/fuzzer/FuzzerOptions.h (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
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   bool KeepSeed = false;
22   int UnitTimeoutSec = 300;
23   int TimeoutExitCode = 70;
24   int OOMExitCode = 71;
25   int InterruptExitCode = 72;
26   int ErrorExitCode = 77;
27   bool IgnoreTimeouts = true;
28   bool IgnoreOOMs = true;
29   bool IgnoreCrashes = false;
30   int MaxTotalTimeSec = 0;
31   int RssLimitMb = 0;
32   int MallocLimitMb = 0;
33   bool DoCrossOver = true;
34   bool CrossOverUniformDist = false;
35   int MutateDepth = 5;
36   bool ReduceDepth = false;
37   bool UseCounters = false;
38   bool UseMemmem = true;
39   bool UseCmp = false;
40   int UseValueProfile = false;
41   bool Shrink = false;
42   bool ReduceInputs = false;
43   int ReloadIntervalSec = 1;
44   bool ShuffleAtStartUp = true;
45   bool PreferSmall = true;
46   size_t MaxNumberOfRuns = -1L;
47   int ReportSlowUnits = 10;
48   bool OnlyASCII = false;
49   bool Entropic = true;
50   bool ForkCorpusGroups = false;
51   size_t EntropicFeatureFrequencyThreshold = 0xFF;
52   size_t EntropicNumberOfRarestFeatures = 100;
53   bool EntropicScalePerExecTime = false;
54   std::string OutputCorpus;
55   std::string ArtifactPrefix = "./";
56   std::string ExactArtifactPath;
57   std::string ExitOnSrcPos;
58   std::string ExitOnItem;
59   std::string FocusFunction;
60   std::string DataFlowTrace;
61   std::string CollectDataFlow;
62   std::string FeaturesDir;
63   std::string MutationGraphFile;
64   std::string StopFile;
65   bool SaveArtifacts = true;
66   bool PrintNEW = true; // Print a status line when new units are found;
67   bool PrintNewCovPcs = false;
68   int PrintNewCovFuncs = 0;
69   bool PrintFinalStats = false;
70   bool PrintCorpusStats = false;
71   bool PrintCoverage = false;
72   bool PrintFullCoverage = false;
73   bool DumpCoverage = false;
74   bool DetectLeaks = true;
75   int PurgeAllocatorIntervalSec = 1;
76   int  TraceMalloc = 0;
77   bool HandleAbrt = false;
78   bool HandleAlrm = false;
79   bool HandleBus = false;
80   bool HandleFpe = false;
81   bool HandleIll = false;
82   bool HandleInt = false;
83   bool HandleSegv = false;
84   bool HandleTerm = false;
85   bool HandleXfsz = false;
86   bool HandleUsr1 = false;
87   bool HandleUsr2 = false;
88   bool HandleWinExcept = false;
89 };
90 
91 }  // namespace fuzzer
92 
93 #endif  // LLVM_FUZZER_OPTIONS_H
94