linux - 性能工具 - 前 n 条指令的配置文件

标签 linux perf

有没有办法可以指定perf工具来提供可执行文件的前n条指令的统计信息?谢谢

最佳答案

试试这个

1. perf record -e instructions -c no_of_instrucitons executable_path
2. sudo perf report -D -i perf.data > test
3. vi test
4. Search for "PERF_RECORD_SAMPLE" string
5. This string should be repeated the number of times equal to the samples taken throughout the execution of the binary
6. If you remove the samples other than the first one and rename test to perf.data you should have the results after "perf report" 

附注这都是近似值。并确保删除样本时 perf.data 页眉和页脚应完好无损

关于linux - 性能工具 - 前 n 条指令的配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26813074/

相关文章:

linux - 如何在 Ubuntu 的 IDEA 中设置 git 方式?

linux - 从某一行开始对文件进行排序

linux - 为什么即使我使用了 signl(SIGINT, sig_int) 它也会终止?

linux - 如何过滤掉02个文件之间重复的id

linux - 如何测量与文件相关的系统调用在性能中花费了多长时间?

c++ - 在 perf 中分析 c++ 程序

linux-kernel - perf_event_paranoid == 1 实际上对 x86 perf 施加了什么限制?

linux - 使用 linux perf 实用程序每秒报告计数器,如 vmstat

c++ - C++ 服务器 Linux 计算机上的段错误 - 适用于 Mac

perf - 使用 -r 和 -x 运行时 perf-stat 中的列是什么