什么是一个很好的易用的分析器的C ++在Linux上? [英] What is a good easy to use profiler for C++ on Linux?
本文介绍了什么是一个很好的易用的分析器的C ++在Linux上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在Linux上配置一些运行C ++的代码。
I need to profile some code running C++ on Linux. Can you guys recommend some profilers?
推荐答案
使用gprof。
只是编译与 -pg
标志(我认为(但我不知道)你必须关闭优化)虽然。)和使用gprof分析gmon.out文件,您的可执行文件
Just compile with -pg
flag (I think (but am not sure) you have to turn of optimizations though.) and use gprof to analyze the gmon.out file that your executable will then produce.
例如:
gcc -pg -o whatever whatever.c
./whatever
gprof whatever gmon.out
与g ++和cpp相同。
Same thing with g++ and cpp.
这篇关于什么是一个很好的易用的分析器的C ++在Linux上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文