linux - oprofile 不对 LLC_MISSES 缓存事件进行采样

标签 linux ubuntu profiling oprofile

我正在尝试使用 oprofile在大型实时应用程序中记录缓存未命中:

$ sudo opcontrol --no-vmlinux --event=LLC_MISSES:100000 --session-dir=/var/tmp/oprofile -c=5 --start

但是当我查看报告时,它没有提到缓存未命中。它只采样 CPU_CLK_UNHALTED:

$ sudo opreport -l --session-dir=/var/tmp/oprofile 

CPU: Intel Architectural Perfmon, speed 1596 MHz (estimated)
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
samples  %        image name               app name                 symbol name
63243    92.2946  no-vmlinux               no-vmlinux               /no-vmlinux
564       0.8231  libc-2.13.so             libc-2.13.so             /lib32/libc-2.13.so
 (etc)

但是 --status 声称 oprofile 正在采样 L2 未命中:

$ sudo opcontrol --status

Daemon running: pid 3220
Event 0: LLC_MISSES:500000:65:1:1
Separate options: library
vmlinux file: none
Image filter: none
Call-graph depth: 5

我做错了什么?我也无法让它对 ophelp 中列出的任何其他计数器进行采样。

这是在 Ubuntu 上使用 oprofile 0.9.6,内核版本 2.6.38。

最佳答案

事实证明你需要真正杀死并重新启动 oprofile 守护进程

sudo opcontrol --stop
sudo opcontrol --reset
sudo opcontrol --shutdown
sudo opcontrol --start-daemon
sudo opcontrol --start

更改采样事件时。仅仅停止和启动配置文件是不够的。并不是说这在任何地方都有记录。

关于linux - oprofile 不对 LLC_MISSES 缓存事件进行采样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8001908/

相关文章:

visual-studio - 当我在 Azure 中运行 Visual Studio 探查器时未找到符号

linux - 如何使用 linux 将一个文件分割成多个不同行的文件?

c - Posix线程问题

不能包含 linux/cred.h 头文件 : "No such file or directory"

ubuntu - 解决xinetd "Transport endpoint is not connected"

MySQL 查询优化(运行 7.6 秒)

.net - "Spike"探查器?

php - 如何从 C 运行一些 PHP 代码

qt-creator - 无法连接 creator comm socket/tmp/qt_temp.JH2103/stub-socket : No such file or directory

php - "unlink permission denied"尝试删除 deleteme.txt 时出错