有没有办法指定perf
工具来为可执行文件提供前n条指令的统计信息?感谢
答案 0 :(得分:0)
试试这个
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"
P.S。这都是近似值。并确保删除样本时perf.data页眉和页脚应完好无损