跳至主要内容

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

等等

评论

此博客中的热门博文

ubuntu 添加root登录

Login to your server as root. As the root user, edit the sshd_config file found in  /etc/ssh/sshd_config : vim /etc/ssh/sshd_config ( For details on working with Vim check out our article here !) Add the following line to the file, you can add it anywhere but it’s good practice to find the block about authentication and add it there. PermitRootLogin yes Save and exit the file. Restart the SSH server: systemctl restart sshd or service sshd restart