FuzzerOptions.h 2.6 KB

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