Home | History | Annotate | Download | only in diskomizer
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 
     22 /*
     23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #pragma ident	"@(#)arg_vals.h	1.68	09/05/26 SMI"
     28 
     29 #ifndef	_DISKOMIZER_ARG_VALS_H
     30 #define	_DISKOMIZER_ARG_VALS_H
     31 
     32 #ifdef	__cplusplus
     33 extern "C" {
     34 #endif
     35 
     36 #ifndef ARG_LINK
     37 #define	ARG_LINK(A, B) "<A HREF=\"" A "\">" B "</A> "
     38 #endif
     39 
     40 #ifndef ARG_UADMIN_URL
     41 #define	ARG_UADMIN_URL "http://docs.sun.com/app/docs/doc/816-5167/uadmin-2"
     42 #endif
     43 
     44 SET_OPENING_BLURB("This page contains all the options that are " \
     45 	"accepted by diskomizer, along with their default values. " \
     46 	"<P>Diskomizer's options can be provided in two ways, in files and " \
     47 	"and on the command line.\n\n<BLOCKQUOTE>-f option_file\n" \
     48 	"<P>The file <B>option_file</B> " \
     49 	"contains a list of all the options.\n" \
     50 	"If the option file does not contain a '/' then option files are " \
     51 	"searched for using the " \
     52 	"<B>DISKOMIZER_PATH</B> environment variable, which is a colon " \
     53 	"separated list of directories to search. " \
     54 	"If it is not set then the current directory and " \
     55 	"then in /opt/CTEdiskomizer/etc are used.\n\n" \
     56 	"<P>-o OPTION=value<P>The options <B>"\
     57 	"OPTION</B> gets set to the value <B>value</B>.</BLOCKQUOTE>"\
     58 	"There can be multiple option files and command line options, " \
     59 	"Diskomizer simply reads them in the order that they are specified." \
     60 	"\n<BR><P>Diskomizer's numeric " \
     61 	"can be postfixed with with various letters to multiply their "
     62 	"values. The following case insensitive letters are understood:\n<UL>"
     63 	"\n\t<LI>C\tCharacters, multiplies by 1."
     64 	"\n\t<LI>B\tBlocks, multiplies by 512."
     65 	"\n\t<LI>K\tKilo bytes, multiplies by 1024."
     66 	"\n\t<LI>M\tMega bytes, multiplies by 1024^2 (1048576)."
     67 	"\n\t<LI>G\tGiga bytes, multiplies by 1024^3 (1073741824)."
     68 	"\n\t<LI>T\tTera bytes, multiplies by 1024^4 (1099511627776)."
     69 	"\n\t<LI>P\tPeta bytes, multiplies by 1024^5 (1125899906842624)."
     70 	"\n\t<LI>E\tExa bytes, multiplies by 1024^6 (1152921504606846976)."
     71 	"\n</UL>"
     72 	"Additionally numeric "
     73 	"options can be given using simple integer expressions to derive " \
     74 	"the value from the default. For example to set the number of " \
     75 	"processes to be 10 times the default do:\n\n<PRE>NPROCS=*10</PRE>\n\n"
     76 	"The following operators are understood:\n<UL>"
     77 	"\n\t<LI>+\t	Add"
     78 	"\n\t<LI>-\t	Subtract"
     79 	"\n\t<LI>*\t	Multiply"
     80 	"\n\t<LI>/\t	Divide"
     81 	"\n\t<LI>%\t	Modulus"
     82 	"\n\t<LI>&\t	And"
     83 	"\n\t<LI>|\t	Or"
     84 	"\n\t<LI>^\t	Xor"
     85 	"\n</UL>"
     86 	"All of the numeric options and any environment variables "
     87 	"are also available as variables in the option file, for "
     88 	"example to set the number of read threads ("
     89 	ARG_LINK("#RTHREADS", "RTHREADS")
     90 	") to be 10 times the number of write threads ("
     91 	ARG_LINK("#WTHREADS", "WTHREADS")
     92 	") do:\n\n<PRE>"
     93 	"RTHREADS= ${WTHREADS} * 10\n</PRE>\nWhen using variables you "
     94 	"should be mindful that the values are substituted as the "
     95 	"variable is encountered, so in this example\n"
     96 	"<PRE>\nWTHREADS=2\nRTHREADS=${WTHREADS} * 10\nWTHREADS=10\n"
     97 	"</PRE>\nwill set RTHREADS to 20 and WTHREADS to 10."
     98 	"\n<P>Lines in the configuration files, including comments, "
     99 	"can be continued onto the next line by including a \\ "
    100 	"character as the last character on the line.\n"
    101 	"<P>\n"
    102 	"The default values are the values that are recommended for general "
    103 	"usage. The default values will change from system to system, as "
    104 	"some are configured based on the system's available resources. "
    105 	"<A HREF=\"#NPROCS\">NPROCS</A> is one such variable that is "
    106 	"defined relative to the number of CPUs in the system. If you "
    107 	"want to know the current default values for the version of "
    108 	"Diskomizer that you are using used:\n"
    109 	"<PRE>diskomizer -d option_file\n</PRE>\n"
    110 	"will write the current values of the options into the file "
    111 	"\"option_file\" in a "
    112 	"format that can be used as an option file to Diskomizer. This example "
    113 	"will dump out the default values, but the -d option can be used "
    114 	"anywhere in the command line and will dump the values as they "
    115 	"are at that point in the argument processing. Multiple -d options "
    116 	"can be given.\n"
    117 	"<PRE>diskomizer -h diskomizer.html\n</PRE>"
    118 	"\nwill create the html documentation in a file called "
    119 	"\"diskomizer.html\"")
    120 START_SECTION(General, "The general options are all you should need to "
    121 	"configure Diskomizer to test disks, meta disks, volumes and files.")
    122 STARG(device, NULL, "A space separated list of the device[s] and or "
    123 	"file[s] to test. You can specify multiple paths to the same device "
    124 	"by grouping  the paths with { and }. Each { and } must be surround "
    125 	"by white space.  If within a group of paths a further group is "
    126 	"specified then the second group is assumed to contain error paths. "
    127 	"These error paths will only be used to replace primary paths if the "
    128 	"error routine FAIL_PATH is used. If you explicitly set the paths "
    129 	"to use then the options "
    130 	"<A HREF=\"#PATHS_TO_USE\">PATHS_TO_USE</A> and "
    131 	"<A HREF=\"#ERROR_PATHS\">ERROR_PATHS</A> are ignored for that device."
    132 	"\nFor example:\n<PRE>DEVICE= { /dev/rdsk/path1 /dev/rdsk/path2 }\n"
    133 	"</PRE>"
    134 	"This will use /dev/rdsk/path1 and /dev/rdsk/path2 as if they are "
    135 	"two paths to the same device.  IO will be load balanced between the "
    136 	"two paths.\n"
    137 	"\n<PRE>DEVICE= { /dev/rdsk/path1 { /dev/rdsk/path2 } }\n"
    138 	"ON_WRITE_ERROR=FAIL_PATH\n"
    139 	"</PRE>Will use /dev/rdsk/path1 until there is a write error and then "
    140 	"use /dev/rdsk/path2 after the error.\n\n"
    141 	"<P><B>If no paths are specified Diskomizer will prompt "
    142 	"you for devices to test.</B></P>")
    143 ILIST(disk_io_sizes, "2K, 8K", "List of disk io sizes, with weightings "
    144 	"in brackets. The higher the weighting the more likely that that io "
    145 	"size will be used. If there is no weighting then the weighting "
    146 	"defaults to 1")
    147 IARG(wthreads, 10, "The number of write threads per device per process.")
    148 IARG(rthreads, 10, "The number of read threads per device per process.")
    149 IARG(wrthreads, 10, "The number of write-read threads per device per process.")
    150 LLARG(file_size, 0LL, "If non zero, the size of the regular files "
    151 		"to be creates. The amount of each raw "
    152 		"device is also limited to this size in bytes.")
    153 IARG(number_of_files, 0, "The number of files to create in each directory "
    154 	"that is specified in the <A HREF=\"#DEVICE\">DEVICE</A> entry. "
    155 	"<A HREF=\"#FILE_SIZE\">FILE_SIZE</A> <B>must</B> also be set.")
    156 BARG(directio, 0, "Use directio if it is available")
    157 LARG(nprocs, sysconf(_SC_NPROCESSORS_ONLN), "The number of processes doing"
    158 	" the io. NOTE, the number of processes created will be one more "
    159 	"than this value. The parent process does no IO.")
    160 #define	stop_after_nloops nloops
    161 LARG(stop_after_nloops, 0L,
    162 	"If there are any <A HREF=\"#RTHREADS\">RTHREADS</a> "
    163 	"or <A HREF=\"#WRTHREADS\">WRTHREADS</a> then this will set "
    164 	"the average number of times a block will be read before the "
    165 	" test completes. If there are no reads, then this will apply to the"
    166 	" number of writes. If this value is zero it means loop forever.")
    167 LLARG(seconds_to_run, 0LL, "The number of seconds to run the test for. "
    168 	"if the value is zero it means run forever, or until some other "
    169 	"event causes Diskomizer to exit.")
    170 LARG(sequential_passes, 1L, "The number of sequential passes to do before "
    171 	"starting to do random writes.")
    172 IARG(open_retries, 1, "The number of times to retry the open of each device"
    173 	" if it fails.")
    174 CARG(start_reads_percentage, 10, "The percentage of the disk that has to have "
    175 	"been written before the first reads are issued. Setting this value "
    176 	"high when <A HREF=\"#EXPERT_READ_MINIMUM\">EXPERT_READ_MINIMUM</A> "
    177 	"is non zero can lead to live lock.")
    178 #define	shared_memory_allocator allocator
    179 STARG(shared_memory_allocator, "BEST",
    180 	"The memory allocator to use to allocate any shared memory. "
    181 	"Values are:\n"
    182 	"<UL>"
    183 	"\n<LI>BEST_SHM Try ISM, and SHM in that order until the memory is"
    184 	" allocated or a hard error is seen, "
    185 	"\n<LI>BEST Try BEST_SHM, and MMAP in that order until the memory is"
    186 	" allocated or a hard error is seen, "
    187 	"\n<LI>ISM Use Intimate shared memory,"
    188 	"\n<LI>SHM Use shared memory, "
    189 	"\n<LI>MMAP Use mmap</UL><P>\n"
    190 	"When using <B>ISM</B> or <B>SHM</B> you will almost certainly have to"
    191 	" increase the values of <B>shmsys:shminfo_shmmax</B>, "
    192 	" <B>shmsys:shminfo_shmmni</B> and <B>shmsys:shminfo_shmseg</B> in "
    193 	" <B>/etc/system</B>. If you change the value of "
    194 	"<B>shmsys:shminfo_shmmax</B> then be sure to set the option "
    195 	"<A HREF=\"#SHMINFO_SHMMAX\"><B>shminfo_shmmax</B></A> to reflect the"
    196 	" new value")
    197 BARG(shm_pageable, 0, "If using the SHM, ISM or BEST_SHM memory allocators "
    198 	"then pass the SHM_PAGEABLE flag to shmget and shmat to allow "
    199 	"the shared memory to be pageable if the operating system supports it")
    200 STARG(checker, "CHECKSUM", "The method of checking to use on the data that is "
    201 	"read of disk. Valid values are:\n<UL>"
    202 	"\n<LI>FULL - Do full checking,"
    203 	"\n<LI>CHECKSUM - Just check the checksums,"
    204 	"\n<LI>READONLY - Just check the checksums when in read-only mode,"
    205 	"\n<LI>NONE - Do no checking</UL>")
    206 IARG(report_time, 10 * MINUTE, "Report on any I/O's that have been outstanding "
    207 	" for this many seconds")
    208 STARG(on_write_error, "RETRY,REWRITE,EXIT",
    209 	"What action to take on a write returns that it has written less bytes "
    210 	"than it was asked to write.  This included the case where the write "
    211 	"returns -1."
    212 	" This is a comma separated list of options."
    213 	" Not all options make sense as anything but the last in the list"
    214 	" Valid values are:\n<UL>"
    215 	"\n<LI><A NAME=\"PAUSE\">PAUSE</A> - Pause and just see if the data "
    216 		"has turned up!,"
    217 	"\n<LI><A NAME=\"RETRY\">RETRY</A> - retry the read asynchronously,"
    218 	"\n<LI>REWRITE - re write the data synchronously,"
    219 	"\n<LI>FAIL_PATH - fail this path and use and alternative if available,"
    220 	"\n<LI>CONTINUE - Continue on,"
    221 	"\n<LI>STOP - stop io to this device,"
    222 	"\n<LI>EXIT - exit,"
    223 	"\n<LI>UADMIN - Issue the "
    224 	    ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    225 	    " system call with the arguments "
    226 	    "given by <A HREF=\"#EXPERT_UADMIN_CMD\">EXPERT_UADMIN_CMD</A> "
    227 	    "and <A HREF=\"#EXPERT_UADMIN_FCN\">EXPERT_UADMIN_FCN</A>. Use "
    228 	    "of this option is restricted by the kernel. See "
    229 	    ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    230 	    ". This option can be used to quickly stop all io by halting the "
    231 	    "system; allowing state in other devices to be changed as little "
    232 	    "as possible. <B>Use with extreme caution.</B>"
    233 	"\n<LI>ABORT - Abort and dump core, not recommended.</UL>")
    234 STARG(on_error_short, "RETRY,REREAD,EXIT",
    235 	"What action to take on a read returns that it has read less bytes "
    236 	"than it was asked to read.  This included the case where the read "
    237 	"returns -1."
    238 	" This is a comma separated list of options."
    239 	" Not all options make sense as anything but the last in the list"
    240 	" Valid values are:\n<UL>"
    241 	"\n<LI><A NAME=\"PAUSE\">PAUSE</A> - Pause and just see if the data "
    242 		"has turned up!,"
    243 	"\n<LI><A NAME=\"RETRY\">RETRY</A> - retry the read asynchronously,"
    244 	"\n<LI>REREAD - re read the data synchronously,"
    245 	"\n<LI>FAIL_PATH - fail this path and use and alternative if available,"
    246 	"\n<LI>CONTINUE - Continue on,"
    247 	"\n<LI>STOP - stop io to this device,"
    248 	"\n<LI>EXIT - exit,"
    249 	"\n<LI>UADMIN - Issue the "
    250 	    ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    251 	    " system call with the arguments "
    252 	    "given by <A HREF=\"#EXPERT_UADMIN_CMD\">EXPERT_UADMIN_CMD</A> "
    253 	    "and <A HREF=\"#EXPERT_UADMIN_FCN\">EXPERT_UADMIN_FCN</A>. Use "
    254 	    "of this option is restricted by the kernel. See "
    255 	    ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    256 	    ". This option can be used to quickly stop all io by halting the "
    257 	    "system; allowing state in other devices to be changed as little "
    258 	    "as possible. <B>Use with extreme caution.</B>"
    259 	"\n<LI>ABORT - Abort and dump core, not recommended.</UL>")
    260 STARG(on_error_corrupt, "RETRY,REREAD,EXIT", "What action to take when "
    261 	"data corruption is detected. It takes the same values as "
    262 	"<A HREF=\"#ON_ERROR_SHORT\">ON_ERROR_SHORT</A>.")
    263 STARG(initializer, "SEQ8", "The routine to use to initialise the data "
    264 	"Valid options are: "
    265 	"\n<UL>"
    266 	"\n<LI>RANDOM - Use random data,</LI>"
    267 	"\n<LI>SEQ8 - Use sequential 8 bit data,</LI>"
    268 	"\n<LI>RSEQ8 - Use reverse sequential 8 bit data,</LI>"
    269 	"\n<LI>SEQ16 - Use sequential 16 bit data,</LI>"
    270 	"\n<LI>RSEQ16 - Use reverse sequential 16 bit data,</LI>"
    271 	"\n<LI>SEQ32 - Use sequential 32 bit data,</LI>"
    272 	"\n<LI>RSEQ32 - Use reverse sequential 32 bit data,</LI>"
    273 	"\n<LI>SEQ64 - Use sequential 64 bit data,</LI>"
    274 	"\n<LI>RSEQ64 - Use reverse sequential 64 bit data,</LI>"
    275 	"\n<LI>SUPPLIED_VALUE - Use the value given by </LI>"
    276 	"<A HREF=\"#WRITE_BUFFER_SUPPLIED_VALUE\">WRITE_BUFFER_SUPPLIED_VALUE"
    277 	"</A>, Use of fixed "
    278 	" values is not recommended, unless doing pattern testing, "
    279 	"as this limits the differences in the"
    280 	" data written to each block to the header,</LI>"
    281 	"\n<LI>CJTPAT - Compliant Jitter Tolerance Test Pattern in Fibre "
    282 	"Channel,</LI>"
    283 	"\n<LI>ISIPAT - ISI Killer  Test Pattern in Fibre "
    284 	"Channel,</LI>"
    285 	"\n<LI>ISI_AND_CJT_PAT - ISI Killer  Test Pattern in Fibre and the "
    286 	"ompliant Jitter Tolerance Test Pattern in Fibre Channel one after "
    287 	"another,</LI>"
    288 	"</UL>")
    289 STARG(read_buffer_init, "SUPPLIED_VALUE",
    290 	"The routine to use to initialise read buffers Valid options are:"
    291 	"\n<UL>"
    292 	"\n<LI>NONE - Do no initialisation,"
    293 	"\n<LI>ZERO - Zero out each data buffer before use,"
    294 	"\n<LI>DEADBEEF - Write the bit pattern 0xdeadbeef,"
    295 	"\n<LI>ZERO_ONE - Write the binary bit pattern 01010101,"
    296 	"\n<LI>ONE_ZERO - Write the binary bit pattern 10101010,"
    297 	"\n<LI>XOR - Write opposite bit pattern to the one it expects to read,"
    298 	"\n<LI>SUPPLIED_VALUE - write the value given by <A HREF="
    299 	"\"#READ_BUFFER_SUPPLIED_VALUE\">READ_BUFFER_SUPPLIED_VALUE</A>."
    300 	"\n<LI>DEADBEEF_64 - Write the bit pattern 0xdeadbeef"
    301 	" every 64 bytes"
    302 	"</UL>")
    303 SARG(max_read_retries, 5, "The maximum number of times to retry a read,"
    304 	" when using the <A HREF=\"#RETRY\">RETRY</A> error option")
    305 SARG(max_write_retries, 5, "The maximum number of times to retry a write")
    306 STARG(data_file, NULL, "The name of the directory into which the "
    307 	"configuration is saved")
    308 IARG(read_buffer_supplied_value, 0xfeedbede,
    309 	"A Constant 32 bit quantity to initialise the read buffers with, "
    310 	"when using the SUPPLIED_VALUE option to "
    311 	"<A HREF=\"#READ_BUFFER_INIT\">READ_BUFFER_INIT</a>.")
    312 ILIST(write_buffer_supplied_value,
    313 	"0xffffffff, 0x00000000, 0xffff0000, 0x0000ffff, "
    314 	"0xf0f0f0f0, 0x0f0f0f0f, 0xff00ff00, 0x00ff00ff, "
    315 	"0xfff000ff, 0x0fff000f, 0x00fff000, 0x000fff00, "
    316 	"0xf000fff0, 0xff000fff, "
    317 	"0xAA55AA55, 0x55AA55AA, 0x55555555, 0xAAAAAAAA, "
    318 	"0x3C3C3b3C, 0xC3C3C3C3, 0x66666666, 0x99999999, "
    319 	"0xe77ee77e, 0x7ee77ee7, 0x7e7e7e7e, 0xe7e7e7e7",
    320 	"Constant 32 bit quantities to initialise the write buffers with, "
    321 	"when using the SUPPLIED_VALUE option to "
    322 	"<A HREF=\"#INITIALIZER\">INITIALIZER</a>. Each value is used "
    323 	"to initialize a buffer until all the values have been used "
    324 	"and then the first value is used again. Weightings can "
    325 	"be applied to the values so that some values are used more "
    326 	"then others.")
    327 BARG(fast_start, 1, "If non zero do not do anything during the initialisation"
    328 	" that can be left until run time.  The down side of this is that "
    329 	" if short of space in the directory specified by "
    330 	"<A HREF=\"#EXPERT_MMAP_FILE_DIRECTORY\">EXPERT_MMAP_FILE_DIRECTORY</A>"
    331 	" Diskomizer can get a SIGBUS at runtime, which it will catch and "
    332 	" report as a memset error.")
    333 CARG(paths_to_use, 2, "The number of alternate paths to use in parallel"
    334 	" when available. See also <A HREF=\"#DEVICES\">DEVICES</A>")
    335 CARG(error_paths, 0, "The number of alternate paths to have open and use in "
    336 	"case of errors, when available. "
    337 	"See also <A HREF=\"#DEVICES\">DEVICES</A>")
    338 IARG(how_often_to_report, 10000, "After this number of i/o requests report the "
    339 	"times, Times are reported at LOG_INFO priority. If this is set to "
    340 	"zero then never report.")
    341 BARG(use_long_names, 0, "Use long names of devices when displaying them"
    342 	" if using a Veritas volumes or Solstice Disk Suite"
    343 	" devices set this to 1")
    344 STARG(STDOUT, NULL, "Use this file as standard out. The file will be appended"
    345 	" to.")
    346 STARG(STDERR, NULL, "Use this file as standard error. The file will be appended"
    347 	" to.")
    348 STARG(stderr_priority, "WARNING",
    349 	"Messages at this priority and above will go into "
    350 	"the <A HREF=#STDERR>STDERR</A> file. "
    351 	"The priorities used are syslog priorities.")
    352 STARG(stdout_priority, "INFO", "Messages at this priority and above and below "
    353 	"<A HREF=#stderr_priority>STDERR_PRIORITY</A> will go into the the "
    354 	"<A HREF=#STDOUT>STDOUT</A> file")
    355 BARG(background, 0, "If non zero and stdout and stderr are set"
    356 	" Diskomizer will background itself.")
    357 STARG(workingdir, "/tmp/diskomizer", "The base name of the working "
    358 	"directory for the processes.")
    359 LARG(shminfo_shmmax, 0x100000L, "The maximum size of a shared memory segment."
    360 	" This should be set to be the same as the setting of "
    361 	"<B>shmsys:shminfo_shmmax</B> in <B>/etc/system</B>. The default"
    362 	" value matches the default value of <B>shmsys:shminfo_shmmax</B>"
    363 	" in SunOS 5.7.")
    364 BARG(o_rdonly, 0, "If set non zero open the file[s] O_RDONLY. "
    365 	"This makes the write threads into special read threads which "
    366 	"if the block has not yet been read, just "
    367 	"read the block and calculate the checksum based on the current "
    368 	"content of the block. If the block has been read then the checksum "
    369 	"is compared with the previously calculated checksum and and "
    370 	"difference reported.\nNo diffs files are produced in read-only mode.\n"
    371 	"The I/O size is constant in this mode, the largest I/O size "
    372 	"specified by <A HREF=#DISK_IO_SIZES>DISK_IO_SIZES</A> is used for "
    373 	"all I/O. The only values of <A HREF=#CHECKER>CHECKER</A> that "
    374 	"are legal are:\n<UL>"
    375 	"\n<LI>READONLY - Diskomizer checks the data using checksums. "
    376 	"\n<LI>NONE - Diskomizer does no checking."
    377 	"\n</UL>")
    378 BARG(o_sync, 0, "If set non zero open the file[s] O_SYNC. Use this option when"
    379 	" testing files in a file system, rather than raw devices.")
    380 BARG(display_prev_diffs, 0, "If non zero then display the diffs for the "
    381 	"previous write to the block as well as the diffs for the last write "
    382 	"to the block.")
    383 STARG(syslog_facility, NULL,
    384 	"The facility to use if you wish to use syslog to log "
    385 	"messages. To put useful messages into <I>/var/adm/messages</I> "
    386 	"on a standard installation set this to <B>DAEMON</B>.")
    387 STARG(syslog_log_upto_priority, "NOTICE",
    388 	"The syslog priority up to which messages will be logged when "
    389 	"using syslog. This should be set to the highest priority "
    390 	"of message that you wish to have logged to syslog."
    391 	"Setting this too low results in syslogd being the bottleneck "
    392 	"for the number of ios that can be generated.")
    393 STARG(aio_routines, "SUNOS", "Routines for doing async io."
    394 	" Some possible values are:\n"
    395 	"<UL>"
    396 	"\n<LI>SUNOS - Use the sunos aio routines "
    397 		"(aioread and aiowrite).</LI>"
    398 	"\n<LI>POSIX - Use the POSIX aio routines "
    399 		"(aio_read and aio_write).</LI>"
    400 	"\n<LI>PREAD - Use pread(2) and pwrite(3) and "
    401 		"threads to simulate aio.</LI>"
    402 	"</UL>")
    403 END_SECTION(General)
    404 /*
    405  * Expert options.
    406  */
    407 START_SECTION(Expert, "The expert options are not intended for general "
    408 	"use. A number of them are there to tune the performance of "
    409 	"Diskomizer to get it to be able to Diskomize more disks, "
    410 	"particularly when the address space is limited.")
    411 #define	expert_nlocks nlocks
    412 IARG(expert_nlocks, 0, "The number of locks used to protect the bitmaps")
    413 LARG(expert_release_read_buffers_after_n_uses, 10L, "The number of times "
    414 	"each read buffer is used before being release back into the pool. ")
    415 LARG(expert_release_write_buffers_after_n_uses, 10L, "The number of times "
    416 	"each write buffer is used before being release back into the pool. ")
    417 #define	expert_number_of_write_buffers nwritebufs
    418 LARG(expert_number_of_write_buffers, 0L,
    419 	"The number of write buffers to use. A value of zero causes "
    420 	"the system to choose the number of buffers to use. The number "
    421 	"chosen by default is 10 times the maximum that will be required "
    422 	"at any given time. This makes searching for a free buffer quick "
    423 	"but when there are large numbers of devices and processes and "
    424 	"writing threads makes the memory usage very large.  Setting this "
    425 	"value to 1 will make the system choose a value that is 1.1 times "
    426 	"the maximum number of blocks required.")
    427 #define	expert_number_of_read_buffers nreadbufs
    428 LARG(expert_number_of_read_buffers, 0L,
    429 	"The number of read buffers to use. A value of zero causes "
    430 	"the system to choose the number of buffers to use. See "
    431 	"<A HREF=\"#expert_number_of_write_buffers\">"
    432 	"expert_number_of_write_buffers</A> for details of memory usage.")
    433 #define	expert_start_offset start_offset
    434 LARG(expert_start_offset, 4L,
    435 	"The offset in Diskomizer blocks at which to start"
    436 	" reading and writing, this can be used to protect the disk label")
    437 #define	expert_save_data save_data
    438 BARG(expert_save_data, 0, "If non zero save the buffers that are going to be "
    439 	"used to disk before starting")
    440 #define	expert_init_from_data_file init_from_data_file
    441 BARG(expert_init_from_data_file, 0,
    442 	"Initialize buffers from a file created by "
    443 	"the <A HREF=\"#EXPERT_SAVE_DATA\">EXPERT_SAVE_DATA</A> option.")
    444 #define	expert_fix_bad_checksums fix_bad_checksums
    445 BARG(expert_fix_bad_checksums, 0,
    446 	"If non zero it will fix bad checksums if it "
    447 	"finds any after initialising the data buffers.")
    448 LARG(expert_mmap_max_size, sysconf(_SC_PAGESIZE) * sizeof (struct blks),
    449 	"For mmap memory that can be allocated in chunks, the largest chunk "
    450 	"size.")
    451 #define	expert_hint_shm_chunk_size shm_max_size
    452 LARG(expert_hint_shm_chunk_size, sysconf(_SC_PAGESIZE) * sizeof (struct blks),
    453 	"For shm memory that can be allocated in chunks, the largest chunk "
    454 	"size.")
    455 #define	expert_mmap_file_directory mmap_file_directory
    456 STARG(expert_mmap_file_directory, "/tmp",
    457 	"The directory in which to create the "
    458 	"shared memory mmap files. This directory should not be remote, "
    459 	"in fact if it is not tmpfs you will only end up testing this "
    460 	"directory and not the devices. It will need to have a lot of "
    461 	"space in it.")
    462 BARG(expert_always_mmap_from_file, 0, "If non zero then never map from "
    463 	"/dev/zero, always use the files")
    464 #define	expert_read_buffer_gap read_buffer_gap
    465 IARG(expert_read_buffer_gap, 0,
    466 	"Size in bytes of of the gap between read buffers. "
    467 	"This leads to more exciting alignments and buffers that cross page "
    468 	"boundaries")
    469 #define	expert_write_buffer_gap write_buffer_gap
    470 IARG(expert_write_buffer_gap, 0,
    471 	"Size in bytes of of the gap between write buffers. "
    472 	"This leads to more exciting alignments and buffers that cross page "
    473 	"boundaries")
    474 #define	expert_read_minimum read_minimum
    475 IARG(expert_read_minimum, 0, "The minimum number of times a block must be read"
    476 	" before it is rewritten. If not enough reads are done this can lead "
    477 	"to Diskomizer deferring writes while it finds blocks that have "
    478 	"been written.")
    479 LLARG(expert_min_active_time, LONGLONG_MAX,
    480 	"The minimum time in micro seconds that the device "
    481 	"will be kept busy before all i/o is allowed to drain and the device "
    482 	"is allowed to be idle")
    483 LLARG(expert_max_active_time, 0LL,
    484 	"The maximum time in micro seconds that the device "
    485 	"will be kept busy before all i/o is allowed to drain and the device "
    486 	"is allowed to be idle, zero indicates there will be no idle times.")
    487 LLARG(expert_min_idle_time, 0LL,
    488 	"The minimum time in micro seconds to pause for while the disk "
    489 	"drive is to be idle")
    490 LLARG(expert_max_idle_time, 0LL,
    491 	"The maximum time in micro seconds to pause for while the disk "
    492 	"drive is to be idle")
    493 IARG(expert_read_cluster_length, 1, "The length of a read i/o cluster. "
    494 	"This must never be zero")
    495 IARG(expert_write_cluster_length, 1, "The length of a write i/o cluster. "
    496 	"This must never be zero")
    497 BARG(expert_small_diffs, 0, "If non zero, then when printing diffs files "
    498 	"only print the lines that contain differences.")
    499 BARG(expert_cleanup_created_files, 1, "If non zero, then any files that are "
    500 	"created to do io too and from are removed at the end of the run. "
    501 	"Files that are not created by Diskomizer are not removed. "
    502 	"If there are any errors during the run the files are not deleted "
    503 	"so you can perform a post mortem.")
    504 CARG(expert_decimal_places, 3, "The number of decimal places to report "
    505 	"the io times to.")
    506 LLARG(expert_amount_to_leave_unused, 0LL, "The number of bytes to leave unused "
    507 	"in a directory. This is not used when doing io to raw or "
    508 	"block devices")
    509 SARG(expert_recent_log_size, 0, "The size of the \"recent write\" log. "
    510 	"The offsets of the last expert_recent_log_size successful writes "
    511 	"by each process on each device are logged, so that if there is an "
    512 	"event they can quickly be checked for problems.")
    513 STARG(expert_uadmin_cmd, "A_SHUTDOWN", "Default command for on error UADMIN "
    514 	"see "
    515 	ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    516 	" for a complete list of options on this system.")
    517 STARG(expert_uadmin_fcn, "AD_HALT", "Default function for on error UADMIN "
    518 	"see "
    519 	ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    520 	" for a complete list of options on this system.")
    521 STARG(expert_uadmin_mdep, NULL, "Default string to pass as mdep "
    522 	"for on error UADMIN. See "
    523 	ARG_LINK(ARG_UADMIN_URL, "uadmin(2)")
    524 	" for a complete list of options on this system.")
    525 BARG(expert_allow_detach, 1, "Allow the detaching of shared memory segments.")
    526 STARG(expert_userpat_file, "userpat_data_file", "Name of the file contianing"
    527 	"the data to initialise the write buffers with. This is binary data"
    528 	"that is repeated across all the buffers")
    529 BARG(expert_do_path_check, 1, "Check of incorrect configuration where the same "
    530 	"device or file has been listed more than once")
    531 END_SECTION(Expert)
    532 /*
    533  * End of the Expert options.
    534  */
    535 /*
    536  *	The obscure options. I kid you not...
    537  */
    538 START_SECTION(Obscure, "The Obscure options are options that have either "
    539 	"been added for specific problems, or to change the behaviour "
    540 	"of the program to do the unusual or for tuning the program. "
    541 	"If the option was added for tuning then the assumption is that "
    542 	"it's default value is now well understood and gives the desired "
    543 	"level of performance.")
    544 BARG(obscure_execute, 0,
    545 	"If non zero then execute code that is read from the "
    546 	"device if it passes the check and is marked executable. This "
    547 	"is here to test executing instructions directly from shared memory.")
    548 #define	obscure_max_fork_failure max_fork_failure
    549 CARG(obscure_max_fork_failure, 5, "The number of times a fork will be "
    550 	"tried before giving up. Fork return EAGAIN so it is reasonable"
    551 	" to have a few goes before giving up.")
    552 #define	obscure_fork_failure_wait_time fork_failure_wait_time
    553 CARG(obscure_fork_failure_wait_time, 20, "The number of seconds to wait "
    554 	"between each fork failure before trying again.")
    555 #define	obscure_use_fork1 use_fork1
    556 BARG(obscure_use_fork1, 0,
    557 	"If set non zero it will use fork1 instead of fork.")
    558 #define	obscure_keep_shm keep_shm
    559 BARG(obscure_keep_shm, 0, "If non zero the shared memory segments are not "
    560 	"immediately deleted when they can be. Why you would want to keep "
    561 	"the shared memory segments is beyond me, but this option has always "
    562 	"been there so it stays.")
    563 #define	obscure_max_gettimeofday_retries max_gettimeofday_retries
    564 CARG(obscure_max_gettimeofday_retries, 100,
    565 	"The maximum number of times to retry "
    566 	"gettimeofday when it returns bogus usec values. This is a work around"
    567 	" for bug 4126459.")
    568 #define	obscure_o_ndelay o_ndelay
    569 BARG(obscure_o_ndelay, 0, "If set non zero open the file[s] O_NDELAY")
    570 #define	obscure_o_trunc o_trunc
    571 BARG(obscure_o_trunc, 0, "If set non zero open the file[s] O_TRUNC")
    572 #define	obscure_o_excl o_excl
    573 BARG(obscure_o_excl, 1, "If set non zero open the file[s] O_EXCL, "
    574 	"do not ever set this to zero.")
    575 #define	obscure_pause_time pause_time
    576 IARG(obscure_pause_time, 5, "The time to pause for when using the "
    577 	"<A HREF=\"#PAUSE\">PAUSE</A> error handler.")
    578 #define	obscure_max_mem_delay max_mem_delay
    579 IARG(obscure_max_mem_delay, 0,
    580 	"The maximum number of cycles to wait before checking "
    581 	"that the checksum written into shared memory is correct. This is"
    582 	" an attempt to check for data corruption in shared memory")
    583 #define	obscure_use_madvise use_madvise
    584 BARG(obscure_use_madvise, 0,
    585 	"If not zero set call madvise when getting and returning "
    586 	" buffers. Use of madvise could make things faster, or can be used "
    587 	" to just be cruel to the VM system, by saying we don't want things "
    588 	"just before we use them, or saying we need things when we have just"
    589 	" finished with them.  Added in an attempt to reproduce a specific "
    590 	" problem, instead was able to log bug 4246624.")
    591 #define	obscure_madvise_get madvise_get
    592 CARG(obscure_madvise_get, MADV_WILLNEED,
    593 	"If <A HREF=\"#OBSCURE_USE_MADVISE\">OBSCURE_USE_MADVISE</A> is set,"
    594 	"then use this value as the value for the advice flag to madvise"
    595 	" when getting an io buffer.")
    596 #define	obscure_madvise_return madvise_return
    597 CARG(obscure_madvise_return, MADV_DONTNEED,
    598 	"If <A HREF=\"#OBSCURE_USE_MADVISE\">OBSCURE_USE_MADVISE</A> is set,"
    599 	" then use this value as the value for the advice flag to madvise"
    600 	" when returning an io buffer.")
    601 BARG(obscure_leave_shm_attached_after_init, 0, "After creating shared memory "
    602 	"leave the memory attached. Otherwise all the memory segments that can "
    603 	"be detached are detached and then attached as required.")
    604 LARG(obscure_writemap_size, 0L,
    605 	"The size in bytes of the bitmap that protects the disk blocks. "
    606 	"Use of this options is <B>strongly</B> discouraged, use in "
    607 	"conjunction "
    608 	"with <A HREF=\"#EXPERT_READ_MINIMUM\">EXPERT_READ_MINIMUM</A> can "
    609 	"easily lead to Diskomizer thrashing and deferring writes.")
    610 LARG(obscure_readmap_size, 0L,
    611 	"The size in bytes of the bitmap that protects the read buffers. "
    612 	"Use of this option is <B>strongly</B> discouraged, any saving in "
    613 	"space is insignificant compared to the amount of space used for "
    614 	"the actual buffers.")
    615 LARG(obscure_search_multiplier, 1000L, "Multiplier to effect how long to "
    616 	"search for blocks to write before deferring the write. The larger "
    617 	"the number the less time to search.  Setting this to 0 will lead to "
    618 	"diskomizer searching forever, which is a live lock. This is only "
    619 	"used when <A HREF=\"#EXPERT_READ_MINIMUM\">EXPERT_READ_MINIMUM</A> "
    620 	"is set.")
    621 STARG(obscure_data_file_basename, "DISKOMIZER_TEST_TARGET_", "The name of any "
    622 	"data files that get created by diskomizer when "
    623 	"<A HREF=\"#NUMBER_OF_FILES\">NUMBER_OF_FILES</A> is non zero and a "
    624 	"directory is given as the target <A HREF=\"#DEVICE\">DEVICE</A>"
    625 	" for the test.")
    626 BARG(obscure_mprotect_write_bufs, 0, "Set this non zero to call mprotect "
    627 	"to toggle the protections on the buffers used for writing. "
    628 	"Has severe performance consequences.")
    629 IARG(obscure_buffer_multiplier, 2, "The amount by which to multiply the "
    630 	"the number of read and write buffers by.")
    631 BARG(obscure_report_priority, 1, "If non zero then report the syslog priority "
    632 	"of any messages that are printed.")
    633 CARG(obscure_bit_percentage, 1, "The maximum percentage of bits that can be "
    634 	"corrupted and diskomizer still report the corruption as bit "
    635 	"corruption")
    636 BARG(obscure_raw_bits, 0, "If non zero print all bits that are in error in "
    637 	"raw form no matter how many are in error otherwise for small numbers "
    638 	"of bits in error it will list the bit offsets.")
    639 BARG(obscure_allow_efi_102, 0, "Allow the opening of devices that have an"
    640 	" EFI label with a version of 0x00010002. These were written by the "
    641 	" format command on Solaris prior to fixing bug 4888423")
    642 STARG(obscure_usagetracking_domain, ".sun.com", "Domain within which to do"
    643 	" usage tracking. Set this to \"\" to disable usage tracking.")
    644 STARG(obscure_usage_email, "pts_usage_tracking+diskomizer (at) sun.com",
    645 	"Email address to send usage tracking to, only used if the current "
    646 	"domain is a sub domain of "
    647 	ARG_LINK("#OBSCURE_USAGETRACKING_DOMAIN",
    648 		"OBSCURE_USAGETRACKING_DOMAIN") ".")
    649 STARG(obscure_usage_file, "usage_tracking.xml",
    650 		"Name of file to store the usage tracking "
    651 		"information in.")
    652 STARG(obscure_sendmail, "/usr/lib/sendmail", "Program to deliver email for "
    653 		"usage tracking.")
    654 BARG(obscure_allow_non_zero_efi_reserved, 1, "If true then do not treat non "
    655 		"zero entries in the efi label's reserved areas as errors")
    656 END_SECTION(Obscure)
    657 /*
    658  * End of obscure options.
    659  */
    660 /*
    661  * Start of debug options.
    662  */
    663 START_SECTION(Debug, "These options are only used when debugging diskomizer. "
    664 	" Their use is strongly discouraged.")
    665 BARG(debug, 0, "If non zero print debug messages, not recommended.")
    666 BARG(debug_no_action, 0, "Exit after parsing all the options and opening all "
    667 	"the devices and checking for duplicate paths but not doing the main "
    668 	"io")
    669 BARG(debug_always_detach, 0,
    670 	"If set non zero memory that can be detached will"
    671 	" always be detached and reattached when needed. The default is "
    672 	"only to detach memory when short of address space.")
    673 BARG(debug_allow_coredump, 0,
    674 	"Set this non zero if you want to get core files "
    675 	"when there is a failure")
    676 BARG(debug_pause_on_signal, 0,
    677 	"Set this non zero and diskomizer will pause to allow a debugger to "
    678 	"attach on a fatal error.")
    679 BARG(debug_report_errors_as_discovered, 0,
    680 	"Report errors when the code discovers them rather than storing the "
    681 	"error information and reporting it in a consise manner.")
    682 #define	debug_dev_tree dev_tree
    683 STARG(debug_dev_tree, "/devices", "path to a /devices tree.")
    684 END_SECTION(Debug)
    685 
    686 /* Just to keep hdrchk happy. This header must have no guard */
    687 #undef	_DISKOMIZER_ARG_VALS_H
    688 
    689 #ifdef	__cplusplus
    690 }
    691 #endif
    692 
    693 #endif	/* _DISKOMIZER_ARG_VALS_H */
    694