Hi Mads,
        I posted this awhile ago...

        I've written a program named 'dt' (Data Test Program), which does
data verification, and reports disk throughput.  You can find this @ URL:

                http://www.bit-net.com/~rmiller/dt.html

        I've attached a copy of the help text, but the kit also contains
a Postscript User's Manual with examples in the appendices.  The basic 'dt'
commands are very similar to the 'dd' program.

        Until Linux has character (raw) disk devices, you can use dt's open
flags to bypass the buffer cache.  Although O_DIRECT is defined in fcntl.h,
this functionality is not implemented in the 2.2.14-5.0 kernel (RH 6.2)
that I'm using.  I think O_SYNC, dt's flags=sync, will do the trick.

        You can also find a SCSI Command Utility 'scu', @ URL:

                http://www.bit-net.com/~rmiller/scu.html

        Sorry, Compaq hasn't given me permission to release the Scu source.
I wrote this program for Tru64 Unix, and as such is owned by our Unix group.
My first meeting with the Compaq "Open Source" Forum has occurred, but there
are issues which need resolved.

Enjoy,
Robin
================================================================================

linux% dt help
Usage: dt options...

    Where options are:
        if=filename      The input file to read.
        of=filename      The output file to write.
        pf=filename      The data pattern file to use.
        bs=value         The block size to read/write.
        log=filename     The log file name to write.
        align=offset     Set offset within page aligned buffer.
    or  align=rotate     Rotate data address through sizeof(ptr).
        dispose=mode     Set file dispose to: {delete or keep}.
        dlimit=value     Set the dump data buffer limit.
        dtype=string     Set the device type being tested.
        idtype=string    Set input device type being tested.
        odtype=string    Set output device type being tested.
        errors=value     The number of errors to tolerate.
        files=value      Set number of tape files to process.
        flow=type        Set flow to: none, cts_rts, or xon_xoff.
        incr=value       Set number of record bytes to increment.
        iomode=mode      Set I/O mode to: {copy, test, or verify}.
        iotype=type      Set I/O type to: {random or sequential}.
        min=value        Set the minumum record size to transfer.
        max=value        Set the maximum record size to transfer.
        lba=value        Set starting block used w/lbdata option.
        lbs=value        Set logical block size for lbdata option.
        limit=value      The number of bytes to transfer.
        flags=flags      Set open flags:   {excl,sync,...}
        oflags=flags     Set output flags: {append,trunc,...}
        oncerr=action    Set child error action: {abort or continue}.
        parity=string    Set parity to: {even, odd, or none}.
        passes=value     The number of passes to perform.
        pattern=value    The 32 bit hex data pattern to use.
    or  pattern=iot      Use DJ's IOT test pattern.
    or  pattern=incr     Use an incrementing data pattern.
    or  pattern=string   The string to use for the data pattern.
        position=offset  Position to offset before testing.
        procs=value      The number of processes to create.
        ralign=value     The random I/O offset alignment.
        rlimit=value     The random I/O data byte limit.
        records=value    The number of records to process.
        runtime=time     The number of seconds to execute.
        skip=value       The number of records to skip past.
        seek=value       The number of records to seek past.
        step=value       The number of bytes seeked after I/O.
        speed=value      The tty speed (baud rate) to use.
        timeout=value    The tty read timeout in .10 seconds.
        ttymin=value     The tty read minimum count (sets vmin).
        enable=flag      Enable one or more of the flags below.
        disable=flag     Disable one or more of the flags below.

    Flags to enable/disable:
        compare          Data comparison.       (Default: enabled)
        coredump         Core dump on errors.   (Default: disabled)
        debug            Debug output.          (Default: disabled)
        Debug            Verbose debug output.  (Default: disabled)
        rdebug           Random debug output.   (Default: disabled)
        dump             Dump data buffer.      (Default: enabled)
        flush            Flush tty I/O queues.  (Default: enabled)
        header           Log file header.       (Default: enabled)
        lbdata           Logical block data.    (Default: disabled)
        loopback         Loopback mode.         (Default: disabled)
        microdelay       Microsecond delays.    (Default: disabled)
        mmap             Memory mapped I/O.     (Default: disabled)
        modem            Test modem tty lines.  (Default: disabled)
        multi            Multiple volumes.      (Default: disabled)
        pstats           Per pass statistics.   (Default: enabled)
        raw              Read after write.      (Default: disabled)
        stats            Display statistics.    (Default: enabled)
        ttyport          Flag device as a tty.  (Default: disabled)
        verbose          Verbose output.        (Default: enabled)
        verify           Verify data written.   (Default: enabled)

        Example: enable=debug disable=compare,pstats

    Common Open Flags:
        excl (O_EXCL)         Exclusive open. (don't share)
        ndelay (O_NDELAY)     Non-delay open. (don't block)
        nonblock (O_NONBLOCK) Non-blocking open/read/write.
        direct (O_DIRECT)     Direct disk access. (don't cache data).
        fsync (O_FSYNC)       Sync both read/write data with disk file.
        rsync (O_RSYNC)       Synchronize read operations.
        sync (O_SYNC)         Sync updates for data/file attributes.
        large (O_LARGEFILE)   Enable large (64-bit) file system support.

    Output Open Flags:
        append (O_APPEND)     Append data to end of existing file.
        dsync (O_DSYNC)       Sync data to disk during write operations.
        trunc (O_TRUNC)       Truncate an exisiting file before writing.

    Delays (Values are seconds, unless microdelay enabled):
        cdelay=value     Delay before closing the file.    (Def: 0)
        edelay=value     Delay between multiple passes.    (Def: 0)
        rdelay=value     Delay before reading each record. (Def: 0)
        sdelay=value     Delay before starting the test.   (Def: 0)
        tdelay=value     Delay before child terminates.    (Def: 1)
        wdelay=value     Delay before writing each record. (Def: 0)

    Numeric Input:
        For options accepting numeric input, the string may contain any
        combination of the following characters:

        Special Characters:
            w = words (4 bytes)            q = quadwords (8 bytes)
            b = blocks (512 bytes)         k = kilobytes (1024 bytes)
            m = megabytes (1048576 bytes)  p = page size (4096 bytes)
            g = gigabytes (1073741824 bytes)
            t = terabytes (1099511627776 bytes)
            inf or INF = infinity (18446744073709551615 bytes)

        Arithmetic Characters:
            + = addition                   - = subtraction
            * or x = multiplcation         / = division
            % = remainder

        Bitwise Characters:
            ~ = complement of value       >> = shift bits right
           << = shift bits left            & = bitwise 'and' operation
            | = bitwise 'or' operation     ^ = bitwise exclusive 'or'

        The default base for numeric input is decimal, but you can override
        this default by specifying 0x or 0X for hexadecimal conversions, or
        a leading zero '0' for octal conversions.  NOTE: Evaluation is from
        right to left without precedence, and parenthesis are not permitted.

    Pattern String Input:
            \\ = Backslash   \a = Alert (bell)   \b = Backspace
            \f = Formfeed    \n = Newline        \r = Carriage Return
            \t = Tab         \v = Vertical Tab   \e or \E = Escape
            \ddd = Octal Value    \xdd or \Xdd = Hexadecimal Value

    Time Input:
            d = days (86400 seconds),      h = hours (3600 seconds)
            m = minutes (60 seconds),      s = seconds (the default)

        Arithmetic characters are permitted, and implicit addition is
        performed on strings of the form '1d5h10m30s'.

    Defaults:
        errors=1, files=0, passes=1, records=0, bs=512, log=stderr
        pattern=0x39c39c39, flow=xon_xoff, parity=none, speed=9600
        timeout=3 seconds, dispose=delete, align=0 (page aligned)
        dlimit=64, oncerr=continue, iomode=test, iotype=sequential

    --> Date: May 9th, 2000, Version: 13.17, Author: Robin T. Miller <--
linux% 
linux% scu show edt

Equipment Device Table (EDT) Information:

    Bus/Target/Lun Device Type  ANSI  Vendor ID    Product ID    Revision N/W
    -------------- ----------- ------ --------- ---------------- -------- ---
/dev/sda /dev/sga
     0    0    0   Direct      SCSI-2 COMPAQ    DDRS-39130W        S99C    W
/dev/nst0 /dev/sgb
     0    3    0   Sequential  SCSI-2 HP        C1557A             U709    N
/dev/sdb /dev/sgc
     1    1    0   Direct      SCSI-2 DEC       RZ28D    (C) DEC   0006    N
/dev/sdc /dev/sgd
     1    2    0   Direct      SCSI-2 DEC       RZ26J    (C) DEC   589T    N

linux% 
linux% dt of=/dev/sdb bs=32k limit=100m pattern=iot flags=sync              

Write Statistics:
     Total records processed: 3200 @ 32768 bytes/record (32.000 Kbytes)
     Total bytes transferred: 104857600 (102400.000 Kbytes, 100.000 Mbytes)
      Average transfer rates: 5469880 bytes/sec, 5341.680 Kbytes/sec
     Number I/O's per second: 166.927
      Total passes completed: 0/1
       Total errors detected: 0/1
          Total elapsed time: 00m19.17s
           Total system time: 00m00.66s
             Total user time: 00m03.67s

Read Statistics:
     Total records processed: 3200 @ 32768 bytes/record (32.000 Kbytes)
     Total bytes transferred: 104857600 (102400.000 Kbytes, 100.000 Mbytes)
      Average transfer rates: 7463174 bytes/sec, 7288.256 Kbytes/sec
     Number I/O's per second: 227.758
      Total passes completed: 1/1
       Total errors detected: 0/1
          Total elapsed time: 00m14.05s
           Total system time: 00m00.65s
             Total user time: 00m13.39s

Total Statistics:
     Output device/file name: /dev/sdb (device type=disk)
     Type of I/O's performed: sequential
    Data pattern string used: 'IOT Pattern'
     Total records processed: 6400 @ 32768 bytes/record (32.000 Kbytes)
     Total bytes transferred: 209715200 (204800.000 Kbytes, 200.000 Mbytes)
      Average transfer rates: 6312920 bytes/sec, 6164.961 Kbytes/sec
     Number I/O's per second: 192.655
      Total passes completed: 1/1
       Total errors detected: 0/1
          Total elapsed time: 00m33.22s
           Total system time: 00m01.31s
             Total user time: 00m17.06s
               Starting time: Thu Jul 13 15:38:37 2000
                 Ending time: Thu Jul 13 15:39:10 2000

linux% 

Mads Bondo Dydensborg wrote:
> 
> On Thu, 13 Jul 2000, Brian Pomerantz wrote:
> 
> > On Thu, Jul 13, 2000 at 11:40:20AM +0200, Mads Bondo Dydensborg wrote:
> > > Hi there - a couple of questions I hope you will help me with
> > >
> > > I have made some modifications to a scsi driver, and need to benchmark
> > > it. I know about bonnie, but I was wondering if there where other relevant
> > > benchmarking utilities?
> > >
> > > Is there a way to flush the buffer cache? Right now I reboot to make sure
> > > I read from the disk, but that is kinda annoying.
> > >
> > > Also, are there any "correctness" tests? I have a disk connected to the
> > > SCSI controller and would like to be sure that I handle all the
> > > "neccesary" SCSI commands.
> > >
> >
> > Using a raw device is a good way to get true numbers for your device.
> > Even a 'time dd if=/dev/raw1 of=/dev/null' style test can give pretty
> > good results
> 
> I did that, unfortunatly I got this :
> 
> [root@sci10 linux-2.2.13]# time dd if=/dev/sdb of=/dev/null bs=1024k
> count=50
> 50+0 records in
> 50+0 records out
> 0.00user 0.93system 0:10.72elapsed 8%CPU (0avgtext+0avgdata 0maxresident)k
> 0inputs+0outputs (124major+268minor)pagefaults 0swaps
> [root@sci10 linux-2.2.13]# time dd if=/dev/sdb of=/dev/null bs=1024k
> count=50
> 50+0 records in
> 50+0 records out
> 0.01user 0.62system 0:04.20elapsed 15%CPU (0avgtext+0avgdata
> 0maxresident)k
> 0inputs+0outputs (83major+268minor)pagefaults 0swaps
> 
> The 2. run is more then twice as fast. Obviously there must be some
> buffering still taking place?
> 
> Mads
> 
> P.S. Yes, this is old/slow hardware.
> 
> --
> Mads Bondo Dydensborg.                               [EMAIL PROTECTED]
> UNIX always presumes you know what you're doing. You're the human being,
> after all, and it is a mere operating system.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to