Linux perf命令

perf是一款集成于Linux内核(2.6+)性能分析工具。这里所用平台:RHEL6 64bit

安装

perf是随着Linux内核(2.6+)代码一起发布的,安装很简单,默认安装没有激活TUI(text-based user interface)选项的,如果要激活TUI选项,前提是要安装newt-devel RPM包。

[root@rhel6164 ~]# rpm -qa | grep newt-devel
newt-devel-0.52.11-2.el6.x86_64 #如果要激活perf的TUI选项,就要提前安装newt-devel包
[root@rhel6164 ~]# cd linux-3.10.34/tools/perf/ #进入内核perf目录
[root@rhel6164 perf]# make #直接编译perf
[root@rhel6164 perf]# make install DESTDIR="installation_path" #不用默认安装路径,指定安装路径到“installation_path"
[root@rhel6164 perf]# perf --version
perf version 3.10.34
使用

直接在输入perf就可以看到perf的使用说明

[root@rhel6164 ~]# perf

 usage: perf [--version] [--help] COMMAND [ARGS]

 The most commonly used perf commands are:
   annotate        Read perf.data (created by perf record) and display annotated code
   archive         Create archive with object files with build-ids found in perf.data file
   bench           General framework for benchmark suites
   buildid-cache   Manage build-id cache.
   buildid-list    List the buildids in a perf.data file
   diff            Read two perf.data files and display the differential profile
   evlist          List the event names in a perf.data file
   inject          Filter to augment the events stream with additional information
   kmem            Tool to trace/measure kernel memory(slab) properties
   kvm             Tool to trace/measure kvm guest os
   list            List all symbolic event types
   lock            Analyze lock events
   mem             Profile memory accesses
   record          Run a command and record its profile into perf.data
   report          Read perf.data (created by perf record) and display the profile
   sched           Tool to trace/measure scheduler properties (latencies)
   script          Read perf.data (created by perf record) and display trace output
   stat            Run a command and gather performance counter statistics
   test            Runs sanity tests.
   timechart       Tool to visualize total system behavior during a workload
   top             System profiling tool.
   trace           strace inspired tool
   probe           Define new dynamic tracepoints

 See 'perf help COMMAND' for more information on a specific command.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值