查看: 19|回覆: 0

[Ubuntu] ubuntu环境下安装perf工具

[複製鏈接]

2

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2009-2-2
發表於 2024-3-30 00:09:00 | 顯示全部樓層 |閲讀模式

检查当前环境内核的版本,执行如下命令:

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 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
   c2c             Shared Data C2C/HITM Analyzer.
   config          Get and set variables in a configuration file.
   data            Data file related processing
   diff            Read perf.data files and display the differential profile
   evlist          List the event names in a perf.data file
   ftrace          simple wrapper for kernel's ftrace functionality
   inject          Filter to augment the events stream with additional information
   kallsyms        Searches running kernel for symbols
   kmem            Tool to trace/measure kernel memory 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.
   version         display the version of perf binary
   probe           Define new dynamic tracepoints
   trace           strace inspired tool

 See '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
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部