FuzzerOptions.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. int UnitTimeoutSec = 300;
  18. int TimeoutExitCode = 70;
  19. int OOMExitCode = 71;
  20. int InterruptExitCode = 72;
  21. int ErrorExitCode = 77;
  22. bool IgnoreTimeouts = true;
  23. bool IgnoreOOMs = true;
  24. bool IgnoreCrashes = false;
  25. int MaxTotalTimeSec = 0;
  26. int RssLimitMb = 0;
  27. int MallocLimitMb = 0;
  28. bool DoCrossOver = true;
  29. int MutateDepth = 5;
  30. bool ReduceDepth = false;
  31. bool UseCounters = false;
  32. bool UseMemmem = true;
  33. bool UseCmp = false;
  34. int UseValueProfile = false;
  35. bool Shrink = false;
  36. bool ReduceInputs = false;
  37. int ReloadIntervalSec = 1;
  38. bool ShuffleAtStartUp = true;
  39. bool PreferSmall = true;
  40. size_t MaxNumberOfRuns = -1L;
  41. int ReportSlowUnits = 10;
  42. bool OnlyASCII = false;
  43. std::string OutputCorpus;
  44. std::string ArtifactPrefix = "./";
  45. std::string ExactArtifactPath;
  46. std::string ExitOnSrcPos;
  47. std::string ExitOnItem;
  48. std::string FocusFunction;
  49. std::string DataFlowTrace;
  50. std::string CollectDataFlow;
  51. std::string FeaturesDir;
  52. std::string StopFile;
  53. bool SaveArtifacts = true;
  54. bool PrintNEW = true; // Print a status line when new units are found;
  55. bool PrintNewCovPcs = false;
  56. int PrintNewCovFuncs = 0;
  57. bool PrintFinalStats = false;
  58. bool PrintCorpusStats = false;
  59. bool PrintCoverage = false;
  60. bool DumpCoverage = false;
  61. bool DetectLeaks = true;
  62. int PurgeAllocatorIntervalSec = 1;
  63. int TraceMalloc = 0;
  64. bool HandleAbrt = false;
  65. bool HandleBus = false;
  66. bool HandleFpe = false;
  67. bool HandleIll = false;
  68. bool HandleInt = false;
  69. bool HandleSegv = false;
  70. bool HandleTerm = false;
  71. bool HandleXfsz = false;
  72. bool HandleUsr1 = false;
  73. bool HandleUsr2 = false;
  74. };
  75. } // namespace fuzzer
  76. #endif // LLVM_FUZZER_OPTIONS_H