diff options
| author | Ruslan Ermilov <ru@FreeBSD.org> | 2001-08-17 15:43:08 +0000 |
|---|---|---|
| committer | Ruslan Ermilov <ru@FreeBSD.org> | 2001-08-17 15:43:08 +0000 |
| commit | a8510bf414fba1220ac5eaee5b652a5813ca34ec (patch) | |
| tree | ef163d34be4ccad56680ff5d91213c75f0a6d031 /lib/libdevstat | |
| parent | 5b18d15e79836756585ab7bebd017dbe7e4c2a4d (diff) | |
Notes
Diffstat (limited to 'lib/libdevstat')
| -rw-r--r-- | lib/libdevstat/devstat.3 | 98 |
1 files changed, 54 insertions, 44 deletions
diff --git a/lib/libdevstat/devstat.3 b/lib/libdevstat/devstat.3 index ff030a47a574..9e804d65013f 100644 --- a/lib/libdevstat/devstat.3 +++ b/lib/libdevstat/devstat.3 @@ -29,7 +29,7 @@ .\" .Dd May 21, 1998 .Dt DEVSTAT 3 -.Os FreeBSD +.Os .Sh NAME .Nm devstat , .Nm getnumdevs , @@ -123,16 +123,17 @@ returns the current kernel version. .Pp .Fn checkversion -checks the userland devstat version against the kernel devstat version. If -the two are identical, it returns zero. Otherwise, it prints an -appropriate error in +checks the userland devstat version against the kernel devstat version. +If the two are identical, it returns zero. +Otherwise, it prints an appropriate error in .Va devstat_errbuf and returns -1. .Pp .Fn getdevs fetches the current list of devices and statistics into the supplied .Va statinfo -structure. The +structure. +The .Va statinfo structure can be found in .Aq Pa devstat.h : @@ -177,11 +178,11 @@ variable contains an array of .Nm structures, but at the head of the array is the current .Nm -generation. The reason the generation is at the head of the buffer is so -that userland software accessing the devstat statistics information can -atomically get both the statistics information and the corresponding -generation number. If client software were forced to get the generation -number via a separate +generation. +The reason the generation is at the head of the buffer is so that userland +software accessing the devstat statistics information can atomically get +both the statistics information and the corresponding generation number. +If client software were forced to get the generation number via a separate .Nm sysctl variable (which is available for convenience), the list of devices could change between the time the client gets the generation and the time the @@ -200,7 +201,8 @@ structure is basically a pointer to the beginning of the array of devstat structures from the .Va kern.devstat.all .Nm sysctl -variable. The generation subelement of the +variable. +The generation subelement of the .Va devinfo structure contains the generation number from the .Va kern.devstat.all @@ -219,8 +221,8 @@ subsystem. selects devices to display based upon a number of criteria: .Bl -tag -width flag .It specified devices -Specified devices are the first selection priority. These are generally -devices specified by name by the user. e.g. da0, da1, cd0. +Specified devices are the first selection priority. +These are generally devices specified by name by the user e.g. da0, da1, cd0. .It match patterns These are pattern matching expressions generated by .Fn buildmatch @@ -234,15 +236,16 @@ structure passed in to .Fn selectdevs . The .Va bytes -value currently must be maintained by the user. In the future, -this may be done for him in a +value currently must be maintained by the user. +In the future, this may be done for him in a .Nm library routine. If no devices have been selected by name or by pattern, the performance tracking code will select every device in the system, and sort them by -performance. If devices have been selected by name or pattern, the -performance tracking code will honor those selections and will only sort -among the selected devices. +performance. +If devices have been selected by name or pattern, the performance tracking +code will honor those selections and will only sort among the selected +devices. .It order in the devstat list If the selection mode is set to DS_SELECT_ADD, and if there are still less than @@ -274,30 +277,30 @@ by name or by matching pattern. .It DS_SELECT_REMOVE In remove mode, .Fn selectdevs -will remove devices specified by name or by matching pattern. It will not -select any additional devices. +will remove devices specified by name or by matching pattern. +It will not select any additional devices. .It DS_SELECT_ADDONLY In add only mode, .Fn selectdevs will select any unselected devices specified by name or matching pattern. -In this respect it is identical to add mode. It will not, however, select -any devices other than those specified. +In this respect it is identical to add mode. +It will not, however, select any devices other than those specified. .El .Pp In all selection modes, .Fn selectdevs will not select any more than .Va maxshowdevs -devices. One exception to -this is when you are in +devices. +One exception to this is when you are in .Dq top -mode and no devices have been selected. In -this case, +mode and no devices have been selected. +In this case, .Fn selectdevs -will select every device in the system. Client programs must pay attention -to selection order when deciding whether to pay attention to a particular -device. This may be the wrong behavior, and probably requires additional -thought. +will select every device in the system. +Client programs must pay attention to selection order when deciding whether +to pay attention to a particular device. +This may be the wrong behavior, and probably requires additional thought. .Pp .Fn selectdevs handles allocation and resizing of the @@ -312,7 +315,8 @@ and fields to track the current .Nm -generation and number of devices. If +generation and number of devices. +If .Va num_selections is not the same as @@ -388,21 +392,23 @@ Passthrough devices .El .Pp .Fn compute_stats -provides an easy way to obtain various device statistics. Only two -arguments are mandatory: +provides an easy way to obtain various device statistics. +Only two arguments are mandatory: .Va current and .Va etime . -Every other argument is optional. For most applications, the user will -want to supply both +Every other argument is optional. +For most applications, the user will want to supply both .Va current and .Va previous devstat structures so that statistics may be calculated over a given period -of time. In some instances, for instance when calculating statistics since -system boot, the user may pass in a NULL pointer for the +of time. +In some instances, for instance when calculating statistics since system boot, +the user may pass in a NULL pointer for the .Va previous -argument. In that case, +argument. +In that case, .Fn compute_stats will use the total stats in the .Va current @@ -437,7 +443,8 @@ is NULL, the result will be the total number of transactions listed in .It total_blocks This is basically .Va total_bytes -divided by the device blocksize. If the device blocksize is listed as +divided by the device blocksize. +If the device blocksize is listed as .Sq 0 , the device blocksize will default to 512 bytes. .It kb_per_transfer @@ -448,7 +455,8 @@ This is the average number of transfers per second. .It mb_per_second This is average megabytes per second. .It blocks_per_second -This is average blocks per second. If the device blocksize is +This is average blocks per second. +If the device blocksize is .Sq 0 , a default blocksize of 512 bytes will be used instead. .It ms_per_transaction @@ -458,8 +466,8 @@ The average number of milliseconds per transaction. .Fn compute_etime provides an easy way to find the difference in seconds between two .Va timeval -structures. This is most commonly used in conjunction with the time -recorded by the +structures. +This is most commonly used in conjunction with the time recorded by the .Fn getdevs function (in struct .Va statinfo ) @@ -477,13 +485,15 @@ fetching the variable. .Fn checkversion returns 0 if the kernel and userland .Nm -versions match. If they do not match, it returns -1. +versions match. +If they do not match, it returns -1. .Pp .Fn getdevs and .Fn selectdevs return -1 in case of an error, 0 if there is no error and 1 if the device -list or selected devices have changed. A return value of 1 from +list or selected devices have changed. +A return value of 1 from .Fn getdevs is usually a hint to re-run .Fn selectdevs |
