我是使用 Google Compute Engine 的新手。我想使用 Linux perf 工具对我的应用程序进行一些各种性能事件测量并最终进行示例分析。我已经在我的 Ubuntu 16.04 LTS VM 上安装了 linux perf 工具。然而,即使是像循环这样的基本事件也会显示为“不支持”。我猜测底层 KVM 管理程序没有启用虚拟 PMU 支持,尽管我相信 KVM 确实通过非默认标志设置支持这一点。有什么办法可以让这个工作吗?
# perf stat -e cycles -a sleep 10
Performance counter stats for 'system wide':
<not supported> cycles
10.000598339 seconds time elapsed