Date: Tue, 09 Aug 2011 16:01:50 +0000 From: oleksandr@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r224978 - soc2011/oleksandr/oleksandr-head/head/share/man/man9 Message-ID: <20110809160150.5A471106566B@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: oleksandr Date: Tue Aug 9 16:01:50 2011 New Revision: 224978 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=224978 Log: man for devstat(9) Modified: soc2011/oleksandr/oleksandr-head/head/share/man/man9/devstat.9 Modified: soc2011/oleksandr/oleksandr-head/head/share/man/man9/devstat.9 ============================================================================== --- soc2011/oleksandr/oleksandr-head/head/share/man/man9/devstat.9 Tue Aug 9 15:47:54 2011 (r224977) +++ soc2011/oleksandr/oleksandr-head/head/share/man/man9/devstat.9 Tue Aug 9 16:01:50 2011 (r224978) @@ -33,10 +33,12 @@ .Sh NAME .Nm devstat , .Nm devstat_add_entry , +.Nm devstat_search , .Nm devstat_end_transaction , .Nm devstat_end_transaction_bio , .Nm devstat_remove_entry , -.Nm devstat_start_transaction +.Nm devstat_start_transaction , +.Nm devstat_add_error .Nd kernel interface for keeping device statistics .Sh SYNOPSIS .In sys/devicestat.h @@ -53,6 +55,11 @@ .Ft void .Fn devstat_remove_entry "struct devstat *ds" .Ft void +.Fo devstat_search +.Fa "const char *dev_name" +.Fa "u_int32_t unit_number" +.Fc +.Ft void .Fn devstat_start_transaction "struct devstat *ds" .Ft void .Fo devstat_end_transaction @@ -66,6 +73,11 @@ .Fa "struct devstat *ds" .Fa "struct bio *bp" .Fc +.Ft void +.Fo devstat_add_error +.Fa "struct devstat *ds" +.Fa "devstat_error_flags error_flag" +.Fc .Sh DESCRIPTION The devstat subsystem is an interface for recording device statistics, as its name implies. @@ -132,6 +144,20 @@ .Nm generation number is incremented and the number of devices is decremented. .Pp +.Fn devstat_search +search appropriate device in +.Nm +subsystem. +It takes two arguments: +.Bl -tag -width unit_number +.It dev_name +Device name in +.Nm +structure. +.It unit_number +The unit number identifies the particular instance of the peripheral driver. +.El +.Pp .Fn devstat_start_transaction registers the start of a transaction with the .Nm @@ -170,6 +196,19 @@ .Va "struct bio" which is ready for biodone(). .Pp +.Fn devstat_add_error +is a function for increasing counters of errros. +This function takes several arguments: +.Bl -tag -width error_flag +.It ds +The +.Va devstat +structure, where is changing counter. +.It error_flag +Types of errors that recorded in +.Va devstat. +.El +.Pp The .Va devstat structure is composed of the following fields: @@ -201,6 +240,8 @@ .It unit_number The unit number identifies the particular instance of the peripheral driver in question. +.It dev_error +Disk error structure. Fields of this structure contains appropriate disk errors. .It bytes_written This is the number of bytes that have been written to the device. This number is currently an unsigned 64 bit integer. @@ -347,6 +388,30 @@ } devstat_priority; .Ed .Pp +Statistics of disk errors determined by the following parameters: +.Bd -literal -offset indent +typedef enum { + DEVSTAT_ERROR_RETRIABLE = 0x01, + DEVSTAT_ERROR_NON_RETRIABLE = 0x02, + DEVSTAT_ERROR_READ_ERROR = 0x04, + DEVSTAT_ERROR_WRITE_ERROR = 0x08, + DEVSTAT_ERROR_OTHER_ERROR = 0x10 +} devstat_error_flags; +.Ed +.Pp +The number of disk errors recorded in the field of the structure +.Nm devstat_device_error. +It looks: +.Bd -literal -offset indent +typedef enum { + int retriable; + int non_retriable; + int read_error; + int write_error; + int other_error; +} devstat_device_error; +.Ed +.Pp Each device has associated with it flags to indicate what operations are supported or not supported. The
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110809160150.5A471106566B>