oprofile on Linux guest under VMware
oprofile一直报错,不出结果。百思不得其解。。。
# opreport
Overflow stats not available
error: no sample files found: profile specification too strict ?
过了几个月,突然开了窍,想起这几个机器是VM guest under vmware,放狗一搜,有了结果。。。
official says: OProfile can't work with VMware when using performance counter interface. A workaround is to use RTC mode (2.4 kernel) or timer interrupt mode (2.6 kernel) 就是没讲怎么设置timer interrupt mode…
手册提了这一点,没费太多力气。
简单的说,就是:
# opcontrol --deinit
# modprobe oprofile timer=1
# echo "options oprofile timer=1" >> /etc/modprobe.conf
然后就可以了
# opcontrol --start
Using 2.6+ OProfile kernel interface.
Reading module info.
Using log file /var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
# opcontrol --dump
# opreport
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples| %|
------------------
171 93.4426 vmlinux
7 3.8251 libc-2.11.so
3 1.6393 pcnet32
1 0.5464 bash
1 0.5464 oprofile
