编译Performance Co-Pilot(PCP)

编译Intel PCM 一样,由于需要在遗留的CentOS 7.2环境构建最新的 Performance Co-Pilot(PCP) ,以实现高级功能:

  • 服务器内核已经升级到 4.19 ,支持 eBPF ,所以目标是构建支持 bpftrace 的PCP

编译

  • PCP源代码针对不同的操作系统和软件包组合,所以在编译前需要做一些调整

  • 软件包依赖:

    • 硬构建依赖: 没有这些依赖PCP就无法从源代码完成古偶见,并且构建将在编译货打包过程中失败,如 gmake, autoconf, flex, bison ...

    • 可选构建依赖: 如果没有没有安装这些组件,则构建虽然能够完成,但生成的软件包可能古恶少一些功能,例如 扩展身份验证,安全连接,服务发现,REST API...

    • QA依赖: 可以忽略这些依赖,除非想运行(广泛的) PCP QA

  • 强烈建议运行检查脚本:

首先运行检查系统的脚本
qa/admin/check-vm

不过这个输出信息比较繁杂,所以可以改为使用以下命令精简输出(-b for basic packages, -f to not try to guess Python, Perl, ... version and -p to output just package names),就能够获得系统需要安装哪些软件包来满足编译要求:

运行检查系统的脚本精简输出,获得系统需要安装的软件包名
qa/admin/check-vm -bfp

输出如下:

运行检查系统的脚本输出结果
Warning: manifest:237 botch? target: "cpan" not found, but package "perl" already installed
Warning: manifest:586 botch? target: "ExtUtils::MakeMaker" not found, but package "perl" already installed
cpan(Net::SNMP) cpan(Spreadsheet::WriteExcel) cpan(XML::TokeParser) cpan(YAML::LibYAML) ncurses-devel perl-CPAN perl-Date-Manip perl-ExtUtils-MakeMaker perl-JSON perl-LDAP perl-Net-SNMP perl-Spreadsheet-WriteExcel perl-TimeDate perl-XML-TokeParser perl-YAML-LibYAML perl-ldap perl-libwww-perl perl-rrdtool platform-python-devel postfix-perl-scripts python3-devel python3-jsonpointer python3-psycopg2 python3-pyodbc python3-rtslib python3-rtslib-fb python3-six python36-devel python36-six ragel readline-devel rrdtool rrdtool-perl

不过,对于CentOS 7.2,很多包并没有对应:

CentOS 7,2尝试安装出错
No match for argument: perl-Net-SNMP
No match for argument: perl-Spreadsheet-WriteExcel
No match for argument: perl-YAML-LibYAML
  * Maybe you meant: perl-LDAP
No match for argument: perl-ldap
No match for argument: platform-python-devel
No match for argument: python3-jsonpointer
No match for argument: python3-psycopg2
No match for argument: python3-pyodbc
No match for argument: python3-rtslib
No match for argument: python3-rtslib-fb
No match for argument: python3-six
No match for argument: python36-six
No match for argument: ragel
Error: Unable to find a match: perl-Net-SNMP perl-Spreadsheet-WriteExcel perl-YAML-LibYAML perl-ldap platform-python-devel python3-jsonpointer python3-psycopg2 python3-pyodbc python3-rtslib python3-rtslib-fb python3-six python36-six ragel

所以实际补安装的软件包如下:

CentOS 7,2补安装软件包
yum install ncurses-devel perl-CPAN perl-Date-Manip perl-ExtUtils-MakeMaker perl-JSON \
    perl-TimeDate perl-XML-TokeParser perl-libwww-perl perl-rrdtool postfix-perl-scripts \
    python3-devel python36-devel  readline-devel rrdtool rrdtool-perl \
    python-devel systemd-devel
  • 编译:

编译PCP
./Makepkgs --verbose

错误排查

ERROR: No build ID note found

  • 在执行 Makepkgs 报错:

编译PCP报错: 找不到build ID
...
+ /usr/lib/rpm/find-debuginfo.sh -j16 --strict-build-id -m --build-id-seed 6.1.0-1 --unique-debug-suffix -6.1.0-1.x86_64 --unique-debug-src-base pcp-6.1.0-1.x86_64 --run-dwz --dwz-low-mem-die-limit 10000000 --dwz-max-die-limit 110000000 /home/huatai.huang/pcp/pcp-6.1.0/pcp-6.1.0
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/schizo/pmdaschizo-A
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/dynamic/pmdadynamic
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/bigun/bigun.so
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/src/libnvidia-ml.so
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_2
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_4
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/schizo/pmdaschizo-B
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_3
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_0
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_1
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmclient
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/github-56/pmdatrivial
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmpython
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmlogmv
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_5
extracting debug info from /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmlogger
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmpython
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_1
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_3
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_0
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/schizo/pmdaschizo-A
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_4
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/src/libnvidia-ml.so
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_2
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/bigun/bigun.so
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/github-56/pmdatrivial
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/dynamic/pmdadynamic
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/schizo/pmdaschizo-B
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/var/lib/pcp/testsuite/pmdas/broken/broken_pmda_2_5
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmclient
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmlogmv
*** ERROR: No build ID note found in /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmlogger
/usr/lib/rpm/find-debuginfo.sh: line 474: /tmp/find-debuginfo.sjDcdE/res.*: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.MkmfED (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.MkmfED (%install)
make: *** [pack_pcp] Error 1
make: Leaving directory `/home/huatai.huang/pcp/pcp-6.1.0/build/rpm'

实际检查可以看到,这些二进制执行文件都已经编译好了,例如 /home/huatai.huang/pcp/pcp-6.1.0/BUILDROOT/pcp-6.1.0-1.x86_64/usr/bin/pmlogger ,只不过

参考