官方主页:http://perfmon2.sourceforge.net/ 点击那个here的超链接就能下载。
git主页: https://sourceforge.net/p/perfmon2/libpfm4/ci/master/tree/
This package provides a library, called libpfm4 which is used to develop monitoring tools exploiting the performance monitoring events such as those provided by the Performance Monitoring Unit (PMU) of modern processors.
安装步骤:
下载以后
tar zxvf libpfm-4.7.0.tar.gz
cd libpfm-4.7.0
make
make install
然后可以去执行perf_exampler下的一些文件。
如果本地.c文件,则
cc -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/ubuntu/libpfm-4.7.0/perf_examples/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -I. -D_GNU_SOURCE -pthread -c xxx.c
生成xxx.o
cc -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/ubuntu/libpfm-4.7.0/perf_examples/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -I. -D_GNU_SOURCE -pthread -o xxx xxx.o perf_util.o /home/ubuntu/libpfm-4.7.0/perf_examples/../lib/libpfm.a
生成可执行文件