经常使用命令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库显示检测结果