Print this page
Add boot_hrtime to global and zone kstats.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/clock.c
          +++ new/usr/src/uts/common/os/clock.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  22   22  /*        All Rights Reserved   */
  23   23  
  24   24  /*
  25   25   * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  26   26   * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
       27 + * Copyright 2016 Garrett D'Amore
  27   28   */
  28   29  
  29   30  #include <sys/param.h>
  30   31  #include <sys/t_lock.h>
  31   32  #include <sys/types.h>
  32   33  #include <sys/tuneable.h>
  33   34  #include <sys/sysmacros.h>
  34   35  #include <sys/systm.h>
  35   36  #include <sys/cpuvar.h>
  36   37  #include <sys/lgrp.h>
↓ open down ↓ 270 lines elided ↑ open up ↑
 307  308   */
 308  309  lbolt_info_t *lb_info;
 309  310  
 310  311  
 311  312  int one_sec = 1; /* turned on once every second */
 312  313  static int fsflushcnt;  /* counter for t_fsflushr */
 313  314  int     dosynctodr = 1; /* patchable; enable/disable sync to TOD chip */
 314  315  int     tod_needsync = 0;       /* need to sync tod chip with software time */
 315  316  static int tod_broken = 0;      /* clock chip doesn't work */
 316  317  time_t  boot_time = 0;          /* Boot time in seconds since 1970 */
      318 +hrtime_t boot_hrtime = 0;       /* gethrtime() at boot */
 317  319  cyclic_id_t clock_cyclic;       /* clock()'s cyclic_id */
 318  320  cyclic_id_t deadman_cyclic;     /* deadman()'s cyclic_id */
 319  321  
 320  322  extern void     clock_tick_schedule(int);
 321  323  
 322  324  static int lgrp_ticks;          /* counter to schedule lgrp load calcs */
 323  325  
 324  326  /*
 325  327   * for tod fault detection
 326  328   */
↓ open down ↓ 1569 lines elided ↑ open up ↑
1896 1898                          cmn_err(CE_WARN, "Time-of-day chip had "
1897 1899                              "incorrect date; check and reset.");
1898 1900                  }
1899 1901                  set_clock = 1;
1900 1902          }
1901 1903  
1902 1904          if (!boot_time) {
1903 1905                  boot_time = ts.tv_sec;
1904 1906                  set_clock = 1;
1905 1907          }
     1908 +        if (!boot_hrtime) {
     1909 +                boot_hrtime = gethrtime();
     1910 +        }
1906 1911  
1907 1912          if (set_clock)
1908 1913                  set_hrestime(&ts);
1909 1914  
1910 1915          mutex_exit(&tod_lock);
1911 1916  }
1912 1917  
1913 1918  int     timechanged;    /* for testing if the system time has been reset */
1914 1919  
1915 1920  void
↓ open down ↓ 750 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX