Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 1 | //===- 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 Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 9 | // 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 Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 12 | //===----------------------------------------------------------------------===// |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 13 | FUZZER_FLAG_INT(verbosity, 1, "Verbosity level.") |
| 14 | FUZZER_FLAG_INT(seed, 0, "Random seed. If 0, seed is generated.") |
| 15 | FUZZER_FLAG_INT(iterations, -1, |
Kostya Serebryany | 33f8669 | 2015-02-04 22:20:09 +0000 | [diff] [blame] | 16 | "Number of iterations of the fuzzer internal loop" |
| 17 | " (-1 for infinite iterations).") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 18 | FUZZER_FLAG_INT(runs, -1, |
Kostya Serebryany | 33f8669 | 2015-02-04 22:20:09 +0000 | [diff] [blame] | 19 | "Number of individual test runs (-1 for infinite runs).") |
Kostya Serebryany | c5f905c | 2015-05-26 19:32:52 +0000 | [diff] [blame] | 20 | FUZZER_FLAG_INT(max_len, 64, "Maximum length of the test input.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 21 | FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.") |
| 22 | FUZZER_FLAG_INT(mutate_depth, 5, |
Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 23 | "Apply this number of consecutive mutations to each input.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 24 | FUZZER_FLAG_INT( |
| 25 | prefer_small_during_initial_shuffle, -1, |
Kostya Serebryany | 92e0476 | 2015-02-04 23:42:42 +0000 | [diff] [blame] | 26 | "If 1, always prefer smaller inputs during the initial corpus shuffle." |
| 27 | " If 0, never do that. If -1, do it sometimes.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 28 | FUZZER_FLAG_INT(exit_on_first, 0, |
Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 29 | "If 1, exit after the first new interesting input is found.") |
Kostya Serebryany | 490bbd6 | 2015-05-19 22:12:57 +0000 | [diff] [blame] | 30 | FUZZER_FLAG_INT( |
Kostya Serebryany | 316b571 | 2015-05-26 20:57:47 +0000 | [diff] [blame] | 31 | timeout, 1200, |
Kostya Serebryany | 490bbd6 | 2015-05-19 22:12:57 +0000 | [diff] [blame] | 32 | "Timeout in seconds (if positive). " |
| 33 | "If one unit runs more than this number of seconds the process will abort.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 34 | FUZZER_FLAG_INT(help, 0, "Print help.") |
| 35 | FUZZER_FLAG_INT( |
| 36 | save_minimized_corpus, 0, |
Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 37 | "If 1, the minimized corpus is saved into the first input directory") |
Kostya Serebryany | 1ce4ebf | 2015-05-13 18:31:46 +0000 | [diff] [blame] | 38 | FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters") |
Kostya Serebryany | 5a99ecb | 2015-05-11 20:51:19 +0000 | [diff] [blame] | 39 | FUZZER_FLAG_INT(use_traces, 0, "Experimental: use instruction traces") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 40 | FUZZER_FLAG_INT(use_full_coverage_set, 0, |
Kostya Serebryany | 2e3622b | 2015-02-20 03:02:37 +0000 | [diff] [blame] | 41 | "Experimental: Maximize the number of different full" |
Kostya Serebryany | 2c1b33b | 2015-01-29 23:01:07 +0000 | [diff] [blame] | 42 | " coverage sets as opposed to maximizing the total coverage." |
| 43 | " This is potentially MUCH slower, but may discover more paths.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 44 | FUZZER_FLAG_INT(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn" |
Kostya Serebryany | e8cee11 | 2015-01-31 01:14:40 +0000 | [diff] [blame] | 45 | " this number of jobs in separate worker processes" |
| 46 | " with stdout/stderr redirected to fuzz-JOB.log.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 47 | FUZZER_FLAG_INT(workers, 0, |
Kostya Serebryany | 9690fcf | 2015-05-12 18:51:57 +0000 | [diff] [blame] | 48 | "Number of simultaneous worker processes to run the jobs." |
| 49 | " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.") |
Kostya Serebryany | 1ac8055 | 2015-05-08 21:30:55 +0000 | [diff] [blame] | 50 | FUZZER_FLAG_INT(reload, 1, |
| 51 | "Reload the main corpus periodically to get new units" |
Lenny Maiorani | 1230a54 | 2015-08-12 20:00:10 +0000 | [diff] [blame^] | 52 | " discovered by other processes.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 53 | FUZZER_FLAG_STRING(tokens, "Use the file with tokens (one token per line) to" |
| 54 | " fuzz a token based input language.") |
| 55 | FUZZER_FLAG_STRING(apply_tokens, "Read the given input file, substitute bytes " |
| 56 | " with tokens and write the result to stdout.") |
Kostya Serebryany | 2da7b84 | 2015-05-18 21:34:20 +0000 | [diff] [blame] | 57 | FUZZER_FLAG_STRING(sync_command, "Execute an external command " |
| 58 | "\"<sync_command> <test_corpus>\" " |
| 59 | "to synchronize the test corpus.") |
Kostya Serebryany | c5f905c | 2015-05-26 19:32:52 +0000 | [diff] [blame] | 60 | FUZZER_FLAG_INT(sync_timeout, 600, "Minimum timeout between syncs.") |
Kostya Serebryany | 70926ae | 2015-08-05 21:43:48 +0000 | [diff] [blame] | 61 | FUZZER_FLAG_INT(report_slow_units, 10, |
| 62 | "Report slowest units if they run for more than this number of seconds.") |
Kostya Serebryany | bc7c0ad | 2015-08-11 01:44:42 +0000 | [diff] [blame] | 63 | FUZZER_FLAG_INT(only_ascii, 0, |
| 64 | "If 1, generate only ASCII (isprint+isspace) inputs.") |
Kostya Serebryany | 12c7837 | 2015-08-12 01:55:37 +0000 | [diff] [blame] | 65 | FUZZER_FLAG_INT(tbm_depth, 5, "Apply at most this number of consecutive" |
| 66 | "trace-based-mutations (tbm).") |
| 67 | FUZZER_FLAG_INT(tbm_width, 5, "Apply at most this number of independent" |
| 68 | "trace-based-mutations (tbm)") |