I'm trying to use oprofile to record cache misses in a large realtime app:
$ sudo opcontrol --no-vmlinux --event=LLC_MISSES:100000 --session-dir=/var/tmp/oprofile -c=5 --start
But when I look at the reports, it doesn't mention the cache misses. It only samples 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)
But --status claims that oprofile is sampling L2 misses:
$ 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
What am I doing wrong? I can't get it to sample any of the other counters listed in ophelp
either.
This is with oprofile 0.9.6 on Ubuntu, kernel version 2.6.38.
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.