2

我正在尝试使用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。

4

1 回答 1

2

Turns out you need to actually kill and restart the oprofile daemon with

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

when changing sampled events. Simply stopping and starting the profile isn't enough. Not that this is documented anywhere.

于 2011-11-03T21:36:26.730 回答