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
6 //===----------------------------------------------------------------------===//
7 // fuzzer::FuzzingOptions
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_FUZZER_OPTIONS_H
11 #define LLVM_FUZZER_OPTIONS_H
13 #include "FuzzerDefs.h"
17 struct FuzzingOptions
{
20 size_t LenControl
= 1000;
21 bool KeepSeed
= false;
22 int UnitTimeoutSec
= 300;
23 int TimeoutExitCode
= 70;
25 int InterruptExitCode
= 72;
26 int ErrorExitCode
= 77;
27 bool IgnoreTimeouts
= true;
28 bool IgnoreOOMs
= true;
29 bool IgnoreCrashes
= false;
30 int MaxTotalTimeSec
= 0;
32 int MallocLimitMb
= 0;
33 bool DoCrossOver
= true;
34 bool CrossOverUniformDist
= false;
36 bool ReduceDepth
= false;
37 bool UseCounters
= false;
38 bool UseMemmem
= true;
40 int UseValueProfile
= 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;
50 size_t EntropicFeatureFrequencyThreshold
= 0xFF;
51 size_t EntropicNumberOfRarestFeatures
= 100;
52 bool EntropicScalePerExecTime
= false;
53 std::string OutputCorpus
;
54 std::string ArtifactPrefix
= "./";
55 std::string ExactArtifactPath
;
56 std::string ExitOnSrcPos
;
57 std::string ExitOnItem
;
58 std::string FocusFunction
;
59 std::string DataFlowTrace
;
60 std::string CollectDataFlow
;
61 std::string FeaturesDir
;
62 std::string MutationGraphFile
;
64 bool SaveArtifacts
= true;
65 bool PrintNEW
= true; // Print a status line when new units are found;
66 bool PrintNewCovPcs
= false;
67 int PrintNewCovFuncs
= 0;
68 bool PrintFinalStats
= false;
69 bool PrintCorpusStats
= false;
70 bool PrintCoverage
= false;
71 bool PrintFullCoverage
= false;
72 bool DumpCoverage
= false;
73 bool DetectLeaks
= true;
74 int PurgeAllocatorIntervalSec
= 1;
76 bool HandleAbrt
= false;
77 bool HandleAlrm
= false;
78 bool HandleBus
= false;
79 bool HandleFpe
= false;
80 bool HandleIll
= false;
81 bool HandleInt
= false;
82 bool HandleSegv
= false;
83 bool HandleTerm
= false;
84 bool HandleXfsz
= false;
85 bool HandleUsr1
= false;
86 bool HandleUsr2
= false;
87 bool HandleWinExcept
= false;
92 #endif // LLVM_FUZZER_OPTIONS_H