在较旧的 Linux 发行版中,我可以在包含 asm/timex.h 后调用 get_cycle()。现在我换成Kubuntu 9.04 没有asm/timex.h,再加上sys/timex.h里面没有get_cycle()。有谁知道为什么会发生这种变化,如何访问此功能/宏或替代它?或者,更好的是,在哪里可以阅读相关信息?
最佳答案
/usr/src/linux-headers-2.6.24-23-generic/include/asm$ grep get_cycle *.h system_32.h: * (or get_cycles or vread that possibly accesses the TSC) in a defined system_64.h: * (or get_cycles or vread that possibly accesses the TSC) in a defined tsc.h:static inline cycles_t get_cycles(void) tsc.h:static inline cycles_t vget_cycles(void) vmi_time.h: u64 (*get_cycle_frequency)(void); vmi_time.h: u64 (*get_cycle_counter)(int);
所以,尝试包含
关于c - asm/timex.h 和 get_cycles() 去哪儿了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/676939/