国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Linux > 正文

Linuxoprofile命令

2024-06-28 14:33:07
字體:
供稿:網(wǎng)友

一、簡介

oPRofile是linux平臺上的一個功能強大的性能分析工具,支持兩種采樣(sampling)方式:基于事件的采樣(eventbased)和基于時間的采樣(timebased),它可以工作在不同的體系結(jié)構(gòu)上,包括MipS、ARM、IA32、IA64和AMD。

 

二、安裝

1)打開內(nèi)核OPROFILE選項,否則運行oProfile將提示:

[root@localhost oprofile-0.9.6]# opcontrol --init FATAL: Module oprofile not found. FATAL: Module oprofile not found. Kernel doesn't support oprofile
2)編輯內(nèi)核配置文件:.config,將其中的# CONFIG_OPROFILE is not set改為CONFIG_OPROFILE=m(或者y)
[root@localhost ~]# cd /usr/src/linux-2.6.37.2 [root@localhost linux-2.6.37.2]# vi .config

如下:

CONFIG_PROFILING=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_PCI_IOAPIC=y

3)編譯內(nèi)核并重啟機器

http://www.linuxidc.com/Linux/2014-10/108768.htm

4)下載源碼,編譯安裝

wget http://cznic.dl.sourceforge.net/project/oprofile/oprofile/oprofile-1.0.0/oprofile-1.0.0.tar.gz
tar -zxvf oprofile-1.0.0.tar.gzcd oprofile-1.0.0./configuremakemake install

 

三、工具集

ophelp:    列出所有支持的事件。opcontrol:  設(shè)置需要收集的事件。opreport:   對結(jié)果進行統(tǒng)計輸出。opannaotate:產(chǎn)生帶注釋的源/匯編文件,源語言級的注釋需要編譯源文件時的支持。opstack:     產(chǎn)生調(diào)用圖profile,但要求x86/2.6的平臺,并且linux2.6安裝了call-graph patchopgprof:     產(chǎn)生如gprof相似的結(jié)果。oparchive:   將所有的原始數(shù)據(jù)文件收集打包,可以到另一臺機器上進行分析。op_import:   將采樣的數(shù)據(jù)庫文件從另一種abi轉(zhuǎn)化成本地格式。

 

四、使用步驟

1)啟動檢測

modprobe oprofile timer=1 opcontrol --no-vmlinuxopcontrol --separate=kernelopcontrol --init opcontrol --reset opcontrol –start

2)運行程序

運行測試程序

3)停止檢測

opcontrol --dumpopcontrol --stopopcontrol --shutdownopcontrol --deinit

4)檢測結(jié)果

opreportopreport -l ./testopannotate --source ./test

 

五、oprofile實例

1)應(yīng)用程序性能測試

http://www.CUOXin.com/bangerlee/archive/2012/08/30/2659435.html

2)內(nèi)核模塊性能測試

http://www.oenhan.com/oprofile-cpu-analysis

 

六、常見問題

1)oprofile抓不到數(shù)據(jù)

http://blog.csdn.net/cybertan/article/details/8015611

 

參考:http://blog.chinaunix.net/uid-21768364-id-186057.html
     http://www.CUOXin.com/bangerlee/archive/2012/08/30/2659435.html
     http://www.oenhan.com/oprofile-cpu-analysis

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 汤原县| 横峰县| 平顶山市| 钦州市| 嫩江县| 行唐县| 攀枝花市| 贡觉县| 惠安县| 定结县| 苍溪县| 田阳县| 安阳县| 柳州市| 大余县| 定边县| 鹿泉市| 阳高县| 双城市| 荃湾区| 青田县| 陆丰市| 扎鲁特旗| 大同市| 梅河口市| 吴桥县| 武隆县| 金昌市| 红桥区| 雷州市| 司法| 长泰县| 平顺县| 忻州市| 丰都县| 富平县| 平潭县| 内黄县| 花莲县| 乌拉特后旗| 建德市|