当前位置: 首页 > ops >正文

源码安装gperftools工具

源码安装gperftools工具

下载gperftools源码
https://github.com/gperftools/gperftools/releases/download/gperftools-2.16/gperftools-2.16.tar.gz
在这里插入图片描述
注:需要下载github上release版本,如果直接下载master分支上源码,将可能出现各种编译报错

Linux Centos

[root@localhost gperftools-2.16]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"[root@localhost gperftools-2.16]# 
[root@localhost gb]# pwd
/home/gb
[root@localhost gb]# mkdir build
[root@localhost gb]# tar -zxvf gperftools-2.16.tar.gz
[root@localhost gb]# ls -tlr
-rw-rw-r--. 1 gb   gb    912590 May 17 17:03 libunwind-1.7.2.tar.gz
-rw-rw-r--. 1 gb   gb   2405927 May 17 17:03 gperftools-2.16.tar.gz
drwxrwxr-x. 2 gb   gb         6 May 17 17:04 build
drwxr-xr-x. 9 gb   gb      4096 May 17 17:05 gperftools-2.16
[root@localhost gb]# cd gperftools-2.16/
[root@localhost gperftools-2.16]# ./configure --prefix=/home/gb/build
[root@localhost gperftools-2.16]# make
[root@localhost gperftools-2.16]# make install
[root@localhost gperftools-2.16]# cd ../
[root@localhost gb]# ls -tlr
-rw-rw-r--.  1 gb   gb    912590 May 17 17:03 libunwind-1.7.2.tar.gz
-rw-rw-r--.  1 gb   gb   2405927 May 17 17:03 gperftools-2.16.tar.gz
drwxr-xr-x. 10 gb   gb      4096 May 17 17:32 gperftools-2.16
drwxrwxr-x.  6 gb   gb        56 May 17 17:32 build
[root@localhost gb]# cd build/
[root@localhost build]# ls -tlr
total 4
drwxr-xr-x. 2 root root   42 May 17 17:32 bin
drwxr-xr-x. 4 root root   28 May 17 17:32 share
drwxr-xr-x. 3 root root   24 May 17 17:32 include
drwxr-xr-x. 3 root root 4096 May 17 17:32 lib
[root@localhost build]# cd lib
[root@localhost lib]# pwd
/home/gb/build/lib
[root@localhost lib]# ls -tlr
total 92476
-rwxr-xr-x. 1 root root  3046360 May 17 17:32 libtcmalloc_minimal.so.4.5.18
lrwxrwxrwx. 1 root root       29 May 17 17:32 libtcmalloc_minimal.so.4 -> libtcmalloc_minimal.so.4.5.18
lrwxrwxrwx. 1 root root       29 May 17 17:32 libtcmalloc_minimal.so -> libtcmalloc_minimal.so.4.5.18
-rwxr-xr-x. 1 root root     1076 May 17 17:32 libtcmalloc_minimal.la
-rwxr-xr-x. 1 root root  3446608 May 17 17:32 libtcmalloc_minimal_debug.so.4.5.18
lrwxrwxrwx. 1 root root       35 May 17 17:32 libtcmalloc_minimal_debug.so.4 -> libtcmalloc_minimal_debug.so.4.5.18
lrwxrwxrwx. 1 root root       35 May 17 17:32 libtcmalloc_minimal_debug.so -> libtcmalloc_minimal_debug.so.4.5.18
-rwxr-xr-x. 1 root root     1118 May 17 17:32 libtcmalloc_minimal_debug.la
-rwxr-xr-x. 1 root root  5536656 May 17 17:32 libtcmalloc.so.4.5.18
lrwxrwxrwx. 1 root root       21 May 17 17:32 libtcmalloc.so.4 -> libtcmalloc.so.4.5.18
lrwxrwxrwx. 1 root root       21 May 17 17:32 libtcmalloc.so -> libtcmalloc.so.4.5.18
-rwxr-xr-x. 1 root root     1020 May 17 17:32 libtcmalloc.la
-rwxr-xr-x. 1 root root  5899392 May 17 17:32 libtcmalloc_debug.so.4.5.18
lrwxrwxrwx. 1 root root       27 May 17 17:32 libtcmalloc_debug.so.4 -> libtcmalloc_debug.so.4.5.18
lrwxrwxrwx. 1 root root       27 May 17 17:32 libtcmalloc_debug.so -> libtcmalloc_debug.so.4.5.18
-rwxr-xr-x. 1 root root     1062 May 17 17:32 libtcmalloc_debug.la
-rwxr-xr-x. 1 root root  1041968 May 17 17:32 libprofiler.so.0.5.13
lrwxrwxrwx. 1 root root       21 May 17 17:32 libprofiler.so.0 -> libprofiler.so.0.5.13
lrwxrwxrwx. 1 root root       21 May 17 17:32 libprofiler.so -> libprofiler.so.0.5.13
-rwxr-xr-x. 1 root root     1020 May 17 17:32 libprofiler.la
-rwxr-xr-x. 1 root root  5939400 May 17 17:32 libtcmalloc_and_profiler.so.4.6.13
lrwxrwxrwx. 1 root root       34 May 17 17:32 libtcmalloc_and_profiler.so.4 -> libtcmalloc_and_profiler.so.4.6.13
lrwxrwxrwx. 1 root root       34 May 17 17:32 libtcmalloc_and_profiler.so -> libtcmalloc_and_profiler.so.4.6.13
-rwxr-xr-x. 1 root root     1112 May 17 17:32 libtcmalloc_and_profiler.la
-rw-r--r--. 1 root root  8753752 May 17 17:32 libtcmalloc_minimal.a
-rw-r--r--. 1 root root  9812458 May 17 17:32 libtcmalloc_minimal_debug.a
-rw-r--r--. 1 root root 15397860 May 17 17:32 libtcmalloc.a
-rw-r--r--. 1 root root 16341578 May 17 17:32 libtcmalloc_debug.a
-rw-r--r--. 1 root root  2796524 May 17 17:32 libprofiler.a
-rw-r--r--. 1 root root 16630346 May 17 17:32 libtcmalloc_and_profiler.a
drwxr-xr-x. 2 root root      144 May 17 17:32 pkgconfig
[root@localhost lib]# 

