Documentation/basic_profiling.txt

中文版基本性能剖析指南
本文提供了一套针对中文用户的入门级性能剖析方法,包括如何设置系统映像、使用readprofile和opreport进行性能测试,以及如何配置内核以获取更准确的性能数据。文章详细介绍了如何在Linux系统上进行性能剖析,特别强调了本地APIC的启用对于提高结果准确性的重要性。

Chinese translated version of Documentation/basic_profiling.txt

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: 秦芹 18768122412@163.com
---------------------------------------------------------------------
Documentation/basic_profiling.txt的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者: 秦芹 18768122412@163.com
中文版翻译者:秦芹 18768122412@163.com

以下为正文

---------------------------------------------------------------------

 These instructions are deliberately very basic. If you want something clever,
 go read the real docs ;-) Please don't add more stuff, but feel free to 
 correct my mistakes ;-)    (mbligh@aracnet.com)
 Thanks to John Levon, Dave Hansen, et al. for help writing this.
 这些介绍是计算机科学技术里很基础的,如果你想要看一些比较深入的知识,
 请阅读另外一些深入的文档,在不要添加更多的资料的基础上,认真纠正我

 的错误(mbligh@aracnet.com)
 谢谢John Levon, Dave Hansen等人对写这片文章的帮助。
 <test> is the thing you're trying to measure.
 Make sure you have the correct System.map / vmlinux referenced!
 你应该试着测试一下,确保存在System.map / vmlinux目录。
 It is probably easiest to use "make install" for linux and hack
 /sbin/installkernel to copy vmlinux to /boot, in addition to vmlinuz,
 config, System.map, which are usually installed by default.
 对于linux这非常容易使用 make instal,回到/sbin/installkernel 目录

 复制vmlinux到/boot,除了vmlinux配置System.map通常是默认安装的。
 Readprofile
 -----------
 A recent readprofile command is needed for 2.6, such as found in util-linux
 2.12a, which can be downloaded from:
 http://www.kernel.org/pub/linux/utils/util-linux/
 Most distributions will ship it already.
 最近readprofile的命令要求的版本是2.6,因此如果发现util-linux的版本是2.12a,

 你就应该从http://www.kernel.org/pub/linux/utils/util-linux/下载:
 大多数分布应该已经发行。
 Add "profile=2" to the kernel command line.
 增加"profile=2"到kernel命令行。
 clear           readprofile -r
                 <test>
 dump output     readprofile -m /boot/System.map > captured_profile
 
 Oprofile
 --------
 
 Get the source (see Changes for required version) from
 http://oprofile.sourceforge.net/ and add "idle=poll" to the kernel command
 line.
 Configure with CONFIG_PROFILING=y and CONFIG_OPROFILE=y & reboot on new kernel
 ./configure --with-kernel-support
 make install
 得到资源后(看一下不同点从要求的版本)从http://oprofile.sourceforge.net/增加idle=poll

 到kernel命令行。

 配置CONFIG_PROFILING=y and CONFIG_OPROFILE=y和重新配置kernel

 For superior results, be sure to enable the local APIC. If opreport sees
 a 0Hz CPU, APIC was not on. Be aware that idle=poll may mean a performance
 penalty.
 对于这个结果,应该确保本地的APIC如果从报告中看出0HZCPU
 和APIC也没启动,则意味着idle=poll指令失败了。
 One time setup:

 下面为一次启动过程:
                 opcontrol --setup --vmlinux=/boot/vmlinux
 
 clear           opcontrol --reset
 start           opcontrol --start
                 <test>
 stop            opcontrol --stop
 dump output     opreport >  output_file
 
 To only report on the kernel, run opreport -l /boot/vmlinux > output_file
 A reset is needed to clear old statistics, which survive a reboot.
 对于这个仅仅运行在内核上的报告,执行opreport -l /boot/vmlinux > output_file
 为了清除旧的数据统计,重新启动复位是必须的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值