最近要看一下一个程序的性能,计划用google perftools测试一下.下面是我安装的过程一个流水说明,没有含量,我就是看着耍.在git上https://github.com/gperftools/gperftools下载下来,我这里版本是gperftools-2.5.tar.gz,解压后进入目前,看INSTLL,发现这里有一段话:
*** NOTE FOR 64-BIT LINUX SYSTEMS
The glibc built-in stack-unwinder on 64-bit systems has some problems
with the perftools libraries. (In particular, the cpu/heap profiler
may be in the middle of malloc, holding some malloc-related locks when
they invoke the stack unwinder. The built-in stack unwinder may call
malloc recursively, which may require the thread to acquire a lock it
already holds: deadlock.)
For that reason, if you use a 64-bit system, we strongly recommend you
install libunwind before trying to configure or install gperftools.
明显啊,要安装 libunwind.这个好办
lhw@lhw:~/projects/gperftools-2.5$ sudo apt-cache search libunwind
android-libunwind - libunwind for Android
android-libunwind-dev - libunwind for Android - Development files
libunwind-dev - library to determine the call-chain of a program - development
libunwind-setjmp0 - libunwind-based non local goto - runtime
libunwind-setjmp0-dbg - libunwind-based non local goto - runtime
libunwind-setjmp0-dev - libunwind-based non local goto - development
libunwind8 - library to determine the call-chain of a program - runtime
libunwind8-dbg - library to determine the call-chain of a program - runtime
libunwind8-dev - library to determine the call-chain of a program - development
直接安装
sudo apt-get install libunwind-dev
很有可能直接安装libunwind8就可以了,不用安装开发者版本的.但我也觉得多安点还好,不洁癖,装上也不大,直接装了.
然后就
.configure
make
sudo make install
然后就搞定了.