Print this page
codereview and testing fixes.
6558 kstat: desire type for timestamps

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/kstat.h
          +++ new/usr/src/uts/common/sys/kstat.h
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   *
  25   25   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
       26 + * Copyright 2016 Garrett D'Amore
  26   27   */
  27   28  
  28   29  #ifndef _SYS_KSTAT_H
  29   30  #define _SYS_KSTAT_H
  30   31  
  31   32  /*
  32   33   * Definition of general kernel statistics structures and /dev/kstat ioctls
  33   34   */
  34   35  
  35   36  #include <sys/types.h>
↓ open down ↓ 439 lines elided ↑ open up ↑
 475  476   * C99 ANSI C compilation environment, the long long type is supported.
 476  477   * The _INT64_TYPE is defined by the implementation (see sys/int_types.h).
 477  478   */
 478  479  #if defined(_INT64_TYPE)
 479  480                  int64_t         i64;
 480  481                  uint64_t        ui64;
 481  482  #endif
 482  483                  long            l;
 483  484                  ulong_t         ul;
 484  485  
      486 +                hrtime_t        t;
      487 +
 485  488                  /* These structure members are obsolete */
 486  489  
 487  490                  longlong_t      ll;
 488  491                  u_longlong_t    ull;
 489  492                  float           f;
 490  493                  double          d;
 491  494          } value;                        /* value of counter */
 492  495  } kstat_named_t;
 493  496  
 494  497  #define KSTAT_DATA_CHAR         0
↓ open down ↓ 26 lines elided ↑ open up ↑
 521  524   * The default update routine will update ks_data_size automatically for
 522  525   * variable-length kstats containing long strings (using the default update
 523  526   * routine only makes sense if the string is the only thing that is changing
 524  527   * in size, and ks_ndata is constant).  Fixed-length kstats containing long
 525  528   * strings must explicitly change ks_data_size (after creation but before
 526  529   * initialization) to reflect the correct amount of space required for the
 527  530   * long strings and the kstat_named_t's.
 528  531   */
 529  532  #define KSTAT_DATA_STRING       9
 530  533  
      534 +/*
      535 + * Value is an hrtime_t, in seconds since system boot.
      536 + */
      537 +#define KSTAT_DATA_TIME         10
      538 +
 531  539  /* These types are obsolete */
 532  540  
 533  541  #define KSTAT_DATA_LONGLONG     KSTAT_DATA_INT64
 534  542  #define KSTAT_DATA_ULONGLONG    KSTAT_DATA_UINT64
 535  543  #define KSTAT_DATA_FLOAT        5
 536  544  #define KSTAT_DATA_DOUBLE       6
 537  545  
 538  546  #define KSTAT_NAMED_PTR(kptr)   ((kstat_named_t *)(kptr)->ks_data)
 539  547  
 540  548  /*
↓ open down ↓ 288 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX