Print this page
mandoc -Tlint fixes
Describe KSTAT_DATA_TIME.

*** 1,146 **** ! '\" te .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] ! .TH KSTAT_NAMED_INIT 9F "Feb 29, 2008" ! .SH NAME ! kstat_named_init, kstat_named_setstr \- initialize a named kstat ! .SH SYNOPSIS ! .LP ! .nf ! #include <sys/types.h> ! #include <sys/kstat.h> ! ! ! ! \fBvoid\fR \fBkstat_named_init\fR(\fBkstat_named_t *\fR\fIknp\fR, \fBconst char *\fR\fIname\fR, ! \fBuchar_t\fR \fIdata_type\fR); ! .fi ! ! .LP ! .nf ! \fBvoid\fR \fBkstat_named_setstr\fR(\fBkstat_named_t *\fR\fIknp\fR, \fBconst char *\fR\fIstr\fR); ! .fi ! ! .SH INTERFACE LEVEL ! .LP Solaris DDI specific (Solaris DDI) ! .SH PARAMETERS ! .ne 2 ! .na ! \fB\fIknp\fR\fR ! .ad ! .RS 13n ! Pointer to a \fBkstat_named\fR(9S) structure. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fIname\fR\fR ! .ad ! .RS 13n The name of the statistic. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fIdata_type\fR\fR ! .ad ! .RS 13n ! The type of value. This indicates which field of the \fBkstat_named\fR(9S) structure should be used. Valid values are: ! .sp ! .ne 2 ! .na ! \fB\fBKSTAT_DATA_CHAR\fR\fR ! .ad ! .RS 24n ! The "\fBchar\fR" field. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fBKSTAT_DATA_LONG\fR\fR ! .ad ! .RS 24n ! The "\fBlong\fR" field. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fBKSTAT_DATA_ULONG\fR\fR ! .ad ! .RS 24n ! The "\fBunsigned long\fR" field. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fBKSTAT_DATA_LONGLONG\fR\fR ! .ad ! .RS 24n ! Obsolete. Use \fBKSTAT_DATA_INT64\fR. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fBKSTAT_DATA_ULONGLONG\fR\fR ! .ad ! .RS 24n ! Obsolete. Use \fBKSTAT_DATA_UINT64\fR. ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fBKSTAT_DATA_STRING\fR\fR ! .ad ! .RS 24n ! Arbitrary length "\fBlong string\fR" field. ! .RE ! ! .RE ! ! .sp ! .ne 2 ! .na ! \fB\fIstr\fR\fR ! .ad ! .RS 13n ! Pointer to a \fBNULL\fR-terminated string. ! .RE ! ! .SH DESCRIPTION ! .LP ! \fBkstat_named_init()\fR associates a name and a type with a ! \fBkstat_named\fR(9S) structure. ! .sp ! .LP ! \fBkstat_named_setstr()\fR associates \fIstr\fR with the named kstat \fBknp\fR. ! It is an error for \fBknp\fR to be of type other than \fBKSTAT_DATA_STRING\fR. The string argument must remain valid even after the function that is calling ! \fBkstat_named_setstr()\fR is returned. If \fBKSTAT_DATA_STRING\fR is used in a persistent kstat the string argument must remain valid even after the module ! that created the kstat is unloaded. This is the only supported method of changing ! the value of long strings. ! .SH RETURN VALUES ! .LP None. ! .SH CONTEXT ! .LP ! \fBkstat_named_init()\fR and \fBkstat_named_setstr()\fR can be called from user ! or kernel context. ! .SH SEE ALSO ! .LP ! \fBkstat_create\fR(9F), \fBkstat_install\fR(9F), \fBkstat\fR(9S), ! \fBkstat_named\fR(9S) ! .sp ! .LP ! \fIWriting Device Drivers\fR --- 1,116 ---- ! .\" Copyright 2016 Garrett D'Amore .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] ! .Dd Jan 27, 2016 ! .Dt KSTAT_NAMED_INIT 9F ! .Os ! .Sh NAME ! .Nm kstat_named_init ! .Nm kstat_named_setstr ! .Nd initialize a named kstat ! .Sh SYNOPSIS ! .Hf <sys/types.h> ! .br ! .Hf <sys/kstat.h> ! .Lp ! .Ft void ! .Fo kstat_named_init ! .Fa "kstat_named_t *knp" ! .Fa "const char *name" ! .Fa "uchar_t data_type" ! .Fc ! .Lp ! .Ft void ! .Fo kstat_named_setstr ! .Fa "kstat_named_t *knp" ! .Fa "const char *str" ! .Fc ! .Sh INTERFACE LEVEL Solaris DDI specific (Solaris DDI) ! .Sh PARAMETERS ! .Bl -tag -width Ds ! .It Fa knp ! Pointer to a ! .Xr kstat_named 9S ! structure. ! .It Fa name The name of the statistic. ! .It Fa data_type ! The type of value. This indicates which field of the ! .Xr kstat_named 9S structure should be used. Valid values are: ! .Bl -tag -width Ds ! .It Sy KSTAT_DATA_CHAR ! The "char" field. ! . ! .It Sy KSTAT_DATA_LONG ! The "long" field. ! . ! .It Sy KSTAT_DATA_ULONG ! The "unsigned long" field. ! . ! .It Sy KSTAT_DATA_LONGLONG ! Obsolete. Use ! .Sy KSTAT_DATA_INT64 . ! . ! .It Sy KSTAT_DATA_ULONGLONG ! Obsolete. Use ! .Sy KSTAT_DATA_UINT64 . ! . ! .It Sy KSTAT_DATA_STRING ! Arbitrary length "long string" field. ! . ! .It Sy KSTAT_DATA_TIME ! The high resolution time stamp field. Note that this should only be used ! for absolute time stamps, such as returned by ! .Xr gethrtime 9F , ! and not for relative durations. For relative durations, ! .Sy KSTAT_DATA_UINT64 ! is preferred. ! .El ! .It Fa str ! Pointer to a ! .Sy NULL- Ns No terminated ! string. ! .El ! .Sh DESCRIPTION ! .Fn kstat_named_init ! associates a name and a type with a ! .Xr kstat_named 9S ! structure. ! .Lp ! .Fn kstat_named_setstr ! associates ! .Fa str ! with the named kstat ! .Fa knp . ! It is an error for ! .Fa knp ! to be of type other than ! .Sy KSTAT_DATA_STRING . The string argument must remain valid even after the function that is calling ! .Fn kstat_named_setstr ! is returned. If ! .Sy KSTAT_DATA_STRING ! is used in a persistent kstat the string argument must remain valid even after the module ! that created the kstat is unloaded. ! This is the only supported method of changing the value of long strings. ! .Sh CONTEXT ! .Fn kstat_named_init ! and ! .Fn kstat_named_setstr ! can be called from user or kernel context. ! .Sh RETURN VALUES None. ! .Sh SEE ALSO ! .Xr gethrtime 9F , ! .Xr kstat_create 9F , ! .Xr kstat_install 9F , ! .Xr kstat 9S , ! .Xr kstat_named 9S ! .Rs ! .%B Writing Device Drivers ! .Re