www.cons.org/cracauer/cstream.html
Links Search: (not public yet) cstream cstream is a general-purpose stream-handling tool like UNIX dd, usually used in commandline-constructed pipes. Timing variance in previous reads are counterbalanced in the following reads. Either at the end of the transmission or everytime SIGUSR1 is received. Reports are done in bytes/sec and if appropriate in KB/sec or MB/sec, where 1K = 1024. These special devices speed varies greatly among operating systems, redirecting from it isn't appropriate benchmarking and a waste of resources anyway. CD quality) 't' = tee - in addition to outfile, copy stream to fd 3 Multiple chars allowed -p <s> = Write pid as ascii integer to file <s> -l include line count in statistics -w <n> = Set write block size (-c 5 only) -S Don't output statistic on SIGINFO SIGINFO causes statistics to be written to stderr SIGUSR1 causes statistics to be written to stderr SIGUSR2 causes loop end after next buffer transfer <file> if -i has not been used, specifies input file Changes in recent versions: Fixed Solaris build problem. If input is just generated, a sine wave of 440 Hz will be played. Full manual page: cstream FreeBSD General Commands Manual cstream NAME cstream - direct data streams, with bandwidth limiting, FIFO, audio, du- plication and extended reporting support. SYNOPSIS cstream -b num -B num -i filename -I string -l -n num -o filename -O string -p filename -t num -v num -V filename DESCRIPTION Cstream filters data streams, much like the UNIX tool dd. It has a more traditional commandline syntax, support for precise bandwidth limit- ing and reporting and support for FIFOs. Data limits and throughput rate calculation will work for files > 4 GB. Cstream reads from the standard input and writes to the standard output, if no filenames are given. Options: -b num Set the block size used for read/write to num. It is an error to set this to anything below the blocksize. Useful when writing tapes and simlilar that prefer few large writes of many small. This is especially useful in combination with the -B option. In combination with a large buffer size this will often load your memory heavily, everytime the reader transfers the buffer it collected to the writer. If you use -c 3 and have a buffer size of 128 Megabytes 256 MB of memory will be touched at once. If the output file name is "-", data will just be discarded. If the input file name is "-", data will be generated 'out of the void'. If these options aren't given, stdin/stout will be used. If you need to give -o or -i options and want stdin/stdout, specify the empty string, like this: cstream -i'' If TCP support has been compiled in (default), hostname:port- number will try to connect to the specified host at the speci- fied port and :portnumber will open a TCP socket on the local machine and wait for a connection to arrive. SECURITY NOTE: cstream includes no mechanism to restrict the hosts that may connect to this port. Unless your machine has other network filters, anyone will be able to connect. If string includes 'a', the file will be assumed to be a opensound-com- patible audio device and will be switched to CD-like set- tings. If string includes 't', a copy of the stream will be sent to file de- scriptor 3. If there is more input available, it will be discarded, cstream will exit after the limit has been reached. If there is less input, the limit will not be reached and no error will be signaled. If cstream uses a seperate writer process (option -c), this is the pid of the parent (reader) process. Limiting is done at the input side, you can rely on cstream not to accept more than this rate. By default, it is set to 0, which means no messages are displayed as long as no errors occur. A value of 1 means that total amount of data and throughput will be displayed at the end of program run. A value of 2 means the transfer rate since the end of the first read/write pair will also be reported (useful when there is an initial delay). A value of 3 means there will also be seperate measurements for read and write. This option is resource-consuming and currently isn't implemented. A value of 4 means that notices about each single read/write will be displayed. SIGUSR1 SIGINFO Sending SIGUSR1 (or SIGINFO, which is usually mappend to Con- trol-T on you keyboard) to cstream causes it to display throughput rates to stderr. SIGHUP I found myself sending SIGHUP accidentially too often. But ig- noring or misusing SIGHUP is not an option for me. Thus, when cstream received SIGHUP, it will wait 5 seconds for another SIGHUP, to give users a chance to correct a possible mistake. If no additional SIGHUP is received, cstream kills itself with SIGHUP. EXAMPLES cstream -o tmpfile -v 1 -n 384m -i - Writes 384 Megabytes of unspecified data to file tmpfile and dis- play verbose throughput rate. Makes a good benchmark, the speed of /dev/null varies too much from system to system. Each time the signal is sent, the throughput and data rate so far will be displayed. This obviously doesn't work when the application tries to write data using mmap and the application has to ignore errors when it tries to set soundcard parameters using ioctl. Exit code 2 means other errors, especially system errors. Bugs There should be an option to begin writing directly after the first read ended and then fill the buffer with reads in the background. Right now writing will not begin before the reader has filled the buffer completely for the first time. SEE ALSO dd, mkfifo HISTORY cstream was initially written by Martin Cracauer in 1998.
|