本文主要是介绍ubuntu环境下安装perf工具,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
检查当前环境内核的版本,执行如下命令:
uname -a
输出信息如下:
Linux jackie-ubuntu 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
安装perf
工具,执行如下命令:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get install linux-tools-common linux-tools-$(uname -r)
查看perf
工具的版本,执行如下命令:
perf --version
输出信息如下:
perf version 5.4.30
查看perf
命令的使用帮助,输出信息如下:
usage: perf [--version] [--help] [OPTIONS] COMMAND [ARGS]The most commonly used perf commands are:annotate Read perf.data (created by perf record) and display annotated codearchive Create archive with object files with build-ids found in perf.data filebench General framework for benchmark suitesbuildid-cache Manage build-id cache.buildid-list List the buildids in a perf.data filec2c Shared Data C2C/HITM Analyzer.config Get and set variables in a configuration file.data Data file related processingdiff Read perf.data files and display the differential profileevlist List the event names in a perf.data fileftrace simple wrapper for kernel's ftrace functionalityinject Filter to augment the events stream with additional informationkallsyms Searches running kernel for symbolskmem Tool to trace/measure kernel memory propertieskvm Tool to trace/measure kvm guest oslist List all symbolic event typeslock Analyze lock eventsmem Profile memory accessesrecord Run a command and record its profile into perf.datareport Read perf.data (created by perf record) and display the profilesched Tool to trace/measure scheduler properties (latencies)script Read perf.data (created by perf record) and display trace outputstat Run a command and gather performance counter statisticstest Runs sanity tests.timechart Tool to visualize total system behavior during a workloadtop System profiling tool.version display the version of perf binaryprobe Define new dynamic tracepointstrace strace inspired toolSee 'perf help COMMAND' for more information on a specific command.
参考资料
- ubuntu中安装perf
- 学会使用perf性能分析工具(含移植到arm-linux开发板)
- 手把手教你系统级性能分析工具perf的介绍与使用(超详细)
- 【Ubuntu】 Perf工具的使用
- perf性能分析工具使用分享
- Perf – Linux下的系统性能调优工具
- Linux kernel profiling with perf
- Perfcounters added to the mainline
- Performance Counters on Linux The New Tools
这篇关于ubuntu环境下安装perf工具的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!