1

我在带有 2 个 Xeon E5504 处理器的 IBM HS22 刀片上安装了 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

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

4

1 回答 1

1

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

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

希望这个答案能帮助您解决问题。请就此回复。

于 2011-07-14T12:02:04.920 回答