开发工具 内存,性能检测工具

博客介绍了Valgrind和gperftools的下载与安装方法。Valgrind可从官网http://valgrind.org下载;gperftools需先下载安装libunwind,再从git地址https://github.com/gperftools/gperftools下载安装。还给出了执行相关内容,并标注了转载来源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Valgrind下载与安装

1、下载:

valgrind官网:http://valgrind.org下载

2、安装

cd valgrind

 ./autogen.sh

./configure --prefix=...

make

make install

3、执行

/opt/soft/valgrind/bin/valgrind --tool=memcheck --leak-check=full --log-file=./2log.txt ./test [程序参数]

 

gperftools下载与安装 

1、下载及安装libunwind
下载地址: http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz

安装:

./configure --prefix=/home/your_name/tools/libunwind/ CFLAGS=-U_FORTRIFY_SOURCE
make
make install 

2、下载及安装gperftools
git地址:https://github.com/gperftools/gperftools
安装:

./configure --prefix=/home/your_name/tools/gperftools LDFLAGS=-L/home/your_name/tools/libunwind/lib 
CPPFLAGS=-I/home/your_name/tools/libunwind/include make make install

3、执行

//性能检测
env LD_PRELOAD="/opt/soft/gperft/lib/libprofiler.so" CPUPROFILE_FREQUENCY=100 CPUPROFILE=cpu_perf.prof ./test

/opt/soft/gperft/bin/pprof --text ./test cpu_perf.prof > cpu_perf.text

 

转载于:https://www.cnblogs.com/zhanggaofeng/p/10889310.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值