oprofile抓不到采样数据问题和解决方法
来源:互联网 发布:js关闭当前页面并跳转 编辑:程序博客网 时间:2024/04/29 10:41
http://blog.yufeng.info/archives/1283#more-1283
原创文章,转载请注明: 转载自系统技术非业余研究
本文链接地址: oprofile抓不到采样数据问题和解决方法
最近有同学反映在某些新机器上做性能调优的时候, oprofile 有时抓不到数据,我之前也遇到这个情况,很是无语,今天特地验证了下。
# 我们的操作系统和机器配置大概是这样的:
$
sudo
aspersa/summary
# Aspersa System Summary Report ##############################
Date | 2011-03-31 16:26:05 UTC (
local
TZ: CST +0800)
Hostname | my031226.sqa.cm4
Uptime | 10:00, 4
users
, load average: 0.00, 0.78, 5.29
System | Huawei Technologies Co., Ltd.; Tecal RH2285; vV100R001 (Main Server Chassis)
Service Tag | 2102317716N0AA000062
Release | Red Hat Enterprise Linux Server release 5.4 (Tikanga)
Kernel | 2.6.18-164.el5
Architecture | CPU = 64-bit, OS = 64-bit
Threading | NPTL 2.5
Compiler | GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-44).
SELinux | Disabled
# Processor ##################################################
Processors | physical = 2, cores = 12, virtual = 24, hyperthreading =
yes
Speeds | 24x2400.151
Models | 24xIntel(R) Xeon(R) CPU X5670 @ 2.93GHz
Caches | 24x12288 KB
..
$
sudo
rm
-f /root/.oprofile/daemonrc
$
sudo
opcontrol --setup --no-vmlinux
$
sudo
opcontrol --init
$
sudo
opcontrol --reset
$
sudo
opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log
file
/var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
$
sudo
opcontrol --status
Daemon running: pid 9253
Separate options: none
vmlinux
file
: none
Image filter: none
Call-graph depth: 0
#这里喝杯茶,让子弹飞一会儿
$
sudo
opcontrol --
shutdown
Stopping profiling.
Killing daemon.
$opreport
opreport error: No sample
file
found: try running opcontrol --dump
or specify a session containing sample files
$tree /var/lib/oprofile/samples/current/
/var/lib/oprofile/samples/current/
0 directories, 0 files
确实是没抓到sample文件!
经过无数次的分析和判断,再加上goolge大神的帮助,找到问题的根源了:
$dmesg|
grep
oprofile
oprofile: using NMI timer interrupt.
#如果你的CPU不被oprofile认识,或者说认识有问题,oprofile就会进入 timer interrupt模式
#表现就是
$ophelp
Using timer interrupt.
$
sudo
opcontrol --setup -e CPU_CLK_UNHALTED:6000:0:0:1
You cannot specify any performance counter events
because OProfile is
in
timer mode.
如果你看到上面的字,对不起你肯定抓不到数据的,解决方案是这样的:
在oprofile模块加载的时候强制使用 timer=1.
$
sudo
opcontrol --deinit
Daemon not running
Unloading oprofile module
$
sudo
modprobe oprofile timer=1
$dmesg|
grep
oprofile|
tail
-n 1
oprofile: using timer interrupt.
如果你看到上面的字说明你成功了。
我们再试验下:
$
sudo
opcontrol --init &&
sudo
opcontrol --reset &&
sudo
opcontrol --start
Using 2.6+ OProfile kernel interface.
Using log
file
/var/lib/oprofile/samples/oprofiled.log
Daemon started.
Profiler running.
#这里可以再喝杯咖啡,让子弹飞一会儿
$
sudo
opcontrol --
shutdown
Stopping profiling.
Killing daemon.
$opreport
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples| %|
------------------
719496 46.1320 no-vmlinux
432567 27.7349 ha_innodb_plugin.so.0.0.0
293343 18.8083 libc-2.5.so
111575 7.1539 mysqld
959 0.0615 perl
873 0.0560 libpthread-2.5.so
205 0.0131 oprofiled
188 0.0121 libmysqlclient.so.16.0.0
181 0.0116 ld-2.5.so
145 0.0093
bash
23 0.0015 libproc-3.2.7.so
16 0.0010 libnss_files-2.5.so
16 0.0010 libperl.so
11 7.1e-04 mysql
9 5.8e-04
ps
8 5.1e-04
gawk
8 5.1e-04
grep
5 3.2e-04 libm-2.5.so
3 1.9e-04 libcrypto.so.0.9.8e
3 1.9e-04 pkg-config
2 1.3e-04 libdl-2.5.so
2 1.3e-04
dircolors
2 1.3e-04 sshd
1 6.4e-05 ksh93
1 6.4e-05
more
1 6.4e-05 libselinux.so.1
1 6.4e-05
du
1 6.4e-05
sudo
1 6.4e-05
wc
1 6.4e-05 libnetsnmp.so.10.0.3
...
$tree current/
current/
|-- {kern}
| `-- no-vmlinux
| `-- {dep}
| `-- {kern}
| `-- no-vmlinux
| `-- TIMER.0.0.all.all.all
`-- {root}
|-- bin
...
196 directories, 30 files
收工,回家睡觉,困了! 项目要用oprofile,本来我12:00前要睡觉的,唉!
玩得开心!
Post Footer automatically generated by wp-posturl plugin for wordpress.
0 0
- oprofile抓不到采样数据问题和解决方法
- oprofile抓不到采样数据问题和解决方法
- oprofile抓不到数据
- 龙芯3A oprofile无法采样内核函数的解决方法
- ServletInputStream 和FileInputStream 的区别 ServletInputStream取不到数据解决方法
- ServletInputStream 和FileInputStream 的区别 ServletInputStream取不到数据解决方法
- wireshark,commview抓不到包的问题
- wireshark抓不到包的问题
- 解决fiddler抓不到包的问题
- 解决龙芯2F使用oprofile-0.9.7无法采样应用程序函数的问题
- Fiddler有时抓不到请求可能的原因及解决方法
- Socket使用BufferedReader和BufferedWriter读不到数据的问题
- 手机正确设置代理,但是charles抓不到数据
- udp端口接收不到数据BUT抓包可以抓到数据,why?
- 解决fiddler抓不到浏览器包的问题
- 爬虫之云南电信抓不到详单问题
- OProfile分析服务的瓶颈和CPU100%问题的利器
- OProfile分析服务的瓶颈和CPU100%问题的利器
- Fedora 截屏
- 1. HTML DOM Document 对象
- hdu 1520 Anniversary party 树形DP
- CKEditor文字编辑器
- linux 信号列表
- oprofile抓不到采样数据问题和解决方法
- leetcode 079 —— Word Search
- 南邮 OJ 1005 多项式加法
- shell中各种括号的作用()、(())、[]、[[]]、{}
- 【转】java程序访问derby的两种模式实例
- 社説 20150803 戦争遺跡 悲惨な記憶を後世に伝えよう
- slf4j和logback的详细使用(二)
- hdu 4135 Co-prime(容斥原理)
- svn 删除服务器和本地的文件