Print this page
mandoc -Tlint fixes
Describe KSTAT_DATA_TIME.
   1 KSTAT_NAMED_INIT(9F)     Kernel Functions for Drivers     KSTAT_NAMED_INIT(9F)
   2 
   3 
   4 
   5 NAME
   6        kstat_named_init, kstat_named_setstr - initialize a named kstat
   7 
   8 SYNOPSIS
   9        #include <sys/types.h>
  10        #include <sys/kstat.h>
  11 
  12 
  13 
  14        void kstat_named_init(kstat_named_t *knp, const char *name,
  15             uchar_t data_type);
  16 


  17 
  18        void kstat_named_setstr(kstat_named_t *knp, const char *str);
  19 
  20 
  21 INTERFACE LEVEL
  22        Solaris DDI specific (Solaris DDI)
  23 
  24 PARAMETERS
  25        knp
  26                     Pointer to a kstat_named(9S) structure.
  27 

  28 
  29        name
  30                     The name of the statistic.
  31 
  32 
  33        data_type
  34                     The type of value. This indicates which field of the
  35                     kstat_named(9S) structure should be used. Valid values
  36                     are:
  37 
  38                     KSTAT_DATA_CHAR
  39                                             The "char" field.
  40 
  41 
  42                     KSTAT_DATA_LONG
  43                                             The "long" field.
  44 
  45 
  46                     KSTAT_DATA_ULONG
  47                                             The "unsigned long" field.
  48 
  49 
  50                     KSTAT_DATA_LONGLONG
  51                                             Obsolete. Use KSTAT_DATA_INT64.
  52 
  53 
  54                     KSTAT_DATA_ULONGLONG
  55                                             Obsolete. Use KSTAT_DATA_UINT64.
  56 
  57 
  58                     KSTAT_DATA_STRING
  59                                             Arbitrary length "long string"
  60                                             field.
  61 






  62 

  63 
  64        str
  65                     Pointer to a NULL-terminated string.
  66 
  67 
  68 DESCRIPTION
  69        kstat_named_init() associates a name and a type with a kstat_named(9S)
  70        structure.
  71 
  72 
  73        kstat_named_setstr() associates str with the named kstat knp.  It is an
  74        error for knp to be of type other than KSTAT_DATA_STRING.  The string
  75        argument must remain valid even after the function that is calling
  76        kstat_named_setstr() is returned. If KSTAT_DATA_STRING is used in a
  77        persistent kstat the string argument must remain valid even after the
  78        module that created the kstat is unloaded. This is the only supported
  79        method of changing the value of long strings.
  80 
  81 RETURN VALUES
  82        None.
  83 
  84 CONTEXT
  85        kstat_named_init() and kstat_named_setstr() can be called from user or
  86        kernel context.
  87 



  88 SEE ALSO
  89        kstat_create(9F), kstat_install(9F), kstat(9S), kstat_named(9S)

  90 

  91 
  92        Writing Device Drivers
  93 
  94 
  95 
  96                                February 29, 2008          KSTAT_NAMED_INIT(9F)
   1 KSTAT_NAMED_INIT(9F)     Kernel Functions for Drivers     KSTAT_NAMED_INIT(9F)
   2 


   3 NAME
   4      kstat_named_init kstat_named_setstr - initialize a named kstat
   5 
   6 SYNOPSIS
   7      <sys/types.h>
   8      <sys/kstat.h>
   9 
  10      void
  11      kstat_named_init(kstat_named_t *knp, const char *name,

  12          uchar_t data_type);
  13 
  14      void
  15      kstat_named_setstr(kstat_named_t *knp, const char *str);
  16 



  17 INTERFACE LEVEL
  18      Solaris DDI specific (Solaris DDI)
  19 
  20 PARAMETERS
  21      knp     Pointer to a kstat_named(9S) structure.

  22 
  23      name    The name of the statistic.
  24 




  25      data_type
  26              The type of value. This indicates which field of the
  27              kstat_named(9S) structure should be used. Valid values are:

  28 
  29              KSTAT_DATA_CHAR
  30                      The "char" field.
  31 

  32              KSTAT_DATA_LONG
  33                      The "long" field.
  34 

  35              KSTAT_DATA_ULONG
  36                      The "unsigned long" field.
  37 

  38              KSTAT_DATA_LONGLONG
  39                      Obsolete. Use KSTAT_DATA_INT64.
  40 

  41              KSTAT_DATA_ULONGLONG
  42                      Obsolete. Use KSTAT_DATA_UINT64.
  43 

  44              KSTAT_DATA_STRING
  45                      Arbitrary length "long string" field.

  46 
  47              KSTAT_DATA_TIME
  48                      The high resolution time stamp field.  Note that this
  49                      should only be used for absolute time stamps, such as
  50                      returned by gethrtime(9F), and not for relative
  51                      durations.  For relative durations, KSTAT_DATA_UINT64 is
  52                      preferred.
  53 
  54      str     Pointer to a NULL-terminated string.
  55 




  56 DESCRIPTION
  57      kstat_named_init() associates a name and a type with a kstat_named(9S)
  58      structure.
  59 

  60      kstat_named_setstr() associates str with the named kstat knp.  It is an
  61      error for knp to be of type other than KSTAT_DATA_STRING.  The string
  62      argument must remain valid even after the function that is calling
  63      kstat_named_setstr() is returned. If KSTAT_DATA_STRING is used in a
  64      persistent kstat the string argument must remain valid even after the
  65      module that created the kstat is unloaded.  This is the only supported
  66      method of changing the value of long strings.
  67 



  68 CONTEXT
  69      kstat_named_init() and kstat_named_setstr() can be called from user or
  70      kernel context.
  71 
  72 RETURN VALUES
  73      None.
  74 
  75 SEE ALSO
  76      gethrtime(9F), kstat_create(9F), kstat_install(9F), kstat(9S),
  77      kstat_named(9S)
  78 
  79      Writing Device Drivers.
  80 
  81 illumos                        January 27, 2016                        illumos