当前位置:网站首页>Performance optimization analysis tool | perf
Performance optimization analysis tool | perf
2022-07-29 10:16:00 【zuhan_ twenty million two hundred and ten thousand three hundre】
perf brief introduction
Perf(Performance Event) yes Linux 2.6.31 Built in performance analysis tool , Compared with others Prof The biggest advantage of the tool lies in its connection with Linux Kernel Close combination , It can analyze the performance of kernel and even hardware . Through it , Applications can take advantage of PMU(Performance Monitor Unit)、tracepoint The performance of the kernel and the special counters , It can not only analyze the performance problems of specified applications , You can also analyze the performance problems of the kernel , Thus, we can fully understand the performance bottlenecks in the application .
perf Compile configuration and installation
stay Linux Compile and install in the kernel source code :
#cd Root directory of kernel source code
#cd tools/perf/
#make && make install
#cp perf target_filesystem/bin/
Kernel configuration requirements
- performance Options
General Setup ->
Kernel Performance Events And Counters ->
[*]Kernel performance events and counters
Kernel configuration options : PERF_EVENTS [=y] - profile Options
General Setup ->
[*]Profiling support
Kernel configuration options : PROFILING [=y] - drivers Options
Device Drivers->
Performance monitor support->
[*]ARM PMU framework
Kernel configuration options :ARM PMU framework[=y] - Device tree pmu Node requirements
edit ft2000plus.dts, stay / Add under node pmu node :
pmu {
compatible = “arm,armv8-pmuv3”;
interrupts = <1 7 4>;
};
explain :PMU(Performance Monitoring Unit) It's all CPU Manufacturer with CPU Hardware provided , It allows software to target certain CPU Hardware events ( Such as cache miss, branch-misses, instructions) Set up counter, And count the number of this event , When the number reaches counter After value , The interrupt . Software inspects by capturing these interrupts CPU usage .
perf Common commands

perf stat
perf stat Is used to run instructions , And analyze the statistical results , The information of the whole life cycle of application can be completely counted .
The command format is :perf stat [ options] [command]
tat means statistic or counting.
In fact, it's statistics 、 Count .
Common options :
• -a: counting for entire system.
• -I: Print count deltas every N milliseconds (minimum: 1ms)
• -C: Appoint core.
perf top
Display the occupation of each function cpu The proportion .
perf record
perf record It is used to record more granular statistical information , And save to file . For example, you can record statistics at the level of a single function ,
And use perf report To display the statistics .
The command format is :perf record [options] [command]
or perf record [options] – command [options]
• -F: Sampling frequency , adopt -F To specify the
• -c :Event period to sample.
• -g: Record function call stack
perf report
perf report Yes, it will perf record The generated file is parsed and displayed . The result is similar to perf top Real time display of .
The command format is :perf report [options]
to perf record Generated perf.data Data display .
Some commands used for debugging in the project
1、
perf stat -r 5 -e cache-misses,cache-references,instructions,cycles,L1-dcache-stores,L1-dcache-store-misses -C 8
2、
perf record -e cache-misses -C 8
3、
perf top -C 8
perf top -g -C 8
Reference link
Video link : https://www.bilibili.com/video/BV1hK4y1A7U4?spm_id_from=333.337.search-card.all.click&vd_source=9a8a120f260b2f6555d727c9d48cf27d
perf Related information :
link :https://pan.baidu.com/s/15ER6N3azPm0cv1i0mG1QkQ
Extraction code :lbqq
边栏推荐
- Summary of window system operation skills
- Read Plato farm's eplato and the reason for its high premium
- [jetson][reprint]pycharm installed on Jetson
- Function - (C travel notes)
- 读博后降维打击数学建模!
- Reasons for the rise of DDD and its relationship with microservices
- TCP failure model
- MySQL infrastructure: SQL query statement execution process
- Comprehensive and detailed SQL learning guide (MySQL direction)
- What is Cartland number? What are the applications?
猜你喜欢

Hanyuan high tech Gigabit 2-optical 6-conductor rail managed Industrial Ethernet switch supports X-ring redundant ring network one key ring network switch

英特尔联合Datawhale,发布学习项目!

Efficient 7 habit learning notes

ECCV 2022 | CMU提出在视觉Transformer上进行递归,不增参数,计算量还少

ORBSLAM2安装测试,及各种问题汇总

【论文阅读】I-BERT: Integer-only BERT Quantization

Shell笔记(超级完整)

This developer, who has been on the list for four consecutive weeks, has lived like a contemporary college student

机器学习入门的百科全书-2018年“机器学习初学者”公众号文章汇总

Vector implementation
随机推荐
Dynamics 365Online 如何自定义商机关闭窗体
English语法_不定代词 - 常用短语
shell编程之sed,正则表达式
SkiaSharp 之 WPF 自绘 弹动小球(案例版)
CS research assurance experience in 2021 (VI): system filling + some thoughts
[HFCTF 2021 Final]easyflask
[dark horse morning post] Youxian responded to the dissolution every day, and many places have been unable to place orders; Li Bin said that Wei Lai will produce a mobile phone every year; Li Ka Shing
TMS320C6000_ Tms320f28035 Chinese data manual
Are you familiar with the redis cluster principle of high paid programmers & interview questions series 122? How to ensure the high availability of redis (Part 2): cluster mechanism and principle, clu
[ts]Typescript学习记录坑点合集
How to customize the opportunity closing form in dynamics 365online
This developer, who has been on the list for four consecutive weeks, has lived like a contemporary college student
This is an incomplete data competition Yearbook!
[fortran]vscode配置fortran跑hello world
Orbslam2 installation test and summary of various problems
智慧解决问题
最新翻译的官方PyTorch简易入门教程(PyTorch1.0版本)
[Yugong series] go teaching course 010 in July 2022 - Boolean and character types of data types
Tips of Day1 practice in 2022cuda summer training camp
这是一份不完整的数据竞赛年鉴!