8//===----------------------------------------------------------------------===// 9// 10// This file is a part of XRay, a dynamic runtime instrumentation system. 11// 12//===----------------------------------------------------------------------===// 13 14#include <cstdint> 15#include <x86intrin.h> 16 17#include "sanitizer_common/sanitizer_internal_defs.h" 18#include "xray_defs.h" 19 20namespace __xray { 21 22ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT { 23 unsigned LongCPU; 24 unsigned long Rax, Rdx; 25 __asm__ __volatile__("rdtscp\n" : "=a"(Rax), "=d"(Rdx), "=c"(LongCPU) ::); 26 CPU = LongCPU; 27 return (Rdx << 32) + Rax; 28} 29 30uint64_t getTSCFrequency(); 31 32bool probeRequiredCPUFeatures(); 33 34} // namespace __xray
| 7//===----------------------------------------------------------------------===// 8// 9// This file is a part of XRay, a dynamic runtime instrumentation system. 10// 11//===----------------------------------------------------------------------===// 12 13#include <cstdint> 14#include <x86intrin.h> 15 16#include "sanitizer_common/sanitizer_internal_defs.h" 17#include "xray_defs.h" 18 19namespace __xray { 20 21ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT { 22 unsigned LongCPU; 23 unsigned long Rax, Rdx; 24 __asm__ __volatile__("rdtscp\n" : "=a"(Rax), "=d"(Rdx), "=c"(LongCPU) ::); 25 CPU = LongCPU; 26 return (Rdx << 32) + Rax; 27} 28 29uint64_t getTSCFrequency(); 30 31bool probeRequiredCPUFeatures(); 32 33} // namespace __xray
|