blob: 48ae220dee71d97d8859ecd929f55ea2d29ba40e [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.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000015FUZZER_FLAG_INT(runs, -1,
Kostya Serebryany33f86692015-02-04 22:20:09 +000016 "Number of individual test runs (-1 for infinite runs).")
Kostya Serebryanyc5f905c2015-05-26 19:32:52 +000017FUZZER_FLAG_INT(max_len, 64, "Maximum length of the test input.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000018FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.")
19FUZZER_FLAG_INT(mutate_depth, 5,
Aaron Ballmanef116982015-01-29 16:58:29 +000020 "Apply this number of consecutive mutations to each input.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000021FUZZER_FLAG_INT(
22 prefer_small_during_initial_shuffle, -1,
Kostya Serebryany92e04762015-02-04 23:42:42 +000023 "If 1, always prefer smaller inputs during the initial corpus shuffle."
24 " If 0, never do that. If -1, do it sometimes.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000025FUZZER_FLAG_INT(exit_on_first, 0,
Aaron Ballmanef116982015-01-29 16:58:29 +000026 "If 1, exit after the first new interesting input is found.")
Kostya Serebryany490bbd62015-05-19 22:12:57 +000027FUZZER_FLAG_INT(
Kostya Serebryany316b5712015-05-26 20:57:47 +000028 timeout, 1200,
Kostya Serebryany490bbd62015-05-19 22:12:57 +000029 "Timeout in seconds (if positive). "
30 "If one unit runs more than this number of seconds the process will abort.")
Kostya Serebryanyb85db172015-10-02 20:47:55 +000031FUZZER_FLAG_INT(max_total_time, 0, "If positive, indicates the maximal total "
32 "time in seconds to run the fuzzer.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000033FUZZER_FLAG_INT(help, 0, "Print help.")
34FUZZER_FLAG_INT(
35 save_minimized_corpus, 0,
Kostya Serebryanyb06fae52015-09-08 17:43:51 +000036 "If 1, the minimized corpus is saved into the first input directory. "
37 "Example: ./fuzzer -save_minimized_corpus=1 NEW_EMPTY_DIR OLD_CORPUS")
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(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn"
Kostya Serebryanye8cee112015-01-31 01:14:40 +000045 " this number of jobs in separate worker processes"
46 " with stdout/stderr redirected to fuzz-JOB.log.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000047FUZZER_FLAG_INT(workers, 0,
Kostya Serebryany9690fcf2015-05-12 18:51:57 +000048 "Number of simultaneous worker processes to run the jobs."
49 " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.")
Kostya Serebryany1ac80552015-05-08 21:30:55 +000050FUZZER_FLAG_INT(reload, 1,
51 "Reload the main corpus periodically to get new units"
Lenny Maiorani1230a542015-08-12 20:00:10 +000052 " discovered by other processes.")
Kostya Serebryany6ea1b692015-09-02 23:27:39 +000053FUZZER_FLAG_STRING(deprecated_tokens,
54 "Use the file with tokens (one token per line) to"
55 " fuzz a token based input language.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000056FUZZER_FLAG_STRING(apply_tokens, "Read the given input file, substitute bytes "
57 " with tokens and write the result to stdout.")
Kostya Serebryany2da7b842015-05-18 21:34:20 +000058FUZZER_FLAG_STRING(sync_command, "Execute an external command "
59 "\"<sync_command> <test_corpus>\" "
60 "to synchronize the test corpus.")
Kostya Serebryanyc5f905c2015-05-26 19:32:52 +000061FUZZER_FLAG_INT(sync_timeout, 600, "Minimum timeout between syncs.")
Kostya Serebryany70926ae2015-08-05 21:43:48 +000062FUZZER_FLAG_INT(report_slow_units, 10,
63 "Report slowest units if they run for more than this number of seconds.")
Kostya Serebryanybc7c0ad2015-08-11 01:44:42 +000064FUZZER_FLAG_INT(only_ascii, 0,
65 "If 1, generate only ASCII (isprint+isspace) inputs.")
Kostya Serebryany9838b2b2015-09-03 20:23:46 +000066FUZZER_FLAG_STRING(dict, "Experimental. Use the dictionary file.")
Kostya Serebryany12c78372015-08-12 01:55:37 +000067FUZZER_FLAG_INT(tbm_depth, 5, "Apply at most this number of consecutive"
68 "trace-based-mutations (tbm).")
69FUZZER_FLAG_INT(tbm_width, 5, "Apply at most this number of independent"
70 "trace-based-mutations (tbm)")
Kostya Serebryanyb85db172015-10-02 20:47:55 +000071FUZZER_FLAG_STRING(test_single_input, "Use specified file as test input.")