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

📄 dt-usersguide.t

📁 Linux磁盘测试的源代码,测试磁盘的读写性能
💻 T
📖 第 1 页 / 共 5 页
字号:
.so ../trf_files/INIT.doc.\" <<<<<<<<<<<<< String Definitions >>>>>>>>>>>>>>>>>>>>>.ds DY February 2nd, 2001.ds F~ dt-UsersGuide.t.ds V~ Version 14.1.ds T~ \fIdt\fP - Data Test Program.so _Cover.dt-UsersGuide.\" <<<<<<<<<<<< Start Text Here >>>>>>>>>>>>>>>>>>>>>>.nh 1 Overview.\fIdt\fP is a generic data test program used to verify the proper operationof peripherals & I/O sub-systems, and for obtaining performance information.Since verification of data is performed, \fIdt\fP can be thought of as ageneric diagnostic tool..PPAlthough the original design goals of being a generic test tool wereaccomplished, it quickly become evident that device specific tests, suchas terminals, and different programming interfaces such as memory mappedfiles and POSIX asynchronous I/O API's were necessary.  Therefore, specialoptions were added to enable these test modes and to specify necessary testparameters..PP\fIdt\fP command lines are similar to the \fIdd\fP program, which is popularon most UNIX systems.  \fIdt\fP contains numerous options to provide usercontrol of most test parameters so customized tests can be written easilyand quickly by specifying simple command line options.  Since the exitstatus of the program always reflects the completion status of a test,scripts can easily detect failures to perform automatic regression tests..PP\fIdt\fP has been used to successfully test disks, tapes, serial lines,parallel lines, pipes & FIFO's, memory mapped files, and POSIX AsynchronousI/O.  In fact, \fIdt\fP can be used with any device that supports the standardopen, read, write, and close system calls.  Special support is necessaryfor some devices, such as serial lines, for setting up the speed, parity,data bits, etc, but \fIdt\fP's design provides easy addition of this setup..PPMost tests can be initiated by a simple \fIdt\fP command line, and lots ofI/O can be initiated quickly using multiple processes and/or POSIX AIO, forthose operating systems supporing AIO.  More complex tests are normallyinitiated by writing shell scripts and using \fIdt\fP in conjunction withother tools, such as \fIscu\fP (SCSI Command Utility).Several shell scripts for testing disks, tapes, and serial lines are alsosupplied with this kit which can used as templates for developing otherspecialized test scripts..PPSpecific system features are now being added to \fIdt\fP so more extensivetesting can be accomplished.  The program has been restructured to alloweasy inclusion of new device specific tests by dispatching to test functionsthrough a function lookup table.  This table gets setup automatically bythe program, based on options enabled, or via the device type "\fIdtype=\fP"option..B1WARNING: \fIdt\fP does NOT perform any sanity checking of the output devicespecified.  This means if you are running as 'root' and you specify a rawdisk device, \fIdt\fP will overwrite existing file systems, so please becareful..HSNOTE: Tru64 (Digital) UNIX prevents overwriting the disk label block (block 0),to prevent you from destroying this valuable information.  Overwriting otherfiles systems, not starting at block zero, is still possible however..B2.nh 1 Operating Systems Supported..PP\fIdt\fP is conditionalized to run on SUN, ULTRIX, OSF, QNX, Windows/NT, andLinux operating systems.  This conditionalization tends to make the source lookrather ugly, but I've purposely left this in for code maintainability (commoncode base) and for other people to see porting differences between these systems.UNIX is NOT as portable as some people think, but the POSIX standard is finallychanging this.  Eventually this will be cleaned up, but this conditionizationis currently necessary so \fIdt\fP will compile and run with non-ANSI compliantcompilers and non-POSIX compliant operating systems..nh 2 POSIX Compliant Systems.People who may wish to port \fIdt\fP to other POSIX compliant operatingsystems, should review the Tru64 UNIX, Linux, and QNX conditionalized code.These operating systems also support an ANSI compliant compiler..HS.nh 1 Test Uses.Those poeple with an imagination will find many uses for \fIdt\fP, but I'lllist a few I've used it for, just to whet your appetite:.buTesting of tape devices using different block sizes to determinethe best blocking factor for optimum performance and capacity.This is very important for streaming tapes devices..buWrite tapes to end of tape, to determine the total tape capacity.This gives the total data capacity of tapes, after inter-recordgaps, preamble/postambles, or pad blocks are written on the tape..buRead existing tapes with data comparison disabled, to determinethe amount of data on the tape.  This is useful to determine howmuch disk space is required to read in a tape, or to simply verifythe tape can be read without errors..buReading/writing an entire tape to ensure device drivers properlysense and handle end of tape error conditions..buWrite a tape and ensure it can be read on another tape drive totest drive compatibility (also referred to as transportability)..buRead multiple tape files to ensure file marks and end of tape arereported and handled properly by tape drivers..buI/O to disks using the raw device interface, to determine theoptimum performance of the controller.  This usually gives agood indication of how well the controller cache or read-aheadimproves I/O performance for sequential or random file access..buI/O to disk files through the file system, to determine the affectthe buffer cache has on write and read performance.  You must knowthe characteristics of your O/S's buffer cache to select file sizesto either get optimum performance from the cache, or to defeat theaffect of the buffer cache..buReading/writing of entire disks, to ensure the media capacity andend of media error handling is properly reported by device drivers..buTest memory mapped files to compare I/O performance against rawand file system I/O.  Typically, memory mapped I/O approaches theraw device performance..buTesting I/O to files on NFS mounted file systems.  This will giveyou a good indication of your ethernet performance to remote files..buWriting/reading pipes & FIFO's to verify pipe operation and performance..buInitiating multiple processes to test optimizations of buffer cache,device drivers, and/or intelligent controllers.  This is also usefulto test multiple device access and for loading the I/O sub-system..buForce I/O at different memory boundaries to test low level driverhandling.  Using the align option, you can set memory alignment fortesting specialized device driver DMA code.  This is very usefulwhen developing new I/O sub-systems..buDo loopback testing of parallel or serial lines on either the samesystem of different systems.  This is a useful compatibility testwhen running different machines running different operating systems..buEnable POSIX Asynchronous I/O to verify proper operation of this APIand to determine performance gains (over standard synchronous I/O).This is also useful for queuing multiple I/O requests to drivers andfor testing SCSI tag queuing and RAID configurations..buSpecify variable record options for testing variable tape devices..buOn Tru64 cluster systems, distributed lock manager (DLM) options canbe used to control access to shared devices or files..buAlso available on Tru64 UNIX is the ability to use Extended ErrorInformation (EEI) to detect and recover from SCSI bus/device resets(tape is repositioned for continuing the test)..LP.HS.nh 1 Program Options.This section describes program options and and special notes relatedto each.  The \fIdt\fP help file provides a summary of the options,and the default value of most options.  The \fIdt\fP help summaryfor Tru64 UNIX is shown in Appendix A..nh 2 Input File \&"\fIif=\fP\&" Option.This option specifies the input file to open for reads.  The device is openedread-only so devices which only permit or support read access, e.g., parallelinput devices, can be opened successfully..HSSpecial Notes:.buData read is automatically verified with the default data pattern, unlessyou disable this action via the "\fIdisable=compare\fP" option..buExtra pad bytes of sizeof(int), are allocated at the end of data buffers,initialized with the inverted data pattern, and then verified after eachread request to ensure the end of data buffers didn't get overwritten byfile system and/or device drivers.  This extra check has found problemswith flushing DMA FIFO's on several machines..LP.EX    Syntax:        if=filename      The input file to read..EE.nh 2 Output File \&"\fIof=\fP\&" Option.This option specifies the output file to open for writes.  After the writeportion of the test, the device is closed (to reposition to start of fileor to rewind the tape), re-opened, and then a read verification pass isperformed.  If you wish to prevent the read verify pass, you must specifythe "\fIdisable=verify\fP" option..HSSpecial Notes:.buTerminal devices are \fBnot\fP closed between passes so previously setterminal characteristics don't get reset.  This also caused a race conditionwhen doing loopback testing with two processes..buWhen testing terminal (serial) devices, modem control is disabled (via settingCLOCAL) to prevent tests from hanging.  If the "\fIenable=modem\fP" option isspecified, then CLOCAL is reset, hangup on close HUPCL is set, and testingwill not preceed until carrier or DSR is detected.  This code is not fullytested, but this description accurately describes the code..buAt the present time, tapes are rewound by closing the device, so you \fBmust\fPspecify the rewind device during testing if the read verify pass is beingperformed.  This restriction will probably change in the next release sincemagtape control commands will be supported (tape specific tests as well)..buA special check is made for the /dev/ prefix, and if located, the O_CREAT openflag is cleared to prevent accidently creating files in this directory when notspecifying the correct device name (very easy to do when running testsas super-user 'root')..buWhen writing to raw disks on Tru64 UNIX, if the disk was previously labeled,you must issue the "\fIdisklabel -z\fP" command to destroy the label blockor else you cannot write to this area of this disk (block 0).  Failure to dothis results in the error "Read-only file system" (errno=EROFS) being returnedon write requests..LP.EX    Syntax:        of=filename      The output file to write..EE.nh 2 Pattern File \&"\fIpf=\fP\&" Option.This option specifies a pattern file to use for the data pattern duringtesting.  This option overrides the "\fIpattern=\fP" option and allows youto specify specialized patterns.  The only restriction to this option isthat the entire file \fImust\fP fit in memory.  A buffer is allocated toread the entire pattern file into memory before testing starts so performanceis not affected by reading the pattern file..EX    Syntax:        pf=filename      The data pattern file to use..EE.nh 2 Block Size \&"\fIbs=\fP\&" Option.This option specifies the block size, in bytes, to use during testing.At the present time, this option sets both the input and output block sizes.At the time I originally wrote this program, I didn't have the need forseperate block sizes, but this may change in a future release where I'll addback the "\fIibs=\fP" & "\fIobs=\fP" options available with \fIdd\fP..HSSpecial Notes:.buWhen enabling variable length records via the "\fImin=\fP" option, thisalso sets the maximum record size to be written/read..buFor memory mapped files, the block size \fImust\fP be a multiple of thesystem dependent page size (normally 4k or 8k bytes)..LP.EX    Syntax:        bs=value         The block size to read/write..EE.nh 2 Log File \&"\fIlog=\fP\&" Option.This option specifies the log file to redirect all program output to.This is done by re-opening the standard error stream (stderr) to thespecifed log file.  Since all output from \fIdt\fP is directed to stderr,library functions such as perror() also write to this log file..HSSpecial Notes:.buA seperate buffer is allocated for the stderr stream, and this stream isset buffered so timing isn't affected by program output..buWhen starting multiple processes via the "\fIprocs=\fP" option, all outputis directed to the same log file.  The output from each process is identifiedby the process ID (PID) as part of the message (errors & statistics)..LP.EX    Syntax:        log=filename     The log file name to write..EE.nh 2 POSIX Asynchronous I/O \&"\fIaios=\fP\&" Option.This option enables and controls the number of POSIX Asychronous I/Orequests used by the program..HSSpecial Notes:.buThe default is to queue up to 8 requests..buThis option is only valid for Tru64 UNIX systems are this time..buThe system limit for AIO on Tru64 UNIX is dynamic, and can be queriedby using the "\fIsysconfig -q rt\fP" command..buYou can use the "\fIenable=aio\fP" option to enable AIO and use thedefault request limit..buAIO is only supported for character devices and is disabled for terminals.On Tru64 UNIX, you can alter the Makefile and link against libaio.a, whichallows AIO with any device/file by mimic'ing AIO using POSIX threads..buAIO requests can \fBnot\fP be cancelled on Tru64 UNIX, so queuing manyrequests to 1/2" tape devices will probably result in running off theend of the tape reel.  This is not a problem for cartridge tapes..LP.EX    Syntax:        aios=value       Set number of AIO's to queue..EE.nh 2 Buffer Alignment \&"\fIalign=\fP\&" Option.This option controls the alignment of the normally page aligned databuffer allocated.  This option is often useful for testing certain DMAboundary conditions not easily reproduced otherwise.  The rotate optionautomatically adjust the data buffer pointer by (0, 1, 2, 3, ...) foreach I/O request to ensure various boundaries are fully tested..EX    Syntax:        align=offset     Set offset within page aligned buffer.    or  align=rotate     Rotate data address through sizeof(ptr)..EE.nh 2 File Disposition \&"\fIdispose=\fP\&" Option.This option controls the disposition of test files created on file

⌨️ 快捷键说明

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