助力软件开发企业降本增效 PHP / java源码系统,只需一次付费,代码终身使用! 广告
[TOC] > [参考](https://blog.csdn.net/irving512/article/details/117077847) > https://gperftools.github.io/gperftools/cpuprofile.html ## gperftools 概述 yum ``` gperftools ``` **使用** 在程序编译时候添加`-lprofiler` **注意** 对于服务类型的程序需要使用 `kill 程序名`停止,而不是 `Ctrl+c`或 `kill -9` ## 示例 ``` // 生成配置文件 > CPUPROFILE=data.prof./myprogram > kill pid > pprof data.prof --svg > prof.svg ``` 效果图 ![](https://gperftools.github.io/gperftools/pprof-test.gif)