Print this page
4764 Need a way to get tsc deltas
Reviewed by: Keith M Wesolowski <wesolows@foobazco.org>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Richard Lowe <richlowe@richlowe.net>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/os/timestamp.c
          +++ new/usr/src/uts/i86pc/os/timestamp.c
↓ open down ↓ 228 lines elided ↑ open up ↑
 229  229                  }
 230  230  
 231  231                  hrt = tsc_hrtime_base;
 232  232  
 233  233                  TSC_CONVERT_AND_ADD(tsc, hrt, nsec_scale);
 234  234          } while ((old_hres_lock & ~1) != hres_lock);
 235  235  
 236  236          return (hrt);
 237  237  }
 238  238  
      239 +hrtime_t
      240 +tsc_gethrtime_tick_delta(void)
      241 +{
      242 +        hrtime_t hrt;
      243 +        ulong_t flags;
      244 +
      245 +        flags = clear_int_flag();
      246 +        hrt = tsc_sync_tick_delta[CPU->cpu_id];
      247 +        restore_int_flag(flags);
      248 +
      249 +        return (hrt);
      250 +}
      251 +
 239  252  /*
 240  253   * This is similar to the above, but it cannot actually spin on hres_lock.
 241  254   * As a result, it caches all of the variables it needs; if the variables
 242  255   * don't change, it's done.
 243  256   */
 244  257  hrtime_t
 245  258  dtrace_gethrtime(void)
 246  259  {
 247  260          uint32_t old_hres_lock;
 248  261          hrtime_t tsc, hrt;
↓ open down ↓ 551 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX