⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dtusage.c

📁 Linux磁盘测试的源代码,测试磁盘的读写性能
💻 C
📖 第 1 页 / 共 2 页
字号:
/**************************************************************************** *									    * *			  COPYRIGHT (c) 1990 - 2004			    * *			   This Software Provided			    * *				     By					    * *			  Robin's Nest Software Inc.			    * *									    * * Permission to use, copy, modify, distribute and sell this software and   * * its documentation for any purpose and without fee is hereby granted,	    * * provided that the above copyright notice appear in all copies and that   * * both that copyright notice and this permission notice appear in the	    * * supporting documentation, and that the name of the author not be used    * * in advertising or publicity pertaining to distribution of the software   * * without specific, written prior permission.				    * *									    * * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 	    * * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN	    * * NO EVENT SHALL HE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL   * * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR    * * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS  * * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF   * * THIS SOFTWARE.							    * *									    * ****************************************************************************//* * Module:	dtusage.c * Author:	Robin T. Miller * * Description: *	Display usage information for generic data test program. * * Modification History: * * December 5th, 2003 by Robin Miller. *      Conditionalize help text for tty options. * * March 15th, 2003 by Robin Miller. *	Add displaying of prefix string if specified. * * January 24th, 2001 by Robin Miller. *	Add help text for variable I/O requests sizes. * * December 30th, 2000 by Robin Miller. *	Make changes to build using MKS/NuTCracker product. * * May 8th, 2000 by Robin Miller. *	Add dtversion() to display just the version string. * * August 6th, 1999 by Robin Miller. *	Better parameterizing of "long long" printf formatting. * * July 29th, 1999 by Robin Miller. *	Merge in changes made to compile on FreeBSD. * * July 24th, 1999 by Robin Miller. *	Bumped major version number to 12.x due to pattern=iot support. * * December 21, 1998 by Robin Miller. *	Bump of major version number to 11.x due to tape reset support. * * March 27, 1997 by Ali Eghlima. *	Document "munsa={cr,cw,pr,pw,ex}" option.  MUti-Node Simultaneous *	Access (MUNSA) is used in a cluster system when accessing shared *	resources.  The Distributed Lock Manager (DLM) is used to control *	access to a resource and to synchronize all access. * * February 21, 1996 by Robin Miller. *	Document iotype={random,sequential} options. * * December 19, 1995 by Robin Miller *      Conditionalize for Linux Operating System. * * November 19, 1995 by Robin Miller. *	Describe logical block data options (lba=, lbs=, enable=lbdata). * * July 26, 1995 by Robin Miller. *	Added AIO bug fixes/enhancements, special pattern string mapping, *	corrected data dumping/add dump limit, reporting of lba on disk *	devices, child signal bug fix/error control, additional stats... *	So, it's finally time for a new version string -> V8.0 (enjoy). * * September 23, 1994 by Robin Miller. *      Change O_DSYNCH to O_DSYNC, and O_FSYNCH to O_SYNC. * * December 7, 1993 by Robin Miller. *	Ported to SunOS 5.1 (Solaris). * * September 1, 1993 by Robin Miller. *	Added description of "min=", "max=", & "incr=" parameters. *	Finally added version and date identifiers for tracking. *	V1.0=Sun/3 (disk & tape), V2.0=Sun/386i (tty support), *	V3.0=Sun/Sparc (mmap files), V4.0=Ultrix, V5.0=DEC OSF/1, *	V6.0=QNX (POSIX support), *	V7.0=(procs, files, step, runtime, AIO, variable records). * * August 31, 1993 by Robin Miller. *	Added description of "align=rotate" & "pattern=incr" options. * * August 30, 1993 by Robin Miller. *	Added description of AIO options: enable=aio & aios=value * * August 17, 1993 by Robin Miller. *	Added text to describe "runtime=" option & format. * * August 5, 1993 by Robin Miller. *	Add text to describe "files=value" option (for tapes). * * August 3, 1993 by Robin Miller. *	Add text to describe "procs=value" option. * * September 19, 1992 by Robin Miller. *	Add text to describe "enable/disable=flush" tty option. * * September 17, 1992 by Robin Miller. *	Add text to describe "pattern=string" option, and to describe *	how to override the default decimal radix numeric input. * * September 11, 1992 by Robin Miller. *	Display help text to stdout instead of stderr so output can be *	easily piped to a pager. */#include "dt.h"#include <fcntl.h>/* * usage()	Display valid options for dt program. * *	Really should be in a man page since it's grown so much. */#define P	printf#define D	Fprintchar *version_str = "Date: March 30th, 2004, Version: 15.6, Author: Robin T. Miller";voiddtusage(void){    D ("Usage: %s options...\n", cmdname);    D (" Type '%s help' for a list of valid options.\n", cmdname);    exit (FATAL_ERROR);}voiddtversion(void){    P ("    --> %s <--\n", version_str);    exit (SUCCESS);}voiddthelp(void){    static char *enabled_str = "enabled";    static char *disabled_str = "disabled";    P ("Usage: %s options...\n", cmdname);    P ("\n    Where options are:\n");    P ("\tif=filename      The input file to read.\n");    P ("\tof=filename      The output file to write.\n");    P ("\tpf=filename      The data pattern file to use.\n");    P ("\tbs=value         The block size to read/write.\n");    P ("\tlog=filename     The log file name to write.\n");#if defined(MUNSA)    P ("\tmunsa=string     Set munsa to: cr, cw, pr, pw, ex.\n");#endif /* defined(MUNSA) */#if defined(AIO)    P ("\taios=value       Set number of AIO's to queue.\n");#endif /* defined(AIO) */#if !defined(_QNX_SOURCE)    P ("\talign=offset     Set offset within page aligned buffer.\n");    P ("    or\talign=rotate     Rotate data address through sizeof(ptr).\n");#endif /* !defined(_QNX_SOURCE) */    P ("\tcapacity=value   Set the device capacity in bytes.\n");#if defined(DEC)    P ("    or\tcapacity=max     Set maximum capacity from disk driver.\n");#endif    P ("\tdispose=mode     Set file dispose to: {delete or keep}.\n");    P ("\tdlimit=value     Set the dump data buffer limit.\n");    P ("\tdtype=string     Set the device type being tested.\n");    P ("\tidtype=string    Set input device type being tested.\n");    P ("\todtype=string    Set output device type being tested.\n");    P ("\tdsize=value      Set the device block (sector) size.\n");    P ("\terrors=value     The number of errors to tolerate.\n");    P ("\tfiles=value      Set number of tape files to process.\n");    P ("\tflow=type        Set flow to: none, cts_rts, or xon_xoff.\n");/*  P ("\thz=value         Set number of clock ticks per second.\n");	*/    P ("\tincr=value       Set number of record bytes to increment.\n");    P ("    or\tincr=variable    Enables variable I/O request sizes.\n");    P ("\tiodir=direction  Set I/O direction to: {forward or reverse}.\n");    P ("\tiomode=mode      Set I/O mode to: {copy, test, or verify}.\n");    P ("\tiotype=type      Set I/O type to: {random or sequential}.\n");    P ("\tmin=value        Set the minumum record size to transfer.\n");    P ("\tmax=value        Set the maximum record size to transfer.\n");    P ("\tlba=value        Set starting block used w/lbdata option.\n");    P ("\tlbs=value        Set logical block size for lbdata option.\n");    P ("\tlimit=value      The number of bytes to transfer.\n");    P ("\tflags=flags      Set open flags:   {excl,sync,...}\n");    P ("\toflags=flags     Set output flags: {append,trunc,...}\n");    P ("\toncerr=action    Set child error action: {abort or continue}.\n");#if defined(_QNX_SOURCE)    P ("\tparity=string    Set parity to: {even, odd, mark, space, or none}.\n");#else /* !defined(_QNX_SOURCE) */    P ("\tparity=string    Set parity to: {even, odd, or none}.\n");#endif /* defined(_QNX_SOURCE) */    P ("\tpasses=value     The number of passes to perform.\n");    P ("\tpattern=value    The 32 bit hex data pattern to use.\n");    P ("    or\tpattern=iot      Use DJ's IOT test pattern.\n");    P ("    or\tpattern=incr     Use an incrementing data pattern.\n");    P ("    or\tpattern=string   The string to use for the data pattern.\n");    P ("\tposition=offset  Position to offset before testing.\n");    P ("\tprefix=string    The data pattern prefix string.\n");    P ("\tprocs=value      The number of processes to create.\n");    P ("\tralign=value     The random I/O offset alignment.\n");    P ("\trlimit=value     The random I/O data byte limit.\n");    P ("\trseed=value      The random number generator seed.\n");    P ("\trecords=value    The number of records to process.\n");    P ("\truntime=time     The number of seconds to execute.\n");    P ("\tslice=value      The specific disk slice to test.\n");    P ("\tslices=value     The number of disk slices to test.\n");    P ("\tskip=value       The number of records to skip past.\n");    P ("\tseek=value       The number of records to seek past.\n");    P ("\tstep=value       The number of bytes seeked after I/O.\n");#if defined(TTY)    P ("\tspeed=value      The tty speed (baud rate) to use.\n");    P ("\ttimeout=value    The tty read timeout in .10 seconds.\n");    P ("\tttymin=value     The tty read minimum count (sets vmin).\n");#endif /* defined(TTY) */    P ("\tvolumes=value    The number of volumes to process.\n");    P ("\tvrecords=value   The record limit for the last volume.\n");    P ("\tenable=flag      Enable one or more of the flags below.\n");    P ("\tdisable=flag     Disable one or more of the flags below.\n");    P ("\n    Flags to enable/disable:\n");#if defined(AIO)    P ("\taio              POSIX Asynchronous I/O.(Default: %s)\n",				(aio_flag) ? enabled_str : disabled_str);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -