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
15namespace fuzzer {
16
17struct 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 StaleCorpusTimeoutSec = 0;
32 int RssLimitMb = 0;
33 int MallocLimitMb = 0;
34 bool DoCrossOver = true;
35 bool CrossOverUniformDist = false;
36 int MutateDepth = 5;
37 bool ReduceDepth = false;
38 bool UseCounters = false;
39 bool UseMemmem = true;
40 bool UseCmp = false;
41 int UseValueProfile = false;
42 bool Shrink = false;
43 bool ReduceInputs = false;
44 int ReloadIntervalSec = 1;
45 bool ShuffleAtStartUp = true;
46 bool PreferSmall = true;
47 size_t MaxNumberOfRuns = -1L;
48 int ReportSlowUnits = 10;
49 bool OnlyASCII = false;
50 bool Entropic = true;
51 bool ForkCorpusGroups = false;
52 size_t EntropicFeatureFrequencyThreshold = 0xFF;
53 size_t EntropicNumberOfRarestFeatures = 100;
54 bool EntropicScalePerExecTime = false;
55 std::string OutputCorpus;
56 std::string ArtifactPrefix = "./";
57 std::string ExactArtifactPath;
58 std::string ExitOnSrcPos;
59 std::string ExitOnItem;
60 std::string FocusFunction;
61 std::string DataFlowTrace;
62 std::string CollectDataFlow;
63 std::string FeaturesDir;
64 std::string MutationGraphFile;
65 std::string StopFile;
66 bool SaveArtifacts = true;
67 bool PrintNEW = true; // Print a status line when new units are found;
68 bool PrintNewCovPcs = false;
69 int PrintNewCovFuncs = 0;
70 bool PrintFinalStats = false;
71 bool PrintCorpusStats = false;
72 bool PrintCoverage = false;
73 bool PrintFullCoverage = false;
74 bool DumpCoverage = false;
75 bool DetectLeaks = true;
76 int PurgeAllocatorIntervalSec = 1;
77 int TraceMalloc = 0;
78 bool HandleAbrt = false;
79 bool HandleAlrm = false;
80 bool HandleBus = false;
81 bool HandleFpe = false;
82 bool HandleIll = false;
83 bool HandleInt = false;
84 bool HandleSegv = false;
85 bool HandleTerm = false;
86 bool HandleTrap = false;
87 bool HandleXfsz = false;
88 bool HandleUsr1 = false;
89 bool HandleUsr2 = false;
90 bool HandleWinExcept = false;
91};
92
93} // namespace fuzzer
94
95#endif // LLVM_FUZZER_OPTIONS_H
96