Print this page
OS-5192 need faster clock_gettime
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Joshua M. Clulow <jmc@joyent.com>
Reviewed by: Ryan Zezeski <ryan@zinascii.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86xpv/os/xpv_timestamp.c
          +++ new/usr/src/uts/i86xpv/os/xpv_timestamp.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  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  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
       25 + * Copyright 2016 Joyent, Inc.
  25   26   */
  26   27  
  27   28  #include <sys/types.h>
  28   29  #include <sys/clock.h>
  29   30  #include <sys/panic.h>
  30   31  #include <sys/atomic.h>
  31   32  #include <sys/hypervisor.h>
  32   33  
  33   34  #include <sys/archsystm.h>
  34   35  
↓ open down ↓ 29 lines elided ↑ open up ↑
  64   65   *      This is the monotonic hrtime counter to be used by everything else such
  65   66   *      as the cyclic subsystem.  We should never pass an hrtime directly into
  66   67   *      a hypervisor interface, as hrtime_addend may well be non-zero.
  67   68   */
  68   69  
  69   70  int hrtime_fake_mt = 1;
  70   71  static volatile hrtime_t hrtime_last;
  71   72  static hrtime_t hrtime_suspend_time;
  72   73  static hrtime_t hrtime_addend;
  73   74  
       75 +volatile uint32_t hres_lock;
       76 +hrtime_t hres_last_tick;
       77 +int64_t hrestime_adj;
       78 +volatile timestruc_t hrestime;
       79 +
  74   80  /*
  75   81   * These functions are used in DTrace probe context, and must be removed from
  76   82   * fbt consideration.  Currently fbt ignores all weak symbols, so this will
  77   83   * achieve that.
  78   84   */
  79   85  #pragma weak xpv_gethrtime = dtrace_xpv_gethrtime
  80   86  #pragma weak xpv_getsystime = dtrace_xpv_getsystime
  81   87  #pragma weak dtrace_gethrtime = dtrace_xpv_gethrtime
  82   88  #pragma weak tsc_read = dtrace_xpv_gethrtime
  83   89  
↓ open down ↓ 83 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX