Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions compiler-rt/lib/xray/xray_tsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ namespace __xray {
inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT { return true; }

ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
#if defined(__clang__)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__has_builtin(__builtin_readcyclecounter) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

return __builtin_readcyclecounter();
#else
uint64_t Cycles;
asm volatile("stckf %0" : /* No output. */ : "Q"(Cycles) : "cc");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the unnecessary comment /* No output. */. In the majority of places we assume that the user is aware of the : : syntax

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

return Cycles;
#endif
}

inline uint64_t getTSCFrequency() XRAY_NEVER_INSTRUMENT {
Expand Down