附录3:实验结果与简单分析

来源:互联网 发布:linux matlab 安装 编辑:程序博客网 时间:2024/04/29 05:37

(1) Android Linux内核的性能分析

通过在指定内核的情况下进行性能监测,可以查看出Android各部分模块的cpu占用率,而运用opreport工具指定对vmlinux进行性能分析,可得出Android linux内核的各函数cpu占有率以及性能瓶颈。其中__raw_readsw占有率最高,为31%多。

#opreport /vmlinux -l -o out1.txt

其中out1.txt文件部分内容如下:(详细见附件out1.txt)

CPU: ARM/XScale PMU1, speed 0 MHz (estimated)

Counted CPU_CYCLES events (clock cycles counter) with a unit mask of 0x00 (No unit mask) count 100000

samples % symbol name

254817 31.3472 __raw_readsw

186 0.0229 rpc_async_schedule

185 0.0228 __do_page_cache_readahead

185 0.0228 nfs_proc_getattr

…………………………(略)

6 7.4e-04 ktime_add_safe

1 1.2e-04 writeback_release

1 1.2e-04 xscale_coherent_kern_range

1 1.2e-04 xscale_coherent_user_range

(2) Dalvik虚拟机的性能分析

由“Dalvik相关介绍”中得知,Dalvik实例由进程Zygote孵化,每个Android的上层应用均对应一个Dalvik实例,而通过查看可执行程序的位置(如截图5,截图6),分析得出Zygnote可执行程序为/system/bin/app_process,所有实例均有app_process进程fork产生。

clip_image002

截图5

clip_image004

截图6

因此对程序app_process进行性能分析:

#opreport /system/bin/app_process -l -o out2.txt

其中out2.txt文件部分内容如下:(详细见附件out2.txt)

CPU: ARM/XScale PMU1, speed 0 MHz (estimated)

Counted CPU_CYCLES events (clock cycles counter) with a unit mask of 0x00 (No unit mask) count 100000

samples % image name symbol name

3878 96.9742 [heap] (tgid:3893 range:0xa000-0x1e3000) [heap] (tgid:3893 range:0xa000-0x1e3000)

112 2.8007 [heap] (tgid:3893 range:0xa000-0x2d6000) [heap] (tgid:3893 range:0xa000-0x2d6000)

5 0.1250 app_process /system/bin/app_process

2 0.0500 [heap] (tgid:3841 range:0xa000-0x52000) [heap] (tgid:3841 range:0xa000-0x52000)

1 0.0250 [heap] (tgid:3176 range:0xa000-0x84000) [heap] (tgid:3176 range:0xa000-0x84000)

1 0.0250 [heap] (tgid:3537 range:0xa000-0x43000) [heap] (tgid:3537 range:0xa000-0x43000)

由结果仍未能得到Dalvik的具体性能瓶颈。其中每个heap应该相对应一个Dalvik实例。根据Oprofile官方文档,该结果应该跟Oprofile对JIT语言支持的限制有关。即是否能对Dalvik进行性能分析是个疑问?