跳至主要内容

gperftools pprof无侵入的使用

 编译gperftools,make install

然后设置so的位置

export LD_PRELOAD=/usr/local/lib64/libprofiler.so 

最后执行

env CPUPROFILE=test-normal.prof ./testcpp

就有test-normal.prof结果了

剩下的就是

pprof --text testcpp ./test-normal.prof 

或者

pprof --dot testcpp ./test-normal.prof  > test.dot

等等

评论

此博客中的热门博文