Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15514693
  • 博文数量: 112
  • 博客积分: 11195
  • 博客等级: 上将
  • 技术积分: 1989
  • 用 户 组: 普通用户
  • 注册时间: 2005-06-20 11:04
文章分类

全部博文(112)

文章存档

2013年(2)

2012年(27)

2011年(6)

2010年(11)

2009年(6)

2007年(7)

2006年(23)

2005年(30)

分类: LINUX

2010-11-23 22:23:38

opcontrol --dump
opannotate --source ./t
会出现下面的错误:opannotate error: No sample file found: try running opcontrol --dump or specify a session containing sample files。
看其他人的帖子没发现哪里出了问题,看到不少帖子说在vmware下面会出现这个问题,以为确实不行了,遂打算放弃,无聊翻看oprofile的QA和doc,发现有这么一段话:

4.3. OProfile in timer interrupt mode

Note

This section applies to 2.6 kernels and above only.

In 2.6 kernels on CPUs without OProfile support for the hardware performance counters, the driver falls back to using the timer interrupt for profiling. Like the RTC mode in 2.4 kernels, this is not able to profile code that has interrupts disabled. Note that there are no configuration parameters for setting this, unlike the RTC and hardware performance counter setup.

You can force use of the timer interrupt by using the timer=1 module parameter (or oprofile.timer=1 on the boot command line if OProfile is built-in).

 

于是到/root/.oprofile/目录下面把配置文件备份:mv daemonrc daemonrc.bak

然后给内核模块传递参数:modprobe oprofile timer=1

用dmesg查看,有:[ 2215.047277] oprofile: using NMI interrupt.
[ 2215.047310] oprofile: using timer interrupt.

重新执行性能测试,终于有了结果。

mlgbd,已经不是第一次被网上一些帖子忽悠了。

 

root@playmud-virtual-machine:/code/cpp# opreport -l ./t
Overflow stats not available
warning: [vdso] (tgid:1993 range:0xdce000-0xdcf000) could not be found.
warning: [vdso] (tgid:2778 range:0x17d000-0x17e000) could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples % image name symbol name
3 42.8571 [vdso] (tgid:1993 range:0xdce000-0xdcf000) [vdso] (tgid:1993 range:0xdce000-0xdcf000)
2 28.5714 [vdso] (tgid:2778 range:0x17d000-0x17e000) [vdso] (tgid:2778 range:0x17d000-0x17e000)
1 14.2857 t main
1 14.2857 t my_print
root@playmud-virtual-machine:/code/cpp# uname -a
Linux playmud-virtual-machine 2.6.35-22-generic #35-Ubuntu SMP Sat Oct 16 20:36:48 UTC 2010 i686 GNU/Linux


阅读(6561) | 评论(1) | 转发(0) |
0

上一篇:vmlinuz转vmlinux文件

下一篇:ssh反向连接

给主人留下些什么吧!~~

chinaunix网友2010-11-24 13:18:06

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com