blob: 6d98f66ef9c1676456a1b36e8c99362d44287343 [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.")
Mike Aizatskya1a5c692015-12-10 20:41:53 +000014FUZZER_FLAG_UNSIGNED(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 Serebryanyfed509e2015-10-17 04:38:26 +000021FUZZER_FLAG_INT(shuffle, 1, "Shuffle inputs at startup")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000022FUZZER_FLAG_INT(
23 prefer_small_during_initial_shuffle, -1,
Kostya Serebryany92e04762015-02-04 23:42:42 +000024 "If 1, always prefer smaller inputs during the initial corpus shuffle."
25 " If 0, never do that. If -1, do it sometimes.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000026FUZZER_FLAG_INT(exit_on_first, 0,
Aaron Ballmanef116982015-01-29 16:58:29 +000027 "If 1, exit after the first new interesting input is found.")
Kostya Serebryany490bbd62015-05-19 22:12:57 +000028FUZZER_FLAG_INT(
Kostya Serebryany316b5712015-05-26 20:57:47 +000029 timeout, 1200,
Kostya Serebryany490bbd62015-05-19 22:12:57 +000030 "Timeout in seconds (if positive). "
31 "If one unit runs more than this number of seconds the process will abort.")
Kostya Serebryanyb85db172015-10-02 20:47:55 +000032FUZZER_FLAG_INT(max_total_time, 0, "If positive, indicates the maximal total "
33 "time in seconds to run the fuzzer.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000034FUZZER_FLAG_INT(help, 0, "Print help.")
Kostya Serebryany550e9c82015-12-19 03:42:16 +000035FUZZER_FLAG_INT(save_minimized_corpus, 0, "Deprecated. Use -merge=1")
Kostya Serebryany9cc3b0d2015-10-24 01:16:40 +000036FUZZER_FLAG_INT(merge, 0, "If 1, the 2-nd, 3-rd, etc corpora will be "
37 "merged into the 1-st corpus. Only interesting units will be taken.")
Kostya Serebryany1ce4ebf2015-05-13 18:31:46 +000038FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters")
Kostya Serebryany2e9fca92015-10-22 23:55:39 +000039FUZZER_FLAG_INT(use_indir_calls, 1, "Use indirect caller-callee counters")
Kostya Serebryany5a99ecb2015-05-11 20:51:19 +000040FUZZER_FLAG_INT(use_traces, 0, "Experimental: use instruction traces")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000041FUZZER_FLAG_INT(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn"
Kostya Serebryanye8cee112015-01-31 01:14:40 +000042 " this number of jobs in separate worker processes"
43 " with stdout/stderr redirected to fuzz-JOB.log.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000044FUZZER_FLAG_INT(workers, 0,
Kostya Serebryany9690fcf2015-05-12 18:51:57 +000045 "Number of simultaneous worker processes to run the jobs."
46 " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.")
Kostya Serebryany1ac80552015-05-08 21:30:55 +000047FUZZER_FLAG_INT(reload, 1,
48 "Reload the main corpus periodically to get new units"
Lenny Maiorani1230a542015-08-12 20:00:10 +000049 " discovered by other processes.")
Kostya Serebryany2da7b842015-05-18 21:34:20 +000050FUZZER_FLAG_STRING(sync_command, "Execute an external command "
51 "\"<sync_command> <test_corpus>\" "
52 "to synchronize the test corpus.")
Kostya Serebryanyc5f905c2015-05-26 19:32:52 +000053FUZZER_FLAG_INT(sync_timeout, 600, "Minimum timeout between syncs.")
Kostya Serebryany70926ae2015-08-05 21:43:48 +000054FUZZER_FLAG_INT(report_slow_units, 10,
55 "Report slowest units if they run for more than this number of seconds.")
Kostya Serebryanybc7c0ad2015-08-11 01:44:42 +000056FUZZER_FLAG_INT(only_ascii, 0,
57 "If 1, generate only ASCII (isprint+isspace) inputs.")
Kostya Serebryany9838b2b2015-09-03 20:23:46 +000058FUZZER_FLAG_STRING(dict, "Experimental. Use the dictionary file.")
Kostya Serebryany12c78372015-08-12 01:55:37 +000059FUZZER_FLAG_INT(tbm_depth, 5, "Apply at most this number of consecutive"
60 "trace-based-mutations (tbm).")
61FUZZER_FLAG_INT(tbm_width, 5, "Apply at most this number of independent"
62 "trace-based-mutations (tbm)")
Kostya Serebryanyb85db172015-10-02 20:47:55 +000063FUZZER_FLAG_STRING(test_single_input, "Use specified file as test input.")
Kostya Serebryanybd5d1cd2015-10-09 03:57:59 +000064FUZZER_FLAG_STRING(artifact_prefix, "Write fuzzing artifacts (crash, "
65 "timeout, or slow inputs) as "
66 "$(artifact_prefix)file")
Kostya Serebryany2d0ef142015-11-25 21:40:46 +000067FUZZER_FLAG_STRING(exact_artifact_path,
68 "Write the single artifact on failure (crash, timeout) "
69 "as $(exact_artifact_path). This overrides -artifact_prefix "
70 "and will not use checksum in the file name. Do not "
71 "use the same path for several parallel processes.")
Kostya Serebryanydc3135d2015-11-12 01:02:01 +000072FUZZER_FLAG_INT(drill, 0, "Experimental: fuzz using a single unit as the seed "
73 "corpus, then merge with the initial corpus")
Mike Aizatskya9c23872015-11-12 04:38:40 +000074FUZZER_FLAG_INT(output_csv, 0, "Enable pulse output in CSV format.")
Mike Aizatsky8b11f872016-01-06 00:21:22 +000075FUZZER_FLAG_INT(print_new_cov_pcs, 0, "If 1, print out new covered pcs.")
76