Linux ARM64

[root@localhost gperftools-2.16]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"[root@localhost gperftools-2.16]# 
[root@localhost gb]# pwd
/home/gb
[root@localhost gb]# mkdir build
[root@localhost gb]# tar -zxvf gperftools-2.16.tar.gz
[root@localhost gb]# ls -tlr
-rw-rw-r--. 1 gb   gb    912590 May 17 17:03 libunwind-1.7.2.tar.gz
-rw-rw-r--. 1 gb   gb   2405927 May 17 17:03 gperftools-2.16.tar.gz
drwxrwxr-x. 2 gb   gb         6 May 17 17:04 build
drwxr-xr-x. 9 gb   gb      4096 May 17 17:05 gperftools-2.16
[root@localhost gb]# cd gperftools-2.16/
#设置交叉工具链安装的目录
[root@localhost gb]# export PATH=$PATH:/opt/chain_tool/gcc_arm_10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin
[root@localhost gperftools-2.16]# ./configure --host=aarch64-none-linux-gnu --prefix=/home/gb/build
[root@localhost gperftools-2.16]# make
[root@localhost gperftools-2.16]# make install
[root@localhost gperftools-2.16]# cd ../
[root@localhost gb]# ls -tlr
-rw-rw-r--.  1 gb   gb    912590 May 17 17:03 libunwind-1.7.2.tar.gz
-rw-rw-r--.  1 gb   gb   2405927 May 17 17:03 gperftools-2.16.tar.gz
drwxr-xr-x. 10 gb   gb      4096 May 17 17:32 gperftools-2.16
drwxrwxr-x.  6 gb   gb        56 May 17 17:32 build
[root@localhost gb]# cd build/
[root@localhost build]# ls -tlr
total 4
drwxr-xr-x. 2 root root   42 May 17 17:32 bin
drwxr-xr-x. 4 root root   28 May 17 17:32 share
drwxr-xr-x. 3 root root   24 May 17 17:32 include
drwxr-xr-x. 3 root root 4096 May 17 17:32 lib
[root@localhost build]# cd lib
[root@localhost lib]# pwd
/home/gb/build/lib
[root@localhost lib]# ls -tlr
total 92476
-rwxr-xr-x. 1 root root  3046360 May 17 17:32 libtcmalloc_minimal.so.4.5.18
lrwxrwxrwx. 1 root root       29 May 17 17:32 libtcmalloc_minimal.so.4 -> libtcmalloc_minimal.so.4.5.18
lrwxrwxrwx. 1 root root       29 May 17 17:32 libtcmalloc_minimal.so -> libtcmalloc_minimal.so.4.5.18
-rwxr-xr-x. 1 root root     1076 May 17 17:32 libtcmalloc_minimal.la
-rwxr-xr-x. 1 root root  3446608 May 17 17:32 libtcmalloc_minimal_debug.so.4.5.18
lrwxrwxrwx. 1 root root       35 May 17 17:32 libtcmalloc_minimal_debug.so.4 -> libtcmalloc_minimal_debug.so.4.5.18
lrwxrwxrwx. 1 root root       35 May 17 17:32 libtcmalloc_minimal_debug.so -> libtcmalloc_minimal_debug.so.4.5.18
-rwxr-xr-x. 1 root root     1118 May 17 17:32 libtcmalloc_minimal_debug.la
-rwxr-xr-x. 1 root root  5536656 May 17 17:32 libtcmalloc.so.4.5.18
lrwxrwxrwx. 1 root root       21 May 17 17:32 libtcmalloc.so.4 -> libtcmalloc.so.4.5.18
lrwxrwxrwx. 1 root root       21 May 17 17:32 libtcmalloc.so -> libtcmalloc.so.4.5.18
-rwxr-xr-x. 1 root root     1020 May 17 17:32 libtcmalloc.la
-rwxr-xr-x. 1 root root  5899392 May 17 17:32 libtcmalloc_debug.so.4.5.18
lrwxrwxrwx. 1 root root       27 May 17 17:32 libtcmalloc_debug.so.4 -> libtcmalloc_debug.so.4.5.18
lrwxrwxrwx. 1 root root       27 May 17 17:32 libtcmalloc_debug.so -> libtcmalloc_debug.so.4.5.18
-rwxr-xr-x. 1 root root     1062 May 17 17:32 libtcmalloc_debug.la
-rwxr-xr-x. 1 root root  1041968 May 17 17:32 libprofiler.so.0.5.13
lrwxrwxrwx. 1 root root       21 May 17 17:32 libprofiler.so.0 -> libprofiler.so.0.5.13
lrwxrwxrwx. 1 root root       21 May 17 17:32 libprofiler.so -> libprofiler.so.0.5.13
-rwxr-xr-x. 1 root root     1020 May 17 17:32 libprofiler.la
-rwxr-xr-x. 1 root root  5939400 May 17 17:32 libtcmalloc_and_profiler.so.4.6.13
lrwxrwxrwx. 1 root root       34 May 17 17:32 libtcmalloc_and_profiler.so.4 -> libtcmalloc_and_profiler.so.4.6.13
lrwxrwxrwx. 1 root root       34 May 17 17:32 libtcmalloc_and_profiler.so -> libtcmalloc_and_profiler.so.4.6.13
-rwxr-xr-x. 1 root root     1112 May 17 17:32 libtcmalloc_and_profiler.la
-rw-r--r--. 1 root root  8753752 May 17 17:32 libtcmalloc_minimal.a
-rw-r--r--. 1 root root  9812458 May 17 17:32 libtcmalloc_minimal_debug.a
-rw-r--r--. 1 root root 15397860 May 17 17:32 libtcmalloc.a
-rw-r--r--. 1 root root 16341578 May 17 17:32 libtcmalloc_debug.a
-rw-r--r--. 1 root root  2796524 May 17 17:32 libprofiler.a
-rw-r--r--. 1 root root 16630346 May 17 17:32 libtcmalloc_and_profiler.a
drwxr-xr-x. 2 root root      144 May 17 17:32 pkgconfig

参考文献

gperftools源码下载直址
Linux代码性能分析工具
C++ 性能分析的实战指南(gperftools工具)
性能测试工具gperftools使用
使用gperftools对程序进行性能分析
交叉编译 gperftools 及使用
Gperftools交叉编译
gperftools 编译教程

http://www.xdnf.cn/news/6922.html

相关文章:

  • AI Agent | Coze 插件使用指南:从功能解析到实操步骤
  • 湖北理元理律师事务所:债务优化中的双维支持实践解析
  • 【HCIA】聚合VLAN
  • 蓝牙HFP协议概述
  • 开源项目实战学习之YOLO11:12.1 ultralytics-models-sam-blocks.py源码
  • 【Spring】Spring的请求处理
  • Spring-boot初次使用
  • 2.单链表两数相加(java)
  • 记录算法笔记(2025.5.17)验证二叉搜索树
  • 题单:表达式求值1
  • LVGL- Calendar 日历控件
  • [YOLO模型](4)YOLO V3的介绍
  • 基于STM32_HAL库的SPI通信并驱动W25Q64存储模块
  • RK3588 MNN CPU/Vulkan/OpenCL ResNet50推理测试
  • FreeRTOS的学习记录(任务创建,任务挂起)
  • 【数据结构】_二叉树
  • MyBatis 核心组件源码分析
  • JS逆向-某易云音乐下载器
  • 安卓 Audio Stream 类型
  • 【找工作系列①】【大四毕业】【复习】巩固JavaScript,了解ES6。
  • 复旦微FMQL调试笔记:PS网口
  • 大模型学习:Deepseek+dify零成本部署本地运行实用教程(超级详细!建议收藏)
  • 【LUT技术专题】针对降噪优化的通道感知轻量级LUT算法:DnLUT
  • C/C++实践(十)C语言冒泡排序深度解析:发展历史、技术方法与应用场景
  • cadence安装license manager无法开启,显示并行配置不正确
  • 20250517让NanoPi NEO core开发板在Ubuntu core16.04.2下支持TF卡的热插拔
  • Linux中的域名解析服务器
  • Linux下Nginx源码安装步骤详解
  • 告别 pip:使用 uv 加速你的 Python 包管理
  • Android Studio报错Cannot parse result path string: