使用oprofile

經常使用命令linux

使用oprofile進行cpu使用狀況檢測,須要通過初始化、啓動檢測、導出檢測數據、查看檢測結果等步驟,如下爲經常使用的oprofile命令。 函數

    初始化spa

         opcontrol --no-vmlinux : 指示oprofile啓動檢測後,不記錄內核模塊、內核代碼相關統計數據 進程

         opcontrol --init : 加載oprofile模塊、oprofile驅動程序 it

    檢測控制 test

        opcontrol --start : 指示oprofile啓動檢測 file

        opcontrol --dump : 指示將oprofile檢測到的數據寫入文件 程序

        opcontrol --reset : 清空以前檢測的數據記錄 im

        opcontrol -h : 關閉oprofile進程統計

        opcontrol --stop : 指示oprofile中止檢測 

    查看檢測結果 

        opreport : 以鏡像(image)的角度顯示檢測結果,進程、動態庫、內核模塊屬於鏡像範疇 

        opreport -l : 以函數的角度顯示檢測結果 

        opreport -l test : 以函數的角度,針對test進程顯示檢測結果 

        opannotate -s test : 以代碼的角度,針對test進程顯示檢測結果 

        opannotate -s /lib64/libc-2.4.so : 以代碼的角度,針對libc-2.4.so庫顯示檢測結果

相關文章
相關標籤/搜索