Archive

Posts Tagged ‘timer=1’

oprofile抓不到采样数据问题和解决方法

April 1st, 2011 15 comments

原创文章,转载请注明: 转载自系统技术非业余研究

本文链接地址: 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大神的帮助,找到问题的根源了:
Read more…

Post Footer automatically generated by wp-posturl plugin for wordpress.

Categories: Linux, 工具介绍, 调优 Tags: ,