c - asm/timex.h 和 get_cycles() 去哪儿了?

标签 c linux ubuntu include timer

在较旧的 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/

相关文章:

Linux 终端脚本用一个不同的词在当前工作目录中创建样板文件?

linux - 如何获取依赖项 'gstreamer-sharp-1.0' ?

c - 多线程程序在 Mac 上不比单线程快,但在 Linux 上,除非使用 Clang

c - 关于我在网上找到的数组示例的更多解释

c - 执行thread_kill时出现segmentation fault

sql-server - freetds 和 pyodbc 无法连接

linux - SUSE Linux 中的 bash_profile 在哪里

c - 为什么流的 C 函数以字符 f 开头?

r - 编译后的 R 包是否向后兼容?

python - 如何通过 ssh 连接运行本地 conda 环境?