blob: c6fa388b72811c9758269c3ca9aaa7065b82b1d6 [file] [log] [blame]
Aaron Ballmanef116982015-01-29 16:58:29 +00001//===- FuzzerFlags.def - Run-time flags -------------------------*- C++ -* ===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
Kostya Serebryany52a788e2015-03-31 20:13:20 +00009// Flags. FUZZER_FLAG_INT/FUZZER_FLAG_STRING macros should be defined at the
10// point of inclusion. We are not using any flag parsing library for better
11// portability and independence.
Aaron Ballmanef116982015-01-29 16:58:29 +000012//===----------------------------------------------------------------------===//
Kostya Serebryany52a788e2015-03-31 20:13:20 +000013FUZZER_FLAG_INT(verbosity, 1, "Verbosity level.")
14FUZZER_FLAG_INT(seed, 0, "Random seed. If 0, seed is generated.")
15FUZZER_FLAG_INT(iterations, -1,
Kostya Serebryany33f86692015-02-04 22:20:09 +000016 "Number of iterations of the fuzzer internal loop"
17 " (-1 for infinite iterations).")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000018FUZZER_FLAG_INT(runs, -1,
Kostya Serebryany33f86692015-02-04 22:20:09 +000019 "Number of individual test runs (-1 for infinite runs).")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000020FUZZER_FLAG_INT(max_len, 64, "Maximal length of the test input.")
21FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.")
22FUZZER_FLAG_INT(mutate_depth, 5,
Aaron Ballmanef116982015-01-29 16:58:29 +000023 "Apply this number of consecutive mutations to each input.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000024FUZZER_FLAG_INT(
25 prefer_small_during_initial_shuffle, -1,
Kostya Serebryany92e04762015-02-04 23:42:42 +000026 "If 1, always prefer smaller inputs during the initial corpus shuffle."
27 " If 0, never do that. If -1, do it sometimes.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000028FUZZER_FLAG_INT(exit_on_first, 0,
Aaron Ballmanef116982015-01-29 16:58:29 +000029 "If 1, exit after the first new interesting input is found.")
Kostya Serebryany490bbd62015-05-19 22:12:57 +000030FUZZER_FLAG_INT(
31 timeout, -1,
32 "Timeout in seconds (if positive). "
33 "If one unit runs more than this number of seconds the process will abort.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000034FUZZER_FLAG_INT(help, 0, "Print help.")
35FUZZER_FLAG_INT(
36 save_minimized_corpus, 0,
Aaron Ballmanef116982015-01-29 16:58:29 +000037 "If 1, the minimized corpus is saved into the first input directory")
Kostya Serebryany1ce4ebf2015-05-13 18:31:46 +000038FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters")
Kostya Serebryany5a99ecb2015-05-11 20:51:19 +000039FUZZER_FLAG_INT(use_traces, 0, "Experimental: use instruction traces")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000040FUZZER_FLAG_INT(use_full_coverage_set, 0,
Kostya Serebryany2e3622b2015-02-20 03:02:37 +000041 "Experimental: Maximize the number of different full"
Kostya Serebryany2c1b33b2015-01-29 23:01:07 +000042 " coverage sets as opposed to maximizing the total coverage."
43 " This is potentially MUCH slower, but may discover more paths.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000044FUZZER_FLAG_INT(use_coverage_pairs, 0,
Kostya Serebryany2e3622b2015-02-20 03:02:37 +000045 "Experimental: Maximize the number of different coverage pairs.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000046FUZZER_FLAG_INT(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn"
Kostya Serebryanye8cee112015-01-31 01:14:40 +000047 " this number of jobs in separate worker processes"
48 " with stdout/stderr redirected to fuzz-JOB.log.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000049FUZZER_FLAG_INT(workers, 0,
Kostya Serebryany9690fcf2015-05-12 18:51:57 +000050 "Number of simultaneous worker processes to run the jobs."
51 " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.")
Kostya Serebryany1ac80552015-05-08 21:30:55 +000052FUZZER_FLAG_INT(reload, 1,
53 "Reload the main corpus periodically to get new units"
54 "discovered by other processes.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000055FUZZER_FLAG_STRING(tokens, "Use the file with tokens (one token per line) to"
56 " fuzz a token based input language.")
57FUZZER_FLAG_STRING(apply_tokens, "Read the given input file, substitute bytes "
58 " with tokens and write the result to stdout.")
Kostya Serebryany2da7b842015-05-18 21:34:20 +000059FUZZER_FLAG_STRING(sync_command, "Execute an external command "
60 "\"<sync_command> <test_corpus>\" "
61 "to synchronize the test corpus.")
62FUZZER_FLAG_INT(sync_timeout, 600, "Minimal timeout between syncs.")