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   bool SaveArtifacts = true;
55   bool PrintNEW = true; // Print a status line when new units are found;
56   bool PrintNewCovPcs = false;
57   int PrintNewCovFuncs = 0;
58   bool PrintFinalStats = false;
59   bool PrintCorpusStats = false;
60   bool PrintCoverage = false;
61   bool DumpCoverage = false;
62   bool DetectLeaks = true;
63   int PurgeAllocatorIntervalSec = 1;
64   int  TraceMalloc = 0;
65   bool HandleAbrt = false;
66   bool HandleBus = false;
67   bool HandleFpe = false;
68   bool HandleIll = false;
69   bool HandleInt = false;
70   bool HandleSegv = false;
71   bool HandleTerm = false;
72   bool HandleXfsz = false;
73   bool HandleUsr1 = false;
74   bool HandleUsr2 = false;
75   bool LazyCounters = false;
76 };
77 
78 }  // namespace fuzzer
79 
80 #endif  // LLVM_FUZZER_OPTIONS_H
81