OPROFILE can't get performance data

无人久伴 提交于 2019-12-23 11:46:08

问题


I am using OPROFILE to collect some performance data. but I got in troubule.

Here is my shell:

~ # rm -f /root/.oprofile/daemonrc
~ # opcontrol --setup --no-vmlinux
~ # opcontrol --init
~ # opcontrol --reset
~ # opcontrol --start
~ # opcontrol --status

Daemon running: pid 14909    
Separate options: none
vmlinux file: none    
Image filter: none    
Call-graph depth: 0

~ # opcontrol --shutdown

Stopping profiling.
Killing daemon.

~ # opreport

error: no sample files found: profile specification too strict?

~ # tree /var/lib/oprofile/

/var/lib/oprofile/
├── abi
├── complete_dump
├── jitdump
├── opd_pipe
└── samples
    ├── current
    │   └── stats
    │       ├── bt_lost_no_mapping
    │       ├── cpu0
    │       │   ├── backtrace_aborted
    │       │   ├── sample_invalid_eip
    │       │   ├── sample_lost_overflow
    │       │   └── sample_received
    │       ├── event_lost_overflow
    │       ├── multiplex_counter
    │       ├── sample_lost_no_mapping
    │       └── sample_lost_no_mm
    └── oprofiled.log


5 directories, 13 files

~ # dmesg |grep oprofile

oprofile: using NMI interrupt.


~ # uname -a

Linux localhost.localdomain 2.6.32-220.4.2.el6.x86_64 #1 SMP Tue Feb 14 04:00:16 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

~ # cat /proc/cpuinfo 

processor   : 0    
vendor_id   : GenuineIntel   
cpu family  : 6    
model       : 44    
model name  : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz   
stepping    : 2    
cpu MHz     : 2400.085   
cache size  : 12288 KB   
fpu     : yes    
fpu_exception   : yes    
cpuid level : 11    
wp      : yes   
flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx rdtscp lm constant_tsc up arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf unfair_spinlock pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat epb dts    
bogomips    : 4800.17    
clflush size    : 64   
cache_alignment : 64   
address sizes   : 40 bits physical, 48 bits virtual   
power management:

回答1:


Some CPU types do not provide the needed hardware support to use the hardware performance counters. On these machines, OProfile falls back to using the timer interrupt for profiling, back to using the real-time clock interrupt to collect samples.

you can force use of the timer interrupt by using the timer=1 module parameter.If OProfile was built as a kernel module, then you must pass the 'timer=1' parameter with the modprobe command. Do this before executing 'opcontrol --init' or edit the opcontrol command's invocation of modprobe to pass the 'timer=1' parameter

modprobe oprofile timer=1

Then continue your profiling procedure




回答2:


I ran into a similar problem on a RHEL6 based distribution. At some point, I started using perf with which I was able to get profiler reports and annotated source code.



来源:https://stackoverflow.com/questions/11444885/oprofile-cant-get-performance-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!