]>
Commit | Line | Data |
---|---|---|
7cac9316 XL |
1 | //===-- xray_x86_64.h -------------------------------------------*- C++ -*-===// |
2 | // | |
3 | // The LLVM Compiler Infrastructure | |
4 | // | |
5 | // This file is distributed under the University of Illinois Open Source | |
6 | // License. See LICENSE.TXT for details. | |
7 | // | |
8 | //===----------------------------------------------------------------------===// | |
9 | // | |
10 | // This file is a part of XRay, a dynamic runtime instrumentation system. | |
11 | // | |
12 | //===----------------------------------------------------------------------===// | |
13 | #ifndef XRAY_X86_64_H | |
14 | #define XRAY_X86_64_H | |
15 | ||
16 | #include <cstdint> | |
17 | #include <x86intrin.h> | |
18 | ||
19 | #include "sanitizer_common/sanitizer_internal_defs.h" | |
20 | #include "xray_defs.h" | |
21 | ||
22 | namespace __xray { | |
23 | ||
24 | ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT { | |
25 | unsigned LongCPU; | |
26 | uint64_t TSC = __rdtscp(&LongCPU); | |
27 | CPU = LongCPU; | |
28 | return TSC; | |
29 | } | |
30 | } | |
31 | ||
32 | #endif // XRAY_X86_64_H |