Whamcloud - gitweb
Support for running multiple threads with a single command. This adds
authoradilger <adilger>
Wed, 10 Apr 2002 04:48:27 +0000 (04:48 +0000)
committeradilger <adilger>
Wed, 10 Apr 2002 04:48:27 +0000 (04:48 +0000)
commit782fbbb98fd6fde6415293d323741e8341362756
tree67f47317171e6de64423900de74afb989a6df3dd
parent05c3150e7c1852daf764d8ff8b2e2b546aa2e10a
Support for running multiple threads with a single command.  This adds
the "--threads" parameter, which takes as arguments the number of threads
to fork, the device number, and the command (and optional arguments) to run.
Usage is similar to the "--device" command, with an additional argument.
("--threads 1 X <foo>" does about the same thing as "--device X <foo>").

Usage example:

# tests/llecho.sh

# utils/obdctl --threads 5 2 test_getattr 5000 q
--threads: starting 5 threads on device 2 running test_getattr
--threads: thread 1 (PID 6029) started
--threads: thread 2 (PID 6030) started
test_getattr-1: 5000 attrs (testing only): Tue Apr  9 22:45:25 2002
test_getattr-2: 5000 attrs (testing only): Tue Apr  9 22:45:25 2002
test_getattr-3: 5000 attrs (testing only): Tue Apr  9 22:45:25 2002
--threads: thread 3 (PID 6031) started
--threads: thread 4 (PID 6032) started
--threads: thread 5 (PID 6033) started
test_getattr-5: 5000 attrs (testing only): Tue Apr  9 22:45:25 2002
test_getattr-4: 5000 attrs (testing only): Tue Apr  9 22:45:25 2002
test_getattr-2: 5000 attrs in 17.24s (290.1 attr/s): Tue Apr  9 22:45:42 2002
test_getattr-3: 5000 attrs in 17.26s (289.7 attr/s): Tue Apr  9 22:45:42 2002
test_getattr-1: 5000 attrs in 17.29s (289.2 attr/s): Tue Apr  9 22:45:42 2002
test_getattr-4: 5000 attrs in 17.26s (289.8 attr/s): Tue Apr  9 22:45:42 2002
test_getattr-5: 5000 attrs in 17.31s (288.9 attr/s): Tue Apr  9 22:45:42 2002

# utils/obdctl --threads 5 2 test_brw 5000 w q
--threads: starting 5 threads on device 2 running test_brw
--threads: thread 1 (PID 5997) started
--threads: thread 2 (PID 5998) started
test_brw-2: reading 5000 (1x1 pages) (testing only): Tue Apr 9 22:37:28 2002
test_brw-1: reading 5000 (1x1 pages) (testing only): Tue Apr 9 22:37:28 2002
--threads: thread 3 (PID 5999) started
--threads: thread 4 (PID 6000) started
test_brw-3: reading 5000 (1x1 pages) (testing only): Tue Apr 9 22:37:28 2002
--threads: thread 5 (PID 6001) started
test_brw-4: reading 5000 (1x1 pages) (testing only): Tue Apr 9 22:37:28 2002
test_brw-5: reading 5000 (1x1 pages) (testing only): Tue Apr 9 22:37:28 2002
test_brw-1: read 1x1x5000 pages in 32.7s (152.9 pg/s): Tue Apr 9 22:38:01 2002
test_brw-2: read 1x1x5000 pages in 32.73s (152.8 pg/s): Tue Apr 9 22:38:01 2002
test_brw-3: read 1x1x5000 pages in 32.73s (152.8 pg/s): Tue Apr 9 22:38:01 2002
test_brw-4: read 1x1x5000 pages in 32.72s (152.8 pg/s): Tue Apr 9 22:38:01 2002
test_brw-5: read 1x1x5000 pages in 32.72s (152.8 pg/s): Tue Apr 9 22:38:01 2002

The first example runs 5 threads doing 5000 test_getattrs on device 2.
The second example runs 5 threads doing 5000 test_brw writes on device 2.

All output is prepended with the command and thread number which is running
that command, like "test_getattr-1", "test_getattr-2", etc.  This is done
via the "cmdline()" helper function, which should now be used at all times
for obdctl output instead of "argv[0]".  If we are not running with threads,
cmdline("foo") degenerates to just "foo".
lustre/utils/obdctl.c