有没有办法可以指定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/