gpt4 book ai didi

linux - oprofile 不能使用硬件性能计数器

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:11:48 25 4
gpt4 key购买 nike

我在带有 2 个至强 E5504 处理器的 IBM HS22 Blade 服务器上安装了 debian 5.0 linux 服务器。我发现 oprofile 无法在此设置上识别硬件性能计数器,只能使用定时器中断:

# opcontrol -l
Using timer interrupt.
# cat /dev/oprofile/cpu_type
timer

系统信息是:

# cat /etc/issue.net 
Debian GNU/Linux 5.0
# uname -a
Linux xxx 2.6.26-2-686-bigmem #1 SMP Mon Jun 21 06:45:17 UTC 2010 i686 GNU/Linux

oprofile 是使用 apt 从 debian 存储库安装的。

# opcontrol --version
opcontrol: oprofile 0.9.3 compiled on Feb 10 2008 12:08:26

我应该怎么做才能启用硬件性能计数器?谢谢!

最佳答案

请检查内核源代码,在 linux/arch/your_machine_architecture/kernel/cputable.c 文件中,是否为您的机器架构定义了 .num_pmcs。例如。对于 PPC970MP 架构,您可以在 linux/arch/powerpc/kernel/cputable.c --> Line No.272(Kernel Version 2.6.32) 中找到它。因为一些较旧的内核版本没有为所有架构定义此 .num_pmcs。

我建议使用此解决方案,因为我在尝试在 2.6.14 内核上运行 PPC970MP 架构的 oprofile 时遇到了类似的问题。

希望这个回答能帮助您解决问题。请对此作出答复。

关于linux - oprofile 不能使用硬件性能计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4363413/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com