trace_clock.c 335 B

12345678910111213141516171819202122
  1. /*
  2. * X86 trace clocks
  3. */
  4. #include <asm/trace_clock.h>
  5. #include <asm/barrier.h>
  6. #include <asm/msr.h>
  7. /*
  8. * trace_clock_x86_tsc(): A clock that is just the cycle counter.
  9. *
  10. * Unlike the other clocks, this is not in nanoseconds.
  11. */
  12. u64 notrace trace_clock_x86_tsc(void)
  13. {
  14. u64 ret;
  15. rdtsc_barrier();
  16. rdtscll(ret);
  17. return ret;
  18. }