使用gperftools分析
配置环境
perftools:http://code.google.com/p/gperftools/downloads/list
libunwind:http://download.savannah.gnu.org/releases/libunwind/
64位操作系统需要安装libunwind,官方推荐版本是libunwind-0.99-beta
安装过程:
./configure
make
make install
配置环境变量
export LD_LIBRARY_PATH=/usr/local/lib
Demo
test.cc