Chinaunix首页 | 论坛 | 博客
  • 博客访问: 159752
  • 博文数量: 33
  • 博客积分: 2530
  • 博客等级: 少校
  • 技术积分: 580
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-25 16:03
文章分类
文章存档

2011年(1)

2010年(2)

2009年(17)

2008年(13)

我的朋友

分类:

2008-07-29 11:05:44

问题:Make sure you are using the non-compressed imag
问题:Make sure you are using the non-compressed image file

问题现象:

# ./opcontrol --setup --vmlinux=/edwin/kernel/linux-2.6.18_pro500/vmlinux
The specified file /edwin/kernel/linux-2.6.18_pro500/vmlinux does not seem to be valid
Make sure you are using the non-compressed image file (e.g. vmlinux not vmlinuz)


解决方法:

分析:
参看源码,由于在指定内核镜像时,会用到objdump 应用程序检测镜像中的.text段内容,而在JK2410板子上面没有交叉编译的objdump应用程序,所以不能通过判断,以至于,即使指定的是未压缩的内核镜像,也被误认为压缩的了。

动作:
arm-9tdmi-linu-gnu交叉编译器目录下的objdump 拷贝到 JK2410开发板的/usr/bin目录下

Host:
# cp /work/binutils/binutils-2.17-install-dir/arm-9tdmi-linux-gnu/bin/objdump
/work


Target:
# cp /edwin/objdump /usr/bin

或者直接将 objdump 作到根文件系统里面


Profiling the kernel image "Vmlinux"

步骤:
# ./opcontrol --init

# ./opcontrol --vmlinux=/edwin/kernel/linux-2.6.18_pro500/vmlinux
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
./opreport error: No sample file found: try running opcontrol --dump
or specify a session containing sample files
如果打印出上面的信息,并不是说明oprofile没有工作,或者配置有问题,实际上是因为在vmvare machine上,oprofile采用时钟中断的方式采样数据,可以等时间长一点,或者多敲一些命令。然后再执行
# ./opcontrol --dump
# ./opreport

得到如下分析结果

# ./opreport

CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples|
%|
------------------
33278 99.0535 vmlinux
182    0.5417 ld-linux.so.2
63     0.1875 libc.so.6
57     0.1697 busybox
8      0.0238 libstdc++.so.6.0.1
4      0.0119 opreport
2      0.0060 libgcc_s.so.1
1      0.0030 opgprof
1      0.0030 libcrypt-2.3.3.so



获得更加详细的信息
# ./opreport -l /edwin/kernel/linux-2.6.18_pro500/vmlinux

CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples
%


symbol name
706796
99.6478
default_idle

276
0.0389
net_interrupt

126
0.0178
arm920_flush_user_cache_range

113
0.0159
__schedule

59
0.0083
update_mmu_cache

45
0.0063
v4wb_copy_user_page

43
0.0061
netif_rx

42
0.0059
__copy_to_user

41
0.0058
__queue_work

37
0.0052
net_send_packet

33
0.0047
__handle_mm_fault

30
0.0042
udp_sendmsg

29
0.0041
flush_dcache_page

27
0.0038
__memzero

27
0.0038
unmap_vmas

23
0.0032
ip_append_data

20
0.0028
__rcu_read_unlock

20
0.0028
handle_IRQ_event

19
0.0027
__rcu_read_lock

19
0.0027
process_backlog

19
0.0027
xdr_decode_fattr

18
0.0025
kmem_cache_free

17
0.0024
__link_path_walk

17
0.0024
kmem_cache_alloc

17
0.0024
ksoftirqd

17
0.0024
local_bh_enable

16
0.0023
__rpc_execute

16
0.0023
arm920_flush_kern_dcache_page

15
0.0021
__kmalloc

15
0.0021
call_transmit

15
0.0021
do_irqd

14
0.0020
__alloc_skb

14
0.0020
__d_lookup

14
0.0020
__dabt_usr

14
0.0020
__udivsi3

14
0.0020
csum_partial_copy_nocheck

14
0.0020
find_get_page

14
0.0020
get_page_from_freelist

14
0.0020
ip_route_input

14
0.0020
memcmp

14
0.0020
nfs_refresh_inode

14
0.0020
notifier_call_chain

14
0.0020
rpc_wake_up_next

13
0.0018
ip_push_pending_frames




……

阅读(1653) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:(转)对.lds连接脚本文件的分析

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