Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[linux-2.6-block.git] / Documentation / zh_CN / basic_profiling.txt
CommitLineData
ef4158c5 1Chinese translated version of Documentation/basic_profiling
2
3If you have any comment or update to the content, please post to LKML directly.
4However, if you have problem communicating in English you can also ask the
5Chinese maintainer for help. Contact the Chinese maintainer, if this
6translation is outdated or there is problem with translation.
7
8Chinese maintainer: Liang Xie <xieliang@xiaomi.com>
9---------------------------------------------------------------------
10Documentation/basic_profiling的中文翻译
11
12如果想评论或更新本文的内容,请直接发信到LKML。如果你使用英文交流有困难的话,也可
13以向中文版维护者求助。如果本翻译更新不及时或者翻译存在问题,请联系中文版维护者。
14
15中文版维护者: 谢良 Liang Xie <xieliang007@gmail.com>
16中文版翻译者: 谢良 Liang Xie <xieliang007@gmail.com>
17中文版校译者:
18以下为正文
19---------------------------------------------------------------------
20
21下面这些说明指令都是非常基础的,如果你想进一步了解请阅读相关专业文档:)
22请不要再在本文档增加新的内容,但可以修复文档中的错误:)(mbligh@aracnet.com)
23感谢John Levon,Dave Hansen等在撰写时的帮助
24
25<test> 用于表示要测量的目标
26请先确保您已经有正确的System.map / vmlinux配置!
27
28对于linux系统来说,配置vmlinuz最容易的方法可能就是使用“make install”,然后修改
29/sbin/installkernel将vmlinux拷贝到/boot目录,而System.map通常是默认安装好的
30
31Readprofile
32-----------
332.6系列内核需要版本相对较新的readprofile,比如util-linux 2.12a中包含的,可以从:
34
35http://www.kernel.org/pub/linux/utils/util-linux/ 下载
36
37大部分linux发行版已经包含了.
38
39启用readprofile需要在kernel启动命令行增加”profile=2“
40
41clear readprofile -r
42 <test>
43dump output readprofile -m /boot/System.map > captured_profile
44
45Oprofile
46--------
47
48从http://oprofile.sourceforge.net/获取源代码(请参考Changes以获取匹配的版本)
49在kernel启动命令行增加“idle=poll”
50
51配置CONFIG_PROFILING=y和CONFIG_OPROFILE=y然后重启进入新kernel
52
53./configure --with-kernel-support
54make install
55
56想得到好的测量结果,请确保启用了本地APIC特性。如果opreport显示有0Hz CPU,
57说明APIC特性没有开启。另外注意idle=poll选项可能有损性能。
58
59One time setup:
60 opcontrol --setup --vmlinux=/boot/vmlinux
61
62clear opcontrol --reset
63start opcontrol --start
64 <test>
65stop opcontrol --stop
66dump output opreport > output_file
67
68如果只看kernel相关的报告结果,请运行命令 opreport -l /boot/vmlinux > output_file
69
70通过reset选项可以清理过期统计数据,相当于重启的效果。
71