您的位置:首页 > 运维架构 > Linux

linux中Dcumentation目录下的basic_profiling.txt文档翻译

2015-05-19 00:00 309 查看
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!
IMHO it's easier to use "make install" for linux and hack /sbin/installkernel
to copy config files, system.map, vmlinux to /boot.
<test>命令是你想要去测试的事情。请确认你由正确的System.map / vmlinux引用。使用"make install"
命令和裁剪/sbin.installkernel来复制配置文件,system.map,vnlinux到/boot目录下是非常简单的。

Readprofile
Readprofile命令
-----------
You need a fixed readprofile command for 2.5 ... either get hold of
a current version from: http://www.kernel.org/pub/linux/utils/util-linux/ 在内核2.5中你需要一个固定的readprofile命令,你可以通过网站http://www.kernel.org/pub/linux/utils/util-linux/
获取一个最新的版本。
or get readprofile binary fixed for 2.5 / akpm's 2.5 patch from ftp://ftp.kernel.org/pub/linux/kernel/people/mbligh/tools/readprofile/ 或者是从ftp://ftp.kernel.org/pub/linux/kernel/people/mbligh/tools/readprofile/
获取一个固定的2.5/akpm's内核的readprofile二进制补丁。

Add "profile=2" to the kernel command line.
添加"profile=2"到内核命令行中。

clear readprofile -r 清除 readprofile -r参数
<test>
dump output readprofile -m /boot/System.map > captured_profile 重定向输出文件 readprofile -m /boot/System.map > captured_profile

Oprofile
--------
get source (I use 0.5) from http://oprofile.sourceforge.net/ 从网站http://oprofile.sourceforge.net/获取源码(我使用的是0.5版本)。
add "idle=poll" to the kernel command line
添加"idle=poll"到内核命令行中。
Configure with CONFIG_PROFILING=y and CONFIG_OPROFILE=y & reboot on new kernel
配置 CONFIG_PROFILING=y 和 CONFIG_OPROFILE=y,并且在新内核中重新启动
./configure --with-kernel-support
./configure --内核支持

make install 执行安装指令

One time setup (pick appropriate one for your CPU):
一次安装(为你的CPU挑选适当的一个)
P3 opcontrol --setup --vmlinux=/boot/vmlinux \
--ctr0-event=CPU_CLK_UNHALTED --ctr0-count=100000
Athlon/x86-64 opcontrol --setup --vmlinux=/boot/vmlinux \
--ctr0-event=RETIRED_INSNS --ctr0-count=100000
P4 opcontrol --setup --vmlinux=/boot/vmlinux \
--ctr0-event=GLOBAL_POWER_EVENTS \
--ctr0-unit-mask=1 --ctr0-count=100000

start daemon opcontrol --start-daemon
clear opcontrol --reset
start opcontrol --start
<test>
stop opcontrol --stop
dump output(重定向输出) oprofpp -dl -i /boot/vmlinux > output_file
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux 翻译 profiling