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

简介: These instructions are deliberately very basic. If you want something clever,go read the real docs ;-) Please...
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
目录
相关文章
|
17天前
|
Linux
关于Linux目录访问函数总结
关于Linux目录访问函数总结
13 1
|
28天前
|
Shell Linux C语言
【Shell 命令集合 磁盘管理 】Linux 只删除空目录 mrd命令使用教程
【Shell 命令集合 磁盘管理 】Linux 只删除空目录 mrd命令使用教程
31 0
|
28天前
|
Shell Linux C语言
【Shell 命令集合 磁盘管理 】Linux 改变当前工作目录 cd命令使用指南
【Shell 命令集合 磁盘管理 】Linux 改变当前工作目录 cd命令使用指南
34 0
|
28天前
|
Shell Linux API
【Shell 命令集合 磁盘维护 】Linux 查找指定目录下的所有符号链接文件 symlinks 命令使用教程
【Shell 命令集合 磁盘维护 】Linux 查找指定目录下的所有符号链接文件 symlinks 命令使用教程
31 1
|
28天前
|
存储 Shell Linux
【Shell 命令集合 磁盘管理 】⭐⭐ Linux 显示当前shell会话中的目录栈 dirs命令使用教程
【Shell 命令集合 磁盘管理 】⭐⭐ Linux 显示当前shell会话中的目录栈 dirs命令使用教程
27 0
|
28天前
|
存储 Shell Linux
【Shell 命令集合 磁盘管理 】Linux 从远程磁带设备中删除文件或目录rmt命令使用教程
【Shell 命令集合 磁盘管理 】Linux 从远程磁带设备中删除文件或目录rmt命令使用教程
26 0
|
28天前
|
存储 安全 Shell
⭐⭐⭐【Shell 命令集合 磁盘管理 】Linux 显示当前工作目录的路径 pwd命令使用教程
⭐⭐⭐【Shell 命令集合 磁盘管理 】Linux 显示当前工作目录的路径 pwd命令使用教程
37 0
|
28天前
|
Shell Linux C语言
【Shell 命令集合 磁盘管理 】Linux 删除指定目录下的文件和子目录 mmd命令使用指南
【Shell 命令集合 磁盘管理 】Linux 删除指定目录下的文件和子目录 mmd命令使用指南
35 0
|
28天前
|
Shell Linux Serverless
【Shell 命令集合 磁盘管理 】Linux 显示目录中每个子目录的磁盘使用情况 mdu命令使用教程
【Shell 命令集合 磁盘管理 】Linux 显示目录中每个子目录的磁盘使用情况 mdu命令使用教程
26 0
|
28天前
|
Shell Linux C语言
【Shell 命令集合 磁盘管理 】Linux 创建一个新的目录并将其设为当前工作目录 mcd命令使用教程
【Shell 命令集合 磁盘管理 】Linux 创建一个新的目录并将其设为当前工作目录 mcd命令使用教程
31 0