diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fcbb48d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/pcp-5.3.5.src.tar.gz diff --git a/EMPTY b/EMPTY deleted file mode 100644 index 0519ecb..0000000 --- a/EMPTY +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/pcp.spec b/pcp.spec new file mode 100644 index 0000000..d0d6cc6 --- /dev/null +++ b/pcp.spec @@ -0,0 +1,4177 @@ +Name: pcp +Version: 5.3.5 +Release: 8%{?dist} +Summary: System-level performance monitoring and performance management +License: GPLv2+ and LGPLv2+ and CC-BY +URL: https://pcp.io + +%global artifactory https://performancecopilot.jfrog.io/artifactory +Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz + +Patch0: redhat-bugzilla-2017632.patch +Patch1: redhat-bugzilla-2029301.patch +Patch2: redhat-bugzilla-2030121.patch +Patch3: redhat-bugzilla-2027753.patch +Patch4: redhat-bugzilla-2030140.patch +Patch5: redhat-bugzilla-2003956.patch +Patch6: redhat-bugzilla-2003956-pmdabcc-update-kernel-version-check-due-to-backporting.patch +Patch7: redhat-bugzilla-1973833.patch +Patch8: redhat-bugzilla-1991763.patch + +%if 0%{?fedora} >= 26 || 0%{?rhel} > 7 +%global __python2 python2 +%else +%global __python2 python +%endif + +# UsrMerge was completed in EL 7, however the latest 'hostname' package in EL 7 contains "Provides: /bin/hostname" +%if 0%{?rhel} >= 8 || 0%{?fedora} >= 17 +%global _hostname_executable /usr/bin/hostname +%else +%global _hostname_executable /bin/hostname +%endif + +%global disable_perl 0 + +%if 0%{?fedora} || 0%{?rhel} > 5 +%global disable_selinux 0 +%else +%global disable_selinux 1 +%endif + +%global disable_snmp 0 + +# No libpfm devel packages for s390, armv7hl nor for some rhels, disable +%ifarch s390 s390x armv7hl +%global disable_perfevent 1 +%else +%if 0%{?fedora} >= 20 || 0%{?rhel} > 6 +%global disable_perfevent 0 +%else +%global disable_perfevent 1 +%endif +%endif + +%global disable_podman 0 + +# libchan, libhdr_histogram and pmdastatsd +%if 0%{?fedora} >= 29 || 0%{?rhel} > 7 +%global disable_statsd 0 +%else +%global disable_statsd 1 +%endif + +%if 0%{?fedora} >= 30 || 0%{?rhel} > 7 +%global _with_python2 --with-python=no +%global disable_python2 1 +%else +%global disable_python2 0 +%endif + +# Default for epel5 is python24, so use the (optional) python26 packages +%if 0%{?rhel} == 5 +%global default_python 26 +%endif +# No python3 development environment before el8 +%if 0%{?rhel} == 0 || 0%{?rhel} > 7 +%global disable_python3 0 +# Do we wish to mandate python3 use in pcp? (f22+ and el8+) +%if 0%{?fedora} >= 22 || 0%{?rhel} > 7 +%global default_python 3 +%endif +%else +%global disable_python3 1 +%endif + +%if 0%{?fedora} >= 24 || 0%{?rhel} > 7 +%global perl_interpreter perl-interpreter +%else +%global perl_interpreter perl +%endif + +# support for pmdabcc, check bcc.spec for supported architectures of bcc +%if 0%{?fedora} >= 25 || 0%{?rhel} > 6 +%ifarch x86_64 %{power64} aarch64 s390x +%global disable_bcc 0 +%else +%global disable_bcc 1 +%endif +%else +%global disable_bcc 1 +%endif + +# support for pmdabpf, check bpf.spec for supported architectures of bpf +%if 0%{?fedora} >= 33 || 0%{?rhel} > 8 +%ifarch x86_64 %{power64} aarch64 s390x +%global disable_bpf 0 +%else +%global disable_bpf 1 +%endif +%else +%global disable_bpf 1 +%endif + +# support for pmdabpftrace, check bpftrace.spec for supported architectures of bpftrace +%if 0%{?fedora} >= 30 || 0%{?rhel} > 7 +%ifarch x86_64 %{power64} aarch64 s390x +%global disable_bpftrace 0 +%else +%global disable_bpftrace 1 +%endif +%else +%global disable_bpftrace 1 +%endif + +# support for pmdajson +%if 0%{?rhel} == 0 || 0%{?rhel} > 6 +%if !%{disable_python2} || !%{disable_python3} +%global disable_json 0 +%else +%global disable_json 1 +%endif +%else +%global disable_json 1 +%endif + +# No mssql ODBC driver on non-x86 platforms +%ifarch x86_64 +%if !%{disable_python2} || !%{disable_python3} +%global disable_mssql 0 +%else +%global disable_mssql 1 +%endif +%else +%global disable_mssql 1 +%endif + +# support for pmdanutcracker (perl deps missing on rhel) +%if 0%{?rhel} == 0 +%global disable_nutcracker 0 +%else +%global disable_nutcracker 1 +%endif + +# Qt development and runtime environment missing components before el6 +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +%global disable_qt 0 +%if 0%{?fedora} != 0 || 0%{?rhel} > 7 +%global default_qt 5 +%endif +%else +%global disable_qt 1 +%endif + +# systemd services and pmdasystemd +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 +%global disable_systemd 0 +%else +%global disable_systemd 1 +%endif + +# static probes, missing before el6 and on some architectures +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +%global disable_sdt 0 +%else +%ifnarch ppc ppc64 +%global disable_sdt 0 +%else +%global disable_sdt 1 +%endif +%endif + +# libuv async event library +%if 0%{?fedora} >= 28 || 0%{?rhel} > 7 +%global disable_libuv 0 +%else +%global disable_libuv 1 +%endif + +%global disable_openssl 0 + +# rpm producing "noarch" packages +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +%global disable_noarch 0 +%else +%global disable_noarch 1 +%endif + +%if 0%{?fedora} >= 24 +%global disable_xlsx 0 +%else +%global disable_xlsx 1 +%endif + +# prevent conflicting binary and man page install for pcp(1) +Conflicts: librapi < 0.16 + +# KVM PMDA moved into pcp (no longer using Perl, default on) +Obsoletes: pcp-pmda-kvm < 4.1.1 +Provides: pcp-pmda-kvm = %{version}-%{release} + +# RPM PMDA retired completely +Obsoletes: pcp-pmda-rpm < 5.3.2 +Obsoletes: pcp-pmda-rpm-debuginfo < 5.3.2 + +# PCP REST APIs are now provided by pmproxy +Obsoletes: pcp-webapi-debuginfo < 5.0.0 +Obsoletes: pcp-webapi < 5.0.0 +Provides: pcp-webapi = %{version}-%{release} + +# PCP discovery service now provided by pmfind +Obsoletes: pcp-manager-debuginfo < 5.2.0 +Obsoletes: pcp-manager < 5.2.0 + +# Some older releases did not update or replace pcp-gui-debuginfo properly +%if 0%{?fedora} < 27 && 0%{?rhel} <= 7 && "%{_vendor}" == "redhat" +Obsoletes: pcp-gui-debuginfo < 4.1.1 +%endif + +Obsoletes: pcp-compat < 4.2.0 +Obsoletes: pcp-monitor < 4.2.0 +Obsoletes: pcp-collector < 4.2.0 +Obsoletes: pcp-pmda-nvidia < 3.10.5 + +# https://fedoraproject.org/wiki/Packaging "C and C++" +BuildRequires: make +BuildRequires: gcc gcc-c++ +BuildRequires: procps autoconf bison flex +BuildRequires: nss-devel +BuildRequires: avahi-devel +BuildRequires: xz-devel +BuildRequires: zlib-devel +%if !%{disable_python2} +%if 0%{?default_python} != 3 +BuildRequires: python%{?default_python}-devel +%else +BuildRequires: %{__python2}-devel +%endif +%endif +%if !%{disable_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +%endif +BuildRequires: ncurses-devel +BuildRequires: readline-devel +BuildRequires: cyrus-sasl-devel +%if !%{disable_statsd} +# ragel unavailable on RHEL8 +%if 0%{?rhel} == 0 +BuildRequires: ragel +%endif +BuildRequires: chan-devel HdrHistogram_c-devel +%endif +%if !%{disable_perfevent} +BuildRequires: libpfm-devel >= 4 +%endif +%if !%{disable_sdt} +BuildRequires: systemtap-sdt-devel +%endif +%if !%{disable_libuv} +BuildRequires: libuv-devel >= 1.0 +%endif +%if !%{disable_openssl} +BuildRequires: openssl-devel >= 1.1.1 +%endif +%if 0%{?rhel} == 0 || 0%{?rhel} > 7 +BuildRequires: perl-generators +%endif +BuildRequires: perl-devel perl(strict) +BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent) perl(JSON) +BuildRequires: perl(Time::HiRes) perl(Digest::MD5) +BuildRequires: perl(XML::LibXML) perl(File::Slurp) +BuildRequires: man %{_hostname_executable} +%if !%{disable_systemd} +BuildRequires: systemd-devel systemd-rpm-macros +%endif +%if !%{disable_qt} +BuildRequires: desktop-file-utils +%if 0%{?default_qt} != 5 +BuildRequires: qt4-devel >= 4.4 +%else +BuildRequires: qt5-qtbase-devel +BuildRequires: qt5-qtsvg-devel +%endif +%endif + +Requires: bash xz gawk sed grep findutils which %{_hostname_executable} +Requires: pcp-libs = %{version}-%{release} +%if !%{disable_selinux} +Requires: pcp-selinux = %{version}-%{release} +%endif + +%global _confdir %{_sysconfdir}/pcp +%global _logsdir %{_localstatedir}/log/pcp +%global _pmnsdir %{_localstatedir}/lib/pcp/pmns +%global _pmnsexecdir %{_libexecdir}/pcp/pmns +%global _tempsdir %{_localstatedir}/lib/pcp/tmp +%global _pmdasdir %{_localstatedir}/lib/pcp/pmdas +%global _pmdasexecdir %{_libexecdir}/pcp/pmdas +%global _testsdir %{_localstatedir}/lib/pcp/testsuite +%global _selinuxdir %{_localstatedir}/lib/pcp/selinux +%global _selinuxexecdir %{_libexecdir}/pcp/selinux +%global _logconfdir %{_localstatedir}/lib/pcp/config/pmlogconf +%global _ieconfdir %{_localstatedir}/lib/pcp/config/pmieconf +%global _tapsetdir %{_datadir}/systemtap/tapset +%global _bashcompdir %{_datadir}/bash-completion/completions +%global _pixmapdir %{_datadir}/pcp-gui/pixmaps +%global _hicolordir %{_datadir}/icons/hicolor +%global _booksdir %{_datadir}/doc/pcp-doc + +%if 0%{?fedora} >= 20 || 0%{?rhel} >= 8 +%global _with_doc --with-docdir=%{_docdir}/%{name} +%endif + +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 +%global _with_dstat --with-dstat-symlink=yes +%global disable_dstat 0 +%else +%global _with_dstat --with-dstat-symlink=no +%global disable_dstat 1 +%endif + +%if !%{disable_systemd} +%global _initddir %{_libexecdir}/pcp/lib +%else +%global _initddir %{_sysconfdir}/rc.d/init.d +%global _with_initd --with-rcdir=%{_initddir} +%endif + +# we never want Infiniband on s390 and armv7hl platforms +%ifarch s390 s390x armv7hl +%global disable_infiniband 1 +%else +# we never want Infiniband on RHEL5 or earlier +%if 0%{?rhel} != 0 && 0%{?rhel} < 6 +%global disable_infiniband 1 +%else +%global disable_infiniband 0 +%endif +%endif + +%if !%{disable_infiniband} +%global _with_ib --with-infiniband=yes +%endif + +%if %{disable_perfevent} +%global _with_perfevent --with-perfevent=no +%else +%global _with_perfevent --with-perfevent=yes +%endif + +%if %{disable_podman} +%global _with_podman --with-podman=no +%else +%global _with_podman --with-podman=yes +%endif + +%if %{disable_statsd} +%global _with_statsd --with-pmdastatsd=no +%else +%global _with_statsd --with-pmdastatsd=yes +%endif + +%if %{disable_bcc} +%global _with_bcc --with-pmdabcc=no +%else +%global _with_bcc --with-pmdabcc=yes +%endif + +%if %{disable_bpf} +%global _with_bpf --with-pmdabpf=no +%else +%global _with_bpf --with-pmdabpf=yes +%endif + +%if %{disable_bpftrace} +%global _with_bpftrace --with-pmdabpftrace=no +%else +%global _with_bpftrace --with-pmdabpftrace=yes +%endif + +%if %{disable_json} +%global _with_json --with-pmdajson=no +%else +%global _with_json --with-pmdajson=yes +%endif + +%if %{disable_nutcracker} +%global _with_nutcracker --with-pmdanutcracker=no +%else +%global _with_nutcracker --with-pmdanutcracker=yes +%endif + +%if %{disable_snmp} +%global _with_snmp --with-pmdasnmp=no +%else +%global _with_snmp --with-pmdasnmp=yes +%endif + +%global pmda_remove() %{expand: +if [ %1 -eq 0 ] +then + PCP_PMDAS_DIR=%{_pmdasdir} + PCP_PMCDCONF_PATH=%{_confdir}/pmcd/pmcd.conf + if [ -f "$PCP_PMCDCONF_PATH" -a -f "$PCP_PMDAS_DIR/%2/domain.h" ] + then + (cd "$PCP_PMDAS_DIR/%2/" && ./Remove >/dev/null 2>&1) + fi +fi +} + +%global install_file() %{expand: +if [ -w "%1" ] +then + (cd "%1" && touch "%2" && chmod 644 "%2") +else + echo "WARNING: Cannot write to %1, skipping %2 creation." >&2 +fi +} + +%global rebuild_pmns() %{expand: +if [ -w "%1" ] +then + (cd "%1" && ./Rebuild -s && rm -f "%2") +else + echo "WARNING: Cannot write to %1, skipping namespace rebuild." >&2 +fi +} + +%global selinux_handle_policy() %{expand: +if [ %1 -ge 1 ] +then + %{_libexecdir}/pcp/bin/selinux-setup %{_selinuxdir} install %2 +elif [ %1 -eq 0 ] +then + %{_libexecdir}/pcp/bin/selinux-setup %{_selinuxdir} remove %2 +fi +} + +%description +Performance Co-Pilot (PCP) provides a framework and services to support +system-level performance monitoring and performance management. + +The PCP open source release provides a unifying abstraction for all of +the interesting performance data in a system, and allows client +applications to easily retrieve and process any subset of that data. + +# +# pcp-conf +# +%package conf +License: LGPLv2+ +Summary: Performance Co-Pilot run-time configuration +URL: https://pcp.io + +# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages" +Conflicts: pcp-libs < 3.9 + +%description conf +Performance Co-Pilot (PCP) run-time configuration + +# +# pcp-libs +# +%package libs +License: LGPLv2+ +Summary: Performance Co-Pilot run-time libraries +URL: https://pcp.io +Requires: pcp-conf = %{version}-%{release} + +%description libs +Performance Co-Pilot (PCP) run-time libraries + +# +# pcp-libs-devel +# +%package libs-devel +License: GPLv2+ and LGPLv2+ +Summary: Performance Co-Pilot (PCP) development headers +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} + +%description libs-devel +Performance Co-Pilot (PCP) headers for development. + +# +# pcp-devel +# +%package devel +License: GPLv2+ and LGPLv2+ +Summary: Performance Co-Pilot (PCP) development tools and documentation +URL: https://pcp.io +Requires: pcp = %{version}-%{release} +Requires: pcp-libs = %{version}-%{release} +Requires: pcp-libs-devel = %{version}-%{release} + +%description devel +Performance Co-Pilot (PCP) documentation and tools for development. + +# +# pcp-testsuite +# +%package testsuite +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) test suite +URL: https://pcp.io +Requires: pcp = %{version}-%{release} +Requires: pcp-libs = %{version}-%{release} +Requires: pcp-libs-devel = %{version}-%{release} +Requires: pcp-devel = %{version}-%{release} +Obsoletes: pcp-gui-testsuite < 3.9.5 +# The following are inherited from pcp-collector and pcp-monitor, +# both of which are now obsoleted by the base pcp package +Requires: pcp-pmda-activemq pcp-pmda-bonding pcp-pmda-dbping pcp-pmda-ds389 pcp-pmda-ds389log +Requires: pcp-pmda-elasticsearch pcp-pmda-gpfs pcp-pmda-gpsd pcp-pmda-lustre +Requires: pcp-pmda-memcache pcp-pmda-mysql pcp-pmda-named pcp-pmda-netfilter pcp-pmda-news +Requires: pcp-pmda-nginx pcp-pmda-nfsclient pcp-pmda-pdns pcp-pmda-postfix pcp-pmda-postgresql pcp-pmda-oracle +Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-zimbra +Requires: pcp-pmda-dm pcp-pmda-apache +Requires: pcp-pmda-bash pcp-pmda-cisco pcp-pmda-gfs2 pcp-pmda-mailq pcp-pmda-mounts +Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping pcp-pmda-smart +Requires: pcp-pmda-hacluster pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-denki pcp-pmda-docker pcp-pmda-bind2 +Requires: pcp-pmda-sockets +%if !%{disable_podman} +Requires: pcp-pmda-podman +%endif +%if !%{disable_statsd} +Requires: pcp-pmda-statsd +%endif +%if !%{disable_nutcracker} +Requires: pcp-pmda-nutcracker +%endif +%if !%{disable_bcc} +Requires: pcp-pmda-bcc +%endif +%if !%{disable_bpf} +Requires: pcp-pmda-bpf +%endif +%if !%{disable_bpftrace} +Requires: pcp-pmda-bpftrace +%endif +%if !%{disable_python2} || !%{disable_python3} +Requires: pcp-pmda-gluster pcp-pmda-zswap pcp-pmda-unbound pcp-pmda-mic +Requires: pcp-pmda-libvirt pcp-pmda-lio pcp-pmda-openmetrics pcp-pmda-haproxy +Requires: pcp-pmda-lmsensors pcp-pmda-netcheck pcp-pmda-rabbitmq +Requires: pcp-pmda-openvswitch pcp-pmda-mongodb +%endif +%if !%{disable_mssql} +Requires: pcp-pmda-mssql +%endif +%if !%{disable_snmp} +Requires: pcp-pmda-snmp +%endif +%if !%{disable_json} +Requires: pcp-pmda-json +%endif +Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog +Requires: pcp-system-tools +%if !%{disable_qt} +Requires: pcp-gui +%endif +Requires: bc gcc gzip bzip2 +Requires: redhat-rpm-config +%if !%{disable_selinux} +Requires: selinux-policy-devel +Requires: selinux-policy-targeted +%if 0%{?rhel} == 5 +Requires: setools +%else +Requires: setools-console +%endif +%endif + +%description testsuite +Quality assurance test suite for Performance Co-Pilot (PCP). +# end testsuite + +# +# perl-PCP-PMDA. This is the PCP agent perl binding. +# +%package -n perl-PCP-PMDA +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Perl bindings and documentation +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: %{perl_interpreter} + +%description -n perl-PCP-PMDA +The PCP::PMDA Perl module contains the language bindings for +building Performance Metric Domain Agents (PMDAs) using Perl. +Each PMDA exports performance data for one specific domain, for +example the operating system kernel, Cisco routers, a database, +an application, etc. + +# +# perl-PCP-MMV +# +%package -n perl-PCP-MMV +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Perl bindings for PCP Memory Mapped Values +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: %{perl_interpreter} + +%description -n perl-PCP-MMV +The PCP::MMV module contains the Perl language bindings for +building scripts instrumented with the Performance Co-Pilot +(PCP) Memory Mapped Value (MMV) mechanism. +This mechanism allows arbitrary values to be exported from an +instrumented script into the PCP infrastructure for monitoring +and analysis with pmchart, pmie, pmlogger and other PCP tools. + +# +# perl-PCP-LogImport +# +%package -n perl-PCP-LogImport +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Perl bindings for importing external data into PCP archives +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: %{perl_interpreter} + +%description -n perl-PCP-LogImport +The PCP::LogImport module contains the Perl language bindings for +importing data in various 3rd party formats into PCP archives so +they can be replayed with standard PCP monitoring tools. + +# +# perl-PCP-LogSummary +# +%package -n perl-PCP-LogSummary +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Perl bindings for post-processing output of pmlogsummary +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: %{perl_interpreter} + +%description -n perl-PCP-LogSummary +The PCP::LogSummary module provides a Perl module for using the +statistical summary data produced by the Performance Co-Pilot +pmlogsummary utility. This utility produces various averages, +minima, maxima, and other calculations based on the performance +data stored in a PCP archive. The Perl interface is ideal for +exporting this data into third-party tools (e.g. spreadsheets). + +# +# pcp-import-sar2pcp +# +%package import-sar2pcp +License: LGPLv2+ +Summary: Performance Co-Pilot tools for importing sar data into PCP archive logs +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} +Requires: perl(XML::TokeParser) + +%description import-sar2pcp +Performance Co-Pilot (PCP) front-end tools for importing sar data +into standard PCP archive logs for replay with any PCP monitoring tool. + +# +# pcp-import-iostat2pcp +# +%package import-iostat2pcp +License: LGPLv2+ +Summary: Performance Co-Pilot tools for importing iostat data into PCP archive logs +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} + +%description import-iostat2pcp +Performance Co-Pilot (PCP) front-end tools for importing iostat data +into standard PCP archive logs for replay with any PCP monitoring tool. + +# +# pcp-import-mrtg2pcp +# +%package import-mrtg2pcp +License: LGPLv2+ +Summary: Performance Co-Pilot tools for importing MTRG data into PCP archive logs +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} + +%description import-mrtg2pcp +Performance Co-Pilot (PCP) front-end tools for importing MTRG data +into standard PCP archive logs for replay with any PCP monitoring tool. + +# +# pcp-import-ganglia2pcp +# +%package import-ganglia2pcp +License: LGPLv2+ +Summary: Performance Co-Pilot tools for importing ganglia data into PCP archive logs +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} + +%description import-ganglia2pcp +Performance Co-Pilot (PCP) front-end tools for importing ganglia data +into standard PCP archive logs for replay with any PCP monitoring tool. + +# +# pcp-import-collectl2pcp +# +%package import-collectl2pcp +License: LGPLv2+ +Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} + +%description import-collectl2pcp +Performance Co-Pilot (PCP) front-end tools for importing collectl data +into standard PCP archive logs for replay with any PCP monitoring tool. + +# +# pcp-export-zabbix-agent +# +%package export-zabbix-agent +License: GPLv2+ +Summary: Module for exporting PCP metrics to Zabbix agent +URL: https://pcp.io +Requires: pcp-libs = %{version}-%{release} + +%description export-zabbix-agent +Performance Co-Pilot (PCP) module for exporting metrics from PCP to +Zabbix via the Zabbix agent - see zbxpcp(3) for further details. + +%if !%{disable_python2} || !%{disable_python3} +# +# pcp-export-pcp2elasticsearch +# +%package export-pcp2elasticsearch +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics to ElasticSearch +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +Requires: python3-requests +BuildRequires: python3-requests +%else +Requires: %{__python2}-pcp = %{version}-%{release} +Requires: %{__python2}-requests +BuildRequires: %{__python2}-requests +%endif + +%description export-pcp2elasticsearch +Performance Co-Pilot (PCP) front-end tools for exporting metric values +to Elasticsearch - a distributed, RESTful search and analytics engine. +See https://www.elastic.co/community for further details. + +# +# pcp-export-pcp2graphite +# +%package export-pcp2graphite +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics to Graphite +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +%else +Requires: %{__python2}-pcp = %{version}-%{release} +%endif + +%description export-pcp2graphite +Performance Co-Pilot (PCP) front-end tools for exporting metric values +to graphite (http://graphite.readthedocs.org). + +# pcp-export-pcp2influxdb +# +%package export-pcp2influxdb +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics to InfluxDB +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +Requires: python3-requests +%else +Requires: %{__python2}-pcp = %{version}-%{release} +Requires: %{__python2}-requests +%endif + +%description export-pcp2influxdb +Performance Co-Pilot (PCP) front-end tools for exporting metric values +to InfluxDB (https://influxdata.com/time-series-platform/influxdb). + +# +# pcp-export-pcp2json +# +%package export-pcp2json +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics in JSON format +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +%else +Requires: %{__python2}-pcp = %{version}-%{release} +%endif + +%description export-pcp2json +Performance Co-Pilot (PCP) front-end tools for exporting metric values +in JSON format. + +# +# pcp-export-pcp2spark +# +%package export-pcp2spark +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics to Apache Spark +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +%else +Requires: %{__python2}-pcp = %{version}-%{release} +%endif + +%description export-pcp2spark +Performance Co-Pilot (PCP) front-end tools for exporting metric values +in JSON format to Apache Spark. See https://spark.apache.org/ for +further details on Apache Spark. + +# +# pcp-export-pcp2xlsx +# +%if !%{disable_xlsx} +%package export-pcp2xlsx +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics to Excel +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +Requires: python3-openpyxl +BuildRequires: python3-openpyxl +%else +Requires: %{__python2}-pcp = %{version}-%{release} +Requires: %{__python2}-openpyxl +BuildRequires: %{__python2}-openpyxl +%endif + +%description export-pcp2xlsx +Performance Co-Pilot (PCP) front-end tools for exporting metric values +in Excel spreadsheet format. +%endif +# +# pcp-export-pcp2xml +# +%package export-pcp2xml +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics in XML format +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +%else +Requires: %{__python2}-pcp = %{version}-%{release} +%endif + +%description export-pcp2xml +Performance Co-Pilot (PCP) front-end tools for exporting metric values +in XML format. + +# +# pcp-export-pcp2zabbix +# +%package export-pcp2zabbix +License: GPLv2+ +Summary: Performance Co-Pilot tools for exporting PCP metrics to Zabbix +URL: https://pcp.io +Requires: pcp-libs >= %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +%else +Requires: %{__python2}-pcp = %{version}-%{release} +%endif + +%description export-pcp2zabbix +Performance Co-Pilot (PCP) front-end tools for exporting metric values +to the Zabbix (https://www.zabbix.org/) monitoring software. +%endif + +%if !%{disable_podman} +# +# pcp-pmda-podman +# +%package pmda-podman +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for podman containers +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} + +%description pmda-podman +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting podman container and pod statistics via the podman REST API. +%endif + +%if !%{disable_statsd} +# +# pcp-pmda-statsd +# +%package pmda-statsd +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from statsd +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: chan HdrHistogram_c + +%description pmda-statsd +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting statistics from the statsd daemon. +%endif + +%if !%{disable_perfevent} +# +# pcp-pmda-perfevent +# +%package pmda-perfevent +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for hardware counters +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: libpfm >= 4 +BuildRequires: libpfm-devel >= 4 +Obsoletes: pcp-pmda-papi < 5.0.0 +Obsoletes: pcp-pmda-papi-debuginfo < 5.0.0 + +%description pmda-perfevent +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting hardware counters statistics through libpfm. +%endif + +%if !%{disable_infiniband} +# +# pcp-pmda-infiniband +# +%package pmda-infiniband +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Infiniband HCAs and switches +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: libibmad >= 1.3.7 libibumad >= 1.3.7 +BuildRequires: libibmad-devel >= 1.3.7 libibumad-devel >= 1.3.7 + +%description pmda-infiniband +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting Infiniband statistics. By default, it monitors the local HCAs +but can also be configured to monitor remote GUIDs such as IB switches. +%endif + +# +# pcp-pmda-activemq +# +%package pmda-activemq +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for ActiveMQ +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(LWP::UserAgent) + +%description pmda-activemq +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the ActiveMQ message broker. +#end pcp-pmda-activemq + +# +# pcp-pmda-bind2 +# +%package pmda-bind2 +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for BIND servers +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(LWP::UserAgent) +Requires: perl(XML::LibXML) +Requires: perl(File::Slurp) +Requires: perl-autodie +Requires: perl-Time-HiRes + +%description pmda-bind2 +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from BIND (Berkeley Internet Name Domain). +#end pcp-pmda-bind2 + +# +# pcp-pmda-redis +# +%package pmda-redis +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Redis +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl-autodie +Requires: perl-Time-HiRes +Requires: perl-Data-Dumper + +%description pmda-redis +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from Redis servers (redis.io). +#end pcp-pmda-redis + +%if !%{disable_nutcracker} +# +# pcp-pmda-nutcracker +# +%package pmda-nutcracker +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for NutCracker (TwemCache) +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(YAML::XS::LibYAML) +Requires: perl(JSON) + +%description pmda-nutcracker +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from NutCracker (TwemCache). +#end pcp-pmda-nutcracker +%endif + +# +# pcp-pmda-bonding +# +%package pmda-bonding +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Bonded network interfaces +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-bonding +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about bonded network interfaces. +#end pcp-pmda-bonding + +# +# pcp-pmda-dbping +# +%package pmda-dbping +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Database response times and Availablility +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl-DBI + +%description pmda-dbping +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Database response times and Availablility. +#end pcp-pmda-dbping + +# +# pcp-pmda-ds389 +# +%package pmda-ds389 +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for 389 Directory Servers +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +%if 0%{?rhel} <= 7 +Requires: perl-LDAP +%endif + +%description pmda-ds389 +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about a 389 Directory Server. +#end pcp-pmda-ds389 + +# +# pcp-pmda-ds389log +# +%package pmda-ds389log +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for 389 Directory Server Loggers +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl-Date-Manip + +%description pmda-ds389log +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from a 389 Directory Server log. +#end pcp-pmda-ds389log + + +# +# pcp-pmda-gpfs +# +%package pmda-gpfs +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for GPFS Filesystem +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-gpfs +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the GPFS filesystem. +#end pcp-pmda-gpfs + +# +# pcp-pmda-gpsd +# +%package pmda-gpsd +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for a GPS Daemon +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl-Time-HiRes +Requires: perl-JSON + +%description pmda-gpsd +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about a GPS Daemon. +#end pcp-pmda-gpsd + +# +# pcp-pmda-denki +# +%package pmda-denki +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics dealing with electrical power +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-denki +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics related to the electrical power consumed by and inside +the system. +# end pcp-pmda-denki + +# +# pcp-pmda-docker +# +%package pmda-docker +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from the Docker daemon +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} + +%description pmda-docker +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics using the Docker daemon REST API. +#end pcp-pmda-docker + +# +# pcp-pmda-lustre +# +%package pmda-lustre +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Lustre Filesytem +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-lustre +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Lustre Filesystem. +#end pcp-pmda-lustre + +# +# pcp-pmda-lustrecomm +# +%package pmda-lustrecomm +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Lustre Filesytem Comms +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} + +%description pmda-lustrecomm +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Lustre Filesystem Comms. +#end pcp-pmda-lustrecomm + +# +# pcp-pmda-memcache +# +%package pmda-memcache +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Memcached +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-memcache +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Memcached. +#end pcp-pmda-memcache + +# +# pcp-pmda-mysql +# +%package pmda-mysql +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for MySQL +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(DBI) perl(DBD::mysql) +BuildRequires: perl(DBI) perl(DBD::mysql) + +%description pmda-mysql +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the MySQL database. +#end pcp-pmda-mysql + +# +# pcp-pmda-named +# +%package pmda-named +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Named +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-named +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Named nameserver. +#end pcp-pmda-named + +# pcp-pmda-netfilter +# +%package pmda-netfilter +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Netfilter framework +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-netfilter +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Netfilter packet filtering framework. +#end pcp-pmda-netfilter + +# +# pcp-pmda-news +# +%package pmda-news +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Usenet News +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-news +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Usenet News. +#end pcp-pmda-news + +# +# pcp-pmda-nginx +# +%package pmda-nginx +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Nginx Webserver +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(LWP::UserAgent) +BuildRequires: perl(LWP::UserAgent) + +%description pmda-nginx +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Nginx Webserver. +#end pcp-pmda-nginx + +# +# pcp-pmda-oracle +# +%package pmda-oracle +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Oracle database +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl(DBI) +BuildRequires: perl(DBI) + +%description pmda-oracle +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Oracle database. +#end pcp-pmda-oracle + +# +# pcp-pmda-pdns +# +%package pmda-pdns +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for PowerDNS +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl-Time-HiRes + +%description pmda-pdns +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the PowerDNS. +#end pcp-pmda-pdns + +# +# pcp-pmda-postfix +# +%package pmda-postfix +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Postfix (MTA) +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Requires: perl-Time-HiRes +%if 0%{?fedora} > 16 || 0%{?rhel} > 5 +Requires: postfix-perl-scripts +BuildRequires: postfix-perl-scripts +%endif +%if 0%{?rhel} <= 5 +Requires: postfix +BuildRequires: postfix +%endif +%if "%{_vendor}" == "suse" +Requires: postfix-doc +BuildRequires: postfix-doc +%endif + +%description pmda-postfix +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Postfix (MTA). +#end pcp-pmda-postfix + +# +# pcp-pmda-rsyslog +# +%package pmda-rsyslog +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Rsyslog +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-rsyslog +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Rsyslog. +#end pcp-pmda-rsyslog + +# +# pcp-pmda-samba +# +%package pmda-samba +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Samba +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-samba +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Samba. +#end pcp-pmda-samba + +# +# pcp-pmda-slurm +# +%package pmda-slurm +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the SLURM Workload Manager +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-slurm +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from the SLURM Workload Manager. +#end pcp-pmda-slurm + +%if !%{disable_snmp} +# +# pcp-pmda-snmp +# +%package pmda-snmp +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Simple Network Management Protocol +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +# There are no perl-Net-SNMP packages in rhel, disable unless non-rhel or epel5 +%if 0%{?rhel} == 0 || 0%{?rhel} < 6 +Requires: perl(Net::SNMP) +%endif + +%description pmda-snmp +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about SNMP. +#end pcp-pmda-snmp +%endif + +# +# pcp-pmda-zimbra +# +%package pmda-zimbra +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Zimbra +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} + +%description pmda-zimbra +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Zimbra. +#end pcp-pmda-zimbra + +# +# pcp-pmda-dm +# +%package pmda-dm +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Device Mapper Cache and Thin Client +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +BuildRequires: device-mapper-devel +%description pmda-dm +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Device Mapper Cache and Thin Client. +# end pcp-pmda-dm + + +%if !%{disable_bcc} +# +# pcp-pmda-bcc +# +%package pmda-bcc +License: ASL 2.0 and GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from eBPF/BCC modules +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: python3-bcc +Requires: python3-pcp +%description pmda-bcc +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting performance metrics from eBPF/BCC Python modules. +# end pcp-pmda-bcc +%endif + +%if !%{disable_bpf} +# +# pcp-pmda-bpf +# +%package pmda-bpf +License: ASL 2.0 and GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from eBPF ELF modules +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: libbpf +BuildRequires: libbpf-devel clang llvm bpftool +%description pmda-bpf +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting performance metrics from eBPF ELF modules. +# end pcp-pmda-bpf +%endif + +%if !%{disable_bpftrace} +# +# pcp-pmda-bpftrace +# +%package pmda-bpftrace +License: ASL 2.0 and GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from bpftrace scripts +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: bpftrace >= 0.9.2 +Requires: python3-pcp +Requires: python3 >= 3.6 +%description pmda-bpftrace +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting performance metrics from bpftrace scripts. +# end pcp-pmda-bpftrace +%endif + +%if !%{disable_python2} || !%{disable_python3} +# +# pcp-pmda-gluster +# +%package pmda-gluster +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Gluster filesystem +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-gluster +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the gluster filesystem. +# end pcp-pmda-gluster + +# +# pcp-pmda-nfsclient +# +%package pmda-nfsclient +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for NFS Clients +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-nfsclient +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics for NFS Clients. +#end pcp-pmda-nfsclient + +# +# pcp-pmda-postgresql +# +%package pmda-postgresql +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for PostgreSQL +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +Requires: python3-psycopg2 +BuildRequires: python3-psycopg2 +%else +Requires: %{__python2}-pcp +Requires: %{__python2}-psycopg2 +BuildRequires: %{__python2}-psycopg2 +%endif +%description pmda-postgresql +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the PostgreSQL database. +#end pcp-pmda-postgresql + +# +# pcp-pmda-zswap +# +%package pmda-zswap +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for compressed swap +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-zswap +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about compressed swap. +# end pcp-pmda-zswap + +# +# pcp-pmda-unbound +# +%package pmda-unbound +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Unbound DNS Resolver +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-unbound +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Unbound DNS Resolver. +# end pcp-pmda-unbound + +# +# pcp-pmda-mic +# +%package pmda-mic +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Intel MIC cards +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-mic +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Intel MIC cards. +# end pcp-pmda-mic + +# +# pcp-pmda-haproxy +# +%package pmda-haproxy +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for HAProxy +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-haproxy +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting performance metrics from HAProxy over the HAProxy stats socket. +# end pcp-pmda-haproxy + +# +# pcp-pmda-libvirt +# +%package pmda-libvirt +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from virtual machines +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +Requires: libvirt-python3 python3-lxml +BuildRequires: libvirt-python3 python3-lxml +%else +%if 0%{?rhel} == 0 || 0%{?fedora} >= 27 +Requires: %{__python2}-pcp +Requires: %{__python2}-libvirt %{__python2}-lxml +BuildRequires: %{__python2}-libvirt %{__python2}-lxml +%endif +%if 0%{?rhel} > 5 +Requires: %{__python2}-pcp +Requires: libvirt-%{__python2} %{__python2}-lxml +BuildRequires: libvirt-%{__python2} %{__python2}-lxml +%endif +%endif +%description pmda-libvirt +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting virtualisation statistics from libvirt about behaviour of guest +and hypervisor machines. +# end pcp-pmda-libvirt + +# +# pcp-pmda-elasticsearch +# +%package pmda-elasticsearch +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Elasticsearch +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-elasticsearch +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Elasticsearch. +#end pcp-pmda-elasticsearch + +# +# pcp-pmda-openvswitch +# +%package pmda-openvswitch +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Open vSwitch +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-openvswitch +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from Open vSwitch. +#end pcp-pmda-openvswitch + +# +# pcp-pmda-rabbitmq +# +%package pmda-rabbitmq +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for RabbitMQ queues +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-rabbitmq +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about RabbitMQ message queues. +#end pcp-pmda-rabbitmq + +# +# pcp-pmda-lio +# +%package pmda-lio +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the LIO subsystem +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +Requires: python3-rtslib +BuildRequires: python3-rtslib +%else +Requires: %{__python2}-pcp +Requires: %{__python2}-rtslib +BuildRequires: %{__python2}-rtslib +%endif +%description pmda-lio +This package provides a PMDA to gather performance metrics from the kernels +iSCSI target interface (LIO). The metrics are stored by LIO within the Linux +kernels configfs filesystem. The PMDA provides per LUN level stats, and a +summary instance per iSCSI target, which aggregates all LUN metrics within the +target. +#end pcp-pmda-lio + +# +# pcp-pmda-openmetrics +# +%package pmda-openmetrics +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from OpenMetrics endpoints +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +Requires: python3-requests +BuildRequires: python3-requests +%else +Requires: %{__python2}-pcp +Requires: %{__python2}-requests +BuildRequires: %{__python2}-requests +%endif +Obsoletes: pcp-pmda-prometheus < 5.0.0 +Provides: pcp-pmda-prometheus < 5.0.0 +Obsoletes: pcp-pmda-vmware < 5.3.5 + +%description pmda-openmetrics +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +extracting metrics from OpenMetrics (https://openmetrics.io/) endpoints. +#end pcp-pmda-openmetrics + +# +# pcp-pmda-lmsensors +# +%package pmda-lmsensors +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for hardware sensors +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: lm_sensors +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +# rewritten in python, so there is no longer a debuginfo package +Obsoletes: pcp-pmda-lmsensors-debuginfo < 4.2.0 +%description pmda-lmsensors +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Linux hardware monitoring sensors. +# end pcp-pmda-lmsensors + +# +# pcp-pmda-netcheck +# +%package pmda-netcheck +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for simple network checks +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%else +Requires: %{__python2}-pcp +%endif +%description pmda-netcheck +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from simple network checks. +# end pcp-pmda-netcheck + +# +# pcp-pmda-mongodb +# +%package pmda-mongodb +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for MongoDB +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%if 0%{?rhel} == 0 +Requires: python3-pymongo +%endif +%else +Requires: %{__python2}-pcp +%if 0%{?rhel} == 0 +Requires: %{__python2}-pymongo +%endif +%endif +%description pmda-mongodb +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from MongoDB. +# end pcp-pmda-mongodb +%endif + +%if !%{disable_mssql} +# +# pcp-pmda-mssql +# +%package pmda-mssql +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Microsoft SQL Server +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +%if 0%{?rhel} == 0 || 0%{?rhel} > 7 +Requires: python3-pyodbc +%endif +%else +Requires: %{__python2}-pcp +%if 0%{?rhel} == 0 +Requires: %{__python2}-pyodbc +%endif +%endif +%description pmda-mssql +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from Microsoft SQL Server. +# end pcp-pmda-mssql +%endif + +%if !%{disable_json} +# +# pcp-pmda-json +# +%package pmda-json +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for JSON data +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python3} +Requires: python3-pcp +Requires: python3-jsonpointer python3-six +BuildRequires: python3-jsonpointer python3-six +%else +Requires: %{__python2}-pcp +Requires: %{__python2}-jsonpointer %{__python2}-six +BuildRequires: %{__python2}-jsonpointer %{__python2}-six +%endif +%description pmda-json +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics output in JSON. +# end pcp-pmda-json +%endif + +# +# C pmdas +# pcp-pmda-apache +# +%package pmda-apache +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Apache webserver +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-apache +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Apache webserver. +# end pcp-pmda-apache + +# +# pcp-pmda-bash +# +%package pmda-bash +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Bash shell +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-bash +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Bash shell. +# end pcp-pmda-bash + +# +# pcp-pmda-cifs +# +%package pmda-cifs +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the CIFS protocol +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-cifs +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Common Internet Filesytem. +# end pcp-pmda-cifs + +# +# pcp-pmda-cisco +# +%package pmda-cisco +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Cisco routers +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-cisco +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Cisco routers. +# end pcp-pmda-cisco + +# +# pcp-pmda-gfs2 +# +%package pmda-gfs2 +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the GFS2 filesystem +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-gfs2 +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the Global Filesystem v2. +# end pcp-pmda-gfs2 + +# +# pcp-pmda-logger +# +%package pmda-logger +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from arbitrary log files +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-logger +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from a specified set of log files (or pipes). The PMDA +supports both sampled and event-style metrics. +# end pcp-pmda-logger + +# +# pcp-pmda-mailq +# +%package pmda-mailq +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the sendmail queue +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-mailq +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about email queues managed by sendmail. +# end pcp-pmda-mailq + +# +# pcp-pmda-mounts +# +%package pmda-mounts +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for filesystem mounts +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-mounts +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about filesystem mounts. +# end pcp-pmda-mounts + +# +# pcp-pmda-nvidia-gpu +# +%package pmda-nvidia-gpu +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the Nvidia GPU +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-nvidia-gpu +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Nvidia GPUs. +# end pcp-pmda-nvidia-gpu + +# +# pcp-pmda-roomtemp +# +%package pmda-roomtemp +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for the room temperature +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-roomtemp +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about the room temperature. +# end pcp-pmda-roomtemp + +# +# pcp-pmda-sendmail +# +%package pmda-sendmail +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for Sendmail +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-sendmail +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about Sendmail traffic. +# end pcp-pmda-sendmail + +# +# pcp-pmda-shping +# +%package pmda-shping +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for shell command responses +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-shping +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about quality of service and response time measurements of +arbitrary shell commands. +# end pcp-pmda-shping + +# +# pcp-pmda-smart +# +%package pmda-smart +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for S.M.A.R.T values +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: smartmontools +%description pmda-smart +This package contains the PCP Performance Metric Domain Agent (PMDA) for +collecting metrics of disk S.M.A.R.T values making use of data from the +smartmontools package. +#end pcp-pmda-smart + +# +# pcp-pmda-sockets +# +%package pmda-sockets +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) per-socket metrics +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: iproute +%description pmda-sockets +This package contains the PCP Performance Metric Domain Agent (PMDA) for +collecting per-socket statistics, making use of utilities such as 'ss'. +#end pcp-pmda-sockets + +# +# pcp-pmda-hacluster +# +%package pmda-hacluster +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for High Availability Clusters +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-hacluster +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about linux High Availability (HA) Clusters. +# end pcp-pmda-hacluster + +# +# pcp-pmda-summary +# +%package pmda-summary +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) summary metrics from pmie +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-summary +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about other installed PMDAs. +# end pcp-pmda-summary + +%if !%{disable_systemd} +# +# pcp-pmda-systemd +# +%package pmda-systemd +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from the Systemd journal +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-systemd +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics from the Systemd journal. +# end pcp-pmda-systemd +%endif + +# +# pcp-pmda-trace +# +%package pmda-trace +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics for application tracing +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-trace +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about trace performance data in applications. +# end pcp-pmda-trace + +# +# pcp-pmda-weblog +# +%package pmda-weblog +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) metrics from web server logs +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%description pmda-weblog +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting metrics about web server logs. +# end pcp-pmda-weblog +# end C pmdas + +%package zeroconf +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Zeroconf Package +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: pcp-system-tools = %{version}-%{release} +Requires: pcp-doc = %{version}-%{release} +Requires: pcp-pmda-dm = %{version}-%{release} +%if !%{disable_python2} || !%{disable_python3} +Requires: pcp-pmda-nfsclient = %{version}-%{release} +Requires: pcp-pmda-openmetrics = %{version}-%{release} +%endif +%description zeroconf +This package contains configuration tweaks and files to increase metrics +gathering frequency, several extended pmlogger configurations, as well as +automated pmie diagnosis, alerting and self-healing for the localhost. + +%if !%{disable_python2} +# +# python2-pcp. This is the PCP library bindings for python. +# +%package -n %{__python2}-pcp +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Python bindings and documentation +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if 0%{?fedora} >= 26 || 0%{?rhel} > 7 +# on these platforms, python2-pcp replaces python-pcp +Obsoletes: python-pcp < %{version} +%endif +%if 0%{?rhel} == 5 +Requires: python%{default_python} +%else +Requires: %{__python2} +%endif + +%description -n %{__python2}-pcp +This python PCP module contains the language bindings for +Performance Metric API (PMAPI) monitor tools and Performance +Metric Domain Agent (PMDA) collector tools written in Python. +%endif + +%if !%{disable_python3} +# +# python3-pcp. This is the PCP library bindings for python3. +# +%package -n python3-pcp +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) Python3 bindings and documentation +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: python3 + +%description -n python3-pcp +This python PCP module contains the language bindings for +Performance Metric API (PMAPI) monitor tools and Performance +Metric Domain Agent (PMDA) collector tools written in Python3. +%endif + +# +# pcp-system-tools +# +%package system-tools +License: GPLv2+ +Summary: Performance Co-Pilot (PCP) System and Monitoring Tools +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +%if !%{disable_python2} || !%{disable_python3} +%if !%{disable_python3} +Requires: python3-pcp = %{version}-%{release} +%else +Requires: %{__python2}-pcp = %{version}-%{release} +%endif +%if !%{disable_dstat} +# https://fedoraproject.org/wiki/Packaging:Guidelines "Renaming/Replacing Existing Packages" +Provides: dstat = %{version}-%{release} +Provides: /usr/bin/dstat +Obsoletes: dstat <= 0.8 +%endif +%endif + +%description system-tools +This PCP module contains additional system monitoring tools written +in the Python language. + +%if !%{disable_qt} +# +# pcp-gui package for Qt tools +# +%package gui +License: GPLv2+ and LGPLv2+ and LGPLv2+ with exceptions +Summary: Visualization tools for the Performance Co-Pilot toolkit +URL: https://pcp.io +Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} +Requires: liberation-sans-fonts +BuildRequires: hicolor-icon-theme + +%description gui +Visualization tools for the Performance Co-Pilot toolkit. +The pcp-gui package primarily includes visualization tools for +monitoring systems using live and archived Performance Co-Pilot +(PCP) sources. +%endif + +# +# pcp-doc package +# +%package doc +License: GPLv2+ and CC-BY +%if !%{disable_noarch} +BuildArch: noarch +%endif +Summary: Documentation and tutorial for the Performance Co-Pilot +URL: https://pcp.io +# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages" +# (all man pages migrated to pcp-doc during great package split of '15) +Conflicts: pcp-pmda-infiniband < 3.10.5 + +%description doc +Documentation and tutorial for the Performance Co-Pilot +Performance Co-Pilot (PCP) provides a framework and services to support +system-level performance monitoring and performance management. + +The pcp-doc package provides useful information on using and +configuring the Performance Co-Pilot (PCP) toolkit for system +level performance management. It includes tutorials, HOWTOs, +and other detailed documentation about the internals of core +PCP utilities and daemons, and the PCP graphical tools. + +# +# pcp-selinux package +# +%if !%{disable_selinux} +%package selinux +License: GPLv2+ and CC-BY +Summary: Selinux policy package +URL: https://pcp.io +BuildRequires: selinux-policy-devel +BuildRequires: selinux-policy-targeted +%if 0%{?rhel} == 5 +BuildRequires: setools +%else +BuildRequires: setools-console +%endif +Requires: policycoreutils selinux-policy-targeted + +%description selinux +This package contains SELinux support for PCP. The package contains +interface rules, type enforcement and file context adjustments for an +updated policy package. +%endif + + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 + +%build +# the buildsubdir macro gets defined in %setup and is apparently only available in the next step (i.e. the %build step) +%global __strip %{_builddir}/%{?buildsubdir}/build/rpm/custom-strip + +# fix up build version +_build=`echo %{release} | sed -e 's/\..*$//'` +sed -i "/PACKAGE_BUILD/s/=[0-9]*/=$_build/" VERSION.pcp + +%if !%{disable_python2} && 0%{?default_python} != 3 +export PYTHON=python%{?default_python} +%endif +%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_podman} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2} +make %{?_smp_mflags} default_pcp + +%install +rm -Rf $RPM_BUILD_ROOT +BACKDIR=`pwd` +NO_CHOWN=true +DIST_ROOT=$RPM_BUILD_ROOT +DIST_TMPFILES=$BACKDIR/install.tmpfiles +DIST_MANIFEST=$BACKDIR/install.manifest +export NO_CHOWN DIST_ROOT DIST_MANIFEST DIST_TMPFILES +rm -f $DIST_MANIFEST $DIST_TMPFILES +make install_pcp + +### TODO: remove these by incorporating into the actual build + +# Fix stuff we do/don't want to ship +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a +sed -i -e '/\.a$/d' $DIST_MANIFEST + +# remove sheet2pcp until BZ 830923 and BZ 754678 are resolved. +rm -f $RPM_BUILD_ROOT/%{_bindir}/sheet2pcp $RPM_BUILD_ROOT/%{_mandir}/man1/sheet2pcp.1* +sed -i -e '/sheet2pcp/d' $DIST_MANIFEST + +# remove {config,platform}sz.h as these are not multilib friendly. +rm -f $RPM_BUILD_ROOT/%{_includedir}/pcp/configsz.h +sed -i -e '/configsz.h/d' $DIST_MANIFEST +rm -f $RPM_BUILD_ROOT/%{_includedir}/pcp/platformsz.h +sed -i -e '/platformsz.h/d' $DIST_MANIFEST + +%if %{disable_mssql} +# remove pmdamssql on platforms lacking MSODBC driver packages. +rm -fr $RPM_BUILD_ROOT/%{_confdir}/mssql +rm -fr $RPM_BUILD_ROOT/%{_confdir}/pmieconf/mssql +rm -fr $RPM_BUILD_ROOT/%{_ieconfdir}/mssql +rm -fr $RPM_BUILD_ROOT/%{_pmdasdir}/mssql +rm -fr $RPM_BUILD_ROOT/%{_pmdasexecdir}/mssql +%endif + +%if !%{disable_qt} +desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/pmchart.desktop +%endif + +%if 0%{?rhel} || 0%{?fedora} +# Fedora and RHEL default local only access for pmcd and pmlogger +sed -i -e '/^# .*_LOCAL=1/s/^# //' $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/{pmcd,pmlogger} +%endif + +# default chkconfig off (all RPM platforms) +for f in $RPM_BUILD_ROOT/%{_initddir}/{pcp,pmcd,pmlogger,pmie,pmproxy}; do + test -f "$f" || continue + sed -i -e '/^# chkconfig/s/:.*$/: - 95 05/' -e '/^# Default-Start:/s/:.*$/:/' $f +done + +### end TODO + +PCP_GUI='pmchart|pmconfirm|pmdumptext|pmmessage|pmquery|pmsnap|pmtime' + +PCP_CONF=$BACKDIR/src/include/pcp.conf +export PCP_CONF +. $BACKDIR/src/include/pcp.env +CFGFILELIST=`ls -1 $BACKDIR/debian/pcp-conf.{install,dirs}` +LIBFILELIST=`ls -1 $BACKDIR/debian/lib*.{install,dirs} | grep -F -v -- -dev.` +DEVFILELIST=`ls -1 $BACKDIR/debian/lib*-dev.{install,dirs}` + +# Package split: pcp{-conf,-libs,-libs-devel,-testsuite,-import-*,-export-*}... +# The above list is ordered by file selection; files for each package are +# removed from a global set, then the base package catches all remaining. +sed -e 's/^/\//' $CFGFILELIST >pcp-conf-files +sed -e 's/^/\//' $LIBFILELIST >pcp-libs-files +sed -e 's/^/\//' $DEVFILELIST >pcp-devel-files +grep "\.h$" $DEVFILELIST | cut -f2 -d":" >pcp-libs-devel-files +grep "\.pc$" $DEVFILELIST | cut -f2 -d":" >>pcp-libs-devel-files +grep "\.so$" $DEVFILELIST | cut -f2 -d":" >>pcp-libs-devel-files +grep "\.a$" $DEVFILELIST | cut -f2 -d":" >>pcp-libs-devel-files +sed -i -e 's/^/\//' pcp-libs-devel-files +sed -i '/.h$/d' pcp-devel-files +sed -i '/.pc$/d' pcp-devel-files +sed -i '/.so$/d' pcp-devel-files +sed -i '/.a$/d' pcp-devel-files +sed -i '/\/man\//d' pcp-devel-files +sed -i '/\/include\//d' pcp-devel-files + +%ifarch x86_64 ppc64 ppc64le aarch64 s390x +sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files +sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files +sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files +%endif +%ifarch ia64 +%if "%{_vendor}" != "suse" +sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-files +sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-devel-files +sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files +%endif +%endif + +# some special cases for devel +awk '{print $NF}' $DIST_MANIFEST |\ +grep -E 'pcp\/(examples|demos)|(etc/pcp|pcp/pmdas)\/(sample|simple|trivial|txmon)|bin/(pmdbg|pmclient|pmerr|genpmda)' | grep -E -v tutorials >>pcp-devel-files + +# Patterns for files to be marked %%config(noreplace). +# Note: /etc/pcp.{conf,env,sh} are %%config but not noreplace +# and are treated specially below. +cat >confpath.list <pcp-doc-files +total_manifest | keep 'testsuite|etc/systemd/system|libpcp_fault|pcp/fault.h' >pcp-testsuite-files + +basic_manifest | keep "$PCP_GUI|pcp-gui|applications|pixmaps|hicolor" | cull 'pmtime.h' >pcp-gui-files +basic_manifest | keep 'selinux' | cull 'tmp|GNUselinuxdefs' >pcp-selinux-files +basic_manifest | keep 'zeroconf|daily[-_]report|/sa$' >pcp-zeroconf-files +basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|htop|pcp2csv' \ + -e 'pcp-atop|pcp-dmcache|pcp-dstat|pcp-free|pcp-htop' \ + -e 'pcp-ipcs|pcp-iostat|pcp-lvmcache|pcp-mpstat' \ + -e 'pcp-numastat|pcp-pidstat|pcp-shping|pcp-tapestat' \ + -e 'pcp-uptime|pcp-verify|pcp-ss' | \ + cull 'selinux|pmlogconf|pmieconf|pmrepconf' >pcp-system-tools-files + +basic_manifest | keep 'sar2pcp' >pcp-import-sar2pcp-files +basic_manifest | keep 'iostat2pcp' >pcp-import-iostat2pcp-files +basic_manifest | keep 'sheet2pcp' >pcp-import-sheet2pcp-files +basic_manifest | keep 'mrtg2pcp' >pcp-import-mrtg2pcp-files +basic_manifest | keep 'ganglia2pcp' >pcp-import-ganglia2pcp-files +basic_manifest | keep 'collectl2pcp' >pcp-import-collectl2pcp-files +basic_manifest | keep 'pcp2elasticsearch' >pcp-export-pcp2elasticsearch-files +basic_manifest | keep 'pcp2influxdb' >pcp-export-pcp2influxdb-files +basic_manifest | keep 'pcp2xlsx' >pcp-export-pcp2xlsx-files +basic_manifest | keep 'pcp2graphite' >pcp-export-pcp2graphite-files +basic_manifest | keep 'pcp2json' >pcp-export-pcp2json-files +basic_manifest | keep 'pcp2spark' >pcp-export-pcp2spark-files +basic_manifest | keep 'pcp2xml' >pcp-export-pcp2xml-files +basic_manifest | keep 'pcp2zabbix' >pcp-export-pcp2zabbix-files +basic_manifest | keep 'zabbix|zbxpcp' | cull pcp2zabbix >pcp-export-zabbix-agent-files +basic_manifest | keep '(etc/pcp|pmdas)/activemq(/|$)' >pcp-pmda-activemq-files +basic_manifest | keep '(etc/pcp|pmdas)/apache(/|$)' >pcp-pmda-apache-files +basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files +basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files +basic_manifest | keep '(etc/pcp|pmdas)/bind2(/|$)' >pcp-pmda-bind2-files +basic_manifest | keep '(etc/pcp|pmdas)/bonding(/|$)' >pcp-pmda-bonding-files +basic_manifest | keep '(etc/pcp|pmdas)/bpf(/|$)' >pcp-pmda-bpf-files +basic_manifest | keep '(etc/pcp|pmdas)/bpftrace(/|$)' >pcp-pmda-bpftrace-files +basic_manifest | keep '(etc/pcp|pmdas)/cifs(/|$)' >pcp-pmda-cifs-files +basic_manifest | keep '(etc/pcp|pmdas)/cisco(/|$)' >pcp-pmda-cisco-files +basic_manifest | keep '(etc/pcp|pmdas)/dbping(/|$)' >pcp-pmda-dbping-files +basic_manifest | keep '(etc/pcp|pmdas|pmieconf)/dm(/|$)' >pcp-pmda-dm-files +basic_manifest | keep '(etc/pcp|pmdas)/denki(/|$)' >pcp-pmda-denki-files +basic_manifest | keep '(etc/pcp|pmdas)/docker(/|$)' >pcp-pmda-docker-files +basic_manifest | keep '(etc/pcp|pmdas)/ds389log(/|$)' >pcp-pmda-ds389log-files +basic_manifest | keep '(etc/pcp|pmdas)/ds389(/|$)' >pcp-pmda-ds389-files +basic_manifest | keep '(etc/pcp|pmdas)/elasticsearch(/|$)' >pcp-pmda-elasticsearch-files +basic_manifest | keep '(etc/pcp|pmdas)/gfs2(/|$)' >pcp-pmda-gfs2-files +basic_manifest | keep '(etc/pcp|pmdas)/gluster(/|$)' >pcp-pmda-gluster-files +basic_manifest | keep '(etc/pcp|pmdas)/gpfs(/|$)' >pcp-pmda-gpfs-files +basic_manifest | keep '(etc/pcp|pmdas)/gpsd(/|$)' >pcp-pmda-gpsd-files +basic_manifest | keep '(etc/pcp|pmdas)/hacluster(/|$)' >pcp-pmda-hacluster-files +basic_manifest | keep '(etc/pcp|pmdas)/haproxy(/|$)' >pcp-pmda-haproxy-files +basic_manifest | keep '(etc/pcp|pmdas)/infiniband(/|$)' >pcp-pmda-infiniband-files +basic_manifest | keep '(etc/pcp|pmdas)/json(/|$)' >pcp-pmda-json-files +basic_manifest | keep '(etc/pcp|pmdas)/libvirt(/|$)' >pcp-pmda-libvirt-files +basic_manifest | keep '(etc/pcp|pmdas)/lio(/|$)' >pcp-pmda-lio-files +basic_manifest | keep '(etc/pcp|pmdas)/lmsensors(/|$)' >pcp-pmda-lmsensors-files +basic_manifest | keep '(etc/pcp|pmdas)/logger(/|$)' >pcp-pmda-logger-files +basic_manifest | keep '(etc/pcp|pmdas)/lustre(/|$)' >pcp-pmda-lustre-files +basic_manifest | keep '(etc/pcp|pmdas)/lustrecomm(/|$)' >pcp-pmda-lustrecomm-files +basic_manifest | keep '(etc/pcp|pmdas)/memcache(/|$)' >pcp-pmda-memcache-files +basic_manifest | keep '(etc/pcp|pmdas)/mailq(/|$)' >pcp-pmda-mailq-files +basic_manifest | keep '(etc/pcp|pmdas)/mic(/|$)' >pcp-pmda-mic-files +basic_manifest | keep '(etc/pcp|pmdas)/mounts(/|$)' >pcp-pmda-mounts-files +basic_manifest | keep '(etc/pcp|pmdas)/mongodb(/|$)' >pcp-pmda-mongodb-files +basic_manifest | keep '(etc/pcp|pmdas|pmieconf)/mssql(/|$)' >pcp-pmda-mssql-files +basic_manifest | keep '(etc/pcp|pmdas)/mysql(/|$)' >pcp-pmda-mysql-files +basic_manifest | keep '(etc/pcp|pmdas)/named(/|$)' >pcp-pmda-named-files +basic_manifest | keep '(etc/pcp|pmdas)/netfilter(/|$)' >pcp-pmda-netfilter-files +basic_manifest | keep '(etc/pcp|pmdas)/netcheck(/|$)' >pcp-pmda-netcheck-files +basic_manifest | keep '(etc/pcp|pmdas)/news(/|$)' >pcp-pmda-news-files +basic_manifest | keep '(etc/pcp|pmdas)/nfsclient(/|$)' >pcp-pmda-nfsclient-files +basic_manifest | keep '(etc/pcp|pmdas)/nginx(/|$)' >pcp-pmda-nginx-files +basic_manifest | keep '(etc/pcp|pmdas)/nutcracker(/|$)' >pcp-pmda-nutcracker-files +basic_manifest | keep '(etc/pcp|pmdas)/nvidia(/|$)' >pcp-pmda-nvidia-files +basic_manifest | keep '(etc/pcp|pmdas)/openmetrics(/|$)' >pcp-pmda-openmetrics-files +basic_manifest | keep '(etc/pcp|pmdas)/openvswitch(/|$)' >pcp-pmda-openvswitch-files +basic_manifest | keep '(etc/pcp|pmdas)/oracle(/|$)' >pcp-pmda-oracle-files +basic_manifest | keep '(etc/pcp|pmdas)/pdns(/|$)' >pcp-pmda-pdns-files +basic_manifest | keep '(etc/pcp|pmdas)/perfevent(/|$)' >pcp-pmda-perfevent-files +basic_manifest | keep '(etc/pcp|pmdas)/podman(/|$)' >pcp-pmda-podman-files +basic_manifest | keep '(etc/pcp|pmdas)/postfix(/|$)' >pcp-pmda-postfix-files +basic_manifest | keep '(etc/pcp|pmdas)/postgresql(/|$)' >pcp-pmda-postgresql-files +basic_manifest | keep '(etc/pcp|pmdas)/rabbitmq(/|$)' >pcp-pmda-rabbitmq-files +basic_manifest | keep '(etc/pcp|pmdas)/redis(/|$)' >pcp-pmda-redis-files +basic_manifest | keep '(etc/pcp|pmdas)/roomtemp(/|$)' >pcp-pmda-roomtemp-files +basic_manifest | keep '(etc/pcp|pmdas)/rpm(/|$)' >pcp-pmda-rpm-files +basic_manifest | keep '(etc/pcp|pmdas)/rsyslog(/|$)' >pcp-pmda-rsyslog-files +basic_manifest | keep '(etc/pcp|pmdas)/samba(/|$)' >pcp-pmda-samba-files +basic_manifest | keep '(etc/pcp|pmdas)/sendmail(/|$)' >pcp-pmda-sendmail-files +basic_manifest | keep '(etc/pcp|pmdas)/shping(/|$)' >pcp-pmda-shping-files +basic_manifest | keep '(etc/pcp|pmdas)/slurm(/|$)' >pcp-pmda-slurm-files +basic_manifest | keep '(etc/pcp|pmdas)/smart(/|$)' >pcp-pmda-smart-files +basic_manifest | keep '(etc/pcp|pmdas)/snmp(/|$)' >pcp-pmda-snmp-files +basic_manifest | keep '(etc/pcp|pmdas)/sockets(/|$)' >pcp-pmda-sockets-files +basic_manifest | keep '(etc/pcp|pmdas)/statsd(/|$)' >pcp-pmda-statsd-files +basic_manifest | keep '(etc/pcp|pmdas)/summary(/|$)' >pcp-pmda-summary-files +basic_manifest | keep '(etc/pcp|pmdas)/systemd(/|$)' >pcp-pmda-systemd-files +basic_manifest | keep '(etc/pcp|pmdas)/trace(/|$)' >pcp-pmda-trace-files +basic_manifest | keep '(etc/pcp|pmdas)/unbound(/|$)' >pcp-pmda-unbound-files +basic_manifest | keep '(etc/pcp|pmdas)/weblog(/|$)' >pcp-pmda-weblog-files +basic_manifest | keep '(etc/pcp|pmdas)/zimbra(/|$)' >pcp-pmda-zimbra-files +basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files + +rm -f packages.list +for pmda_package in \ + activemq apache \ + bash bcc bind2 bonding bpf bpftrace \ + cifs cisco \ + dbping denki docker dm ds389 ds389log \ + elasticsearch \ + gfs2 gluster gpfs gpsd \ + hacluster haproxy \ + infiniband \ + json \ + libvirt lio lmsensors logger lustre lustrecomm \ + mailq memcache mic mounts mongodb mssql mysql \ + named netcheck netfilter news nfsclient nginx \ + nutcracker nvidia \ + openmetrics openvswitch oracle \ + pdns perfevent podman postfix postgresql \ + rabbitmq redis roomtemp rpm rsyslog \ + samba sendmail shping slurm smart snmp \ + sockets statsd summary systemd \ + unbound \ + trace \ + weblog \ + zimbra zswap ; \ +do \ + pmda_packages="$pmda_packages pcp-pmda-$pmda_package"; \ +done + +for import_package in \ + collectl2pcp iostat2pcp ganglia2pcp mrtg2pcp sar2pcp sheet2pcp ; \ +do \ + import_packages="$import_packages pcp-import-$import_package"; \ +done + +for export_package in \ + pcp2elasticsearch pcp2graphite pcp2influxdb pcp2json \ + pcp2spark pcp2xlsx pcp2xml pcp2zabbix zabbix-agent ; \ +do \ + export_packages="$export_packages pcp-export-$export_package"; \ +done + +for subpackage in \ + pcp-conf pcp-gui pcp-doc pcp-libs pcp-devel pcp-libs-devel \ + pcp-selinux pcp-system-tools pcp-testsuite pcp-zeroconf \ + $pmda_packages $import_packages $export_packages ; \ +do \ + echo $subpackage >> packages.list; \ +done + +rm -f *-files.rpm *-tmpfiles.rpm +sort -u $DIST_MANIFEST | awk ' +function loadfiles(files) { + system ("touch " files"-files"); + filelist=files"-files"; + while (getline < filelist) { + if (length(pkg[$0]) > 0 && pkg[$0] != files) + print "Dup: ", $0, " package: ", pkg[$0], " and ", files; + if (length(pkg[$0]) == 0) + pkg[$0] = files; + } +} +BEGIN { + while (getline < "packages.list") loadfiles($0); + while (getline < "confpath.list") conf[nconf++]=$0; +} +{ + if (pkg[$NF]) p=pkg[$NF]; + else p="pcp"; + f=p"-files.rpm"; +} +$1 == "d" { + if (match ($5, "'$PCP_RUN_DIR'")) { + printf ("%%%%ghost ") >> f; + } + if (match ($5, "'$PCP_VAR_DIR'/testsuite")) { + $3 = $4 = "pcpqa"; + } + printf ("%%%%dir %%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $5) >> f + } +$1 == "f" && $6 ~ "etc/pcp\\.conf" { printf ("%%%%config ") >> f; } +$1 == "f" && $6 ~ "etc/pcp\\.env" { printf ("%%%%config ") >> f; } +$1 == "f" && $6 ~ "etc/pcp\\.sh" { printf ("%%%%config ") >> f; } +$1 == "f" { + for (i=0; i < nconf; i++) { + if ($6 ~ conf[i]) { + printf ("%%%%config(noreplace) ") >> f; + break; + } + } + if (match ($6, "'$PCP_VAR_DIR'/testsuite")) { + $3 = $4 = "pcpqa"; + } + if (match ($6, "'$PCP_MAN_DIR'") || match ($6, "'$PCP_DOC_DIR'")) { + printf ("%%%%doc ") >> f; + } + printf ("%%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $6) >> f + } +$1 == "l" { +%if !%{disable_systemd} + if (match ($3, "'$PCP_VAR_DIR'")) { + print $3 >> p"-tmpfiles"; + if (length(tmpfiles[p]) == 0) { + printf ("'$PCP_SYSTEMDTMPFILES_DIR'/%s.conf\n", p) >> f; + tmpfiles[p] = p; + } + } +%endif + print $3 >> f; + }' + +%if !%{disable_systemd} +mkdir -p $DIST_ROOT/$PCP_SYSTEMDTMPFILES_DIR +sort -u $DIST_TMPFILES | awk ' +function loadtmpfiles(files) { + system ("touch " files"-tmpfiles"); + filelist=files"-tmpfiles"; + while (getline < filelist) { + if (pkg[$0] && pkg[$0] != files) + print "Dup: ", $0, " package: ", pkg[$0], " and ", files; + pkg[$0] = files; + } +} +BEGIN { + while (getline < "packages.list") loadtmpfiles($0); +} +{ + if (pkg[$2]) p=pkg[$2]; + else p="pcp"; + f=p".conf"; + printf ("%s\n", $0) >> f; +}' + +%if %{disable_mssql} +# TODO: integrate better into the PCP build (via autoconf) +# so that this and other mssql artifacts are not generated. +rm -f pcp-pmda-mssql.conf +%endif + +for tmpfile in *.conf ; \ +do \ + mv $tmpfile $DIST_ROOT/$PCP_SYSTEMDTMPFILES_DIR/$tmpfile; \ +done +%endif + +%pre testsuite +test -d %{_testsdir} || mkdir -p -m 755 %{_testsdir} +getent group pcpqa >/dev/null || groupadd -r pcpqa +getent passwd pcpqa >/dev/null || \ + useradd -c "PCP Quality Assurance" -g pcpqa -d %{_testsdir} -M -r -s /bin/bash pcpqa 2>/dev/null +chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null +exit 0 + +%post testsuite +chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null +%if 0%{?rhel} +%if !%{disable_systemd} + systemctl restart pmcd pmlogger >/dev/null 2>&1 + systemctl enable pmcd pmlogger >/dev/null 2>&1 +%else + /sbin/chkconfig --add pmcd >/dev/null 2>&1 + /sbin/chkconfig --add pmlogger >/dev/null 2>&1 + /sbin/service pmcd condrestart + /sbin/service pmlogger condrestart +%endif +%endif +exit 0 + +%pre +getent group pcp >/dev/null || groupadd -r pcp +getent passwd pcp >/dev/null || \ + useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp +exit 0 + +%if !%{disable_systemd} +%preun pmda-systemd +%{pmda_remove "$1" "systemd"} +%endif + +%if !%{disable_infiniband} +%preun pmda-infiniband +%{pmda_remove "$1" "infiniband"} +%endif + +%if !%{disable_perfevent} +%preun pmda-perfevent +%{pmda_remove "$1" "perfevent"} +%endif + +%if !%{disable_podman} +%preun pmda-podman +%{pmda_remove "$1" "podman"} +%endif + +%if !%{disable_statsd} +%preun pmda-statsd +%{pmda_remove "$1" "statsd"} +%endif + +%if !%{disable_json} +%preun pmda-json +%{pmda_remove "$1" "json"} +%endif + +%preun pmda-nginx +%{pmda_remove "$1" "nginx"} + +%preun pmda-oracle +%{pmda_remove "$1" "oracle"} + +%preun pmda-postgresql +%{pmda_remove "$1" "postgresql"} + +%preun pmda-postfix +%{pmda_remove "$1" "postfix"} + +%preun pmda-elasticsearch +%{pmda_remove "$1" "elasticsearch"} + +%preun pmda-openvswitch +%{pmda_remove "$1" "openvswitch"} + +%preun pmda-rabbitmq +%{pmda_remove "$1" "rabbitmq"} + +%if !%{disable_snmp} +%preun pmda-snmp +%{pmda_remove "$1" "snmp"} +%endif + +%preun pmda-mysql +%{pmda_remove "$1" "mysql"} + +%preun pmda-activemq +%{pmda_remove "$1" "activemq"} + +%preun pmda-bind2 +%{pmda_remove "$1" "bind2"} + +%preun pmda-bonding +%{pmda_remove "$1" "bonding"} + +%preun pmda-dbping +%{pmda_remove "$1" "dbping"} + +%preun pmda-denki +%{pmda_remove "$1" "denki"} + +%preun pmda-docker +%{pmda_remove "$1" "docker"} + +%preun pmda-ds389 +%{pmda_remove "$1" "ds389"} + +%preun pmda-ds389log +%{pmda_remove "$1" "ds389log"} + +%preun pmda-gpfs +%{pmda_remove "$1" "gpfs"} + +%preun pmda-gpsd +%{pmda_remove "$1" "gpsd"} + +%preun pmda-lio +%{pmda_remove "$1" "lio"} + +%preun pmda-openmetrics +%{pmda_remove "$1" "openmetrics"} + +%preun pmda-lustre +%{pmda_remove "$1" "lustre"} + +%preun pmda-lustrecomm +%{pmda_remove "$1" "lustrecomm"} + +%preun pmda-memcache +%{pmda_remove "$1" "memcache"} + +%preun pmda-named +%{pmda_remove "$1" "named"} + +%preun pmda-netfilter +%{pmda_remove "$1" "netfilter"} + +%preun pmda-news +%{pmda_remove "$1" "news"} + +%preun pmda-nfsclient +%{pmda_remove "$1" "nfsclient"} + +%if !%{disable_nutcracker} +%preun pmda-nutcracker +%{pmda_remove "$1" "nutcracker"} +%endif + +%preun pmda-pdns +%{pmda_remove "$1" "pdns"} + +%preun pmda-rsyslog +%{pmda_remove "$1" "rsyslog"} + +%preun pmda-redis +%{pmda_remove "$1" "redis"} + +%preun pmda-samba +%{pmda_remove "$1" "samba"} + +%preun pmda-zimbra +%{pmda_remove "$1" "zimbra"} + +%preun pmda-dm +%{pmda_remove "$1" "dm"} + +%if !%{disable_bcc} +%preun pmda-bcc +%{pmda_remove "$1" "bcc"} +%endif + +%if !%{disable_bpf} +%preun pmda-bpf +%{pmda_remove "$1" "bpf"} +%endif + +%if !%{disable_bpftrace} +%preun pmda-bpftrace +%{pmda_remove "$1" "bpftrace"} +%endif + +%if !%{disable_python2} || !%{disable_python3} +%preun pmda-gluster +%{pmda_remove "$1" "gluster"} + +%preun pmda-zswap +%{pmda_remove "$1" "zswap"} + +%preun pmda-unbound +%{pmda_remove "$1" "unbound"} + +%preun pmda-mic +%{pmda_remove "$1" "mic"} + +%preun pmda-haproxy +%{pmda_remove "$1" "haproxy"} + +%preun pmda-libvirt +%{pmda_remove "$1" "libvirt"} + +%preun pmda-lmsensors +%{pmda_remove "$1" "lmsensors"} + +%preun pmda-mongodb +%{pmda_remove "$1" "mongodb"} + +%if !%{disable_mssql} +%preun pmda-mssql +%{pmda_remove "$1" "mssql"} +%endif + +%preun pmda-netcheck +%{pmda_remove "$1" "netcheck"} + +%endif + +%preun pmda-apache +%{pmda_remove "$1" "apache"} + +%preun pmda-bash +%{pmda_remove "$1" "bash"} + +%preun pmda-cifs +%{pmda_remove "$1" "cifs"} + +%preun pmda-cisco +%{pmda_remove "$1" "cisco"} + +%preun pmda-gfs2 +%{pmda_remove "$1" "gfs2"} + +%preun pmda-logger +%{pmda_remove "$1" "logger"} + +%preun pmda-mailq +%{pmda_remove "$1" "mailq"} + +%preun pmda-mounts +%{pmda_remove "$1" "mounts"} + +%preun pmda-nvidia-gpu +%{pmda_remove "$1" "nvidia"} + +%preun pmda-roomtemp +%{pmda_remove "$1" "roomtemp"} + +%preun pmda-sendmail +%{pmda_remove "$1" "sendmail"} + +%preun pmda-shping +%{pmda_remove "$1" "shping"} + +%preun pmda-smart +%{pmda_remove "$1" "smart"} + +%preun pmda-sockets +%{pmda_remove "$1" "sockets"} + +%preun pmda-hacluster +%{pmda_remove "$1" "hacluster"} + +%preun pmda-summary +%{pmda_remove "$1" "summary"} + +%preun pmda-trace +%{pmda_remove "$1" "trace"} + +%preun pmda-weblog +%{pmda_remove "$1" "weblog"} + +%if !%{disable_systemd} +%preun zeroconf +if [ "$1" -eq 0 ] +then + %systemd_preun pmlogger_daily_report.timer pmlogger_daily_report.service +fi +%endif + +%preun +if [ "$1" -eq 0 ] +then + # stop daemons before erasing the package + %if !%{disable_systemd} + %systemd_preun pmlogger_check.timer pmlogger_daily.timer pmlogger_farm_check.timer pmlogger_farm_check.service pmlogger_farm.service pmlogger.service pmie_check.timer pmie_daily.timer pmie_farm_check.timer pmie_farm_check.service pmie_farm.service pmie.service pmproxy.service pmfind.service pmcd.service + + systemctl stop pmlogger.service pmie.service pmproxy.service pmfind.service pmcd.service >/dev/null 2>&1 + %else + /sbin/service pmlogger stop >/dev/null 2>&1 + /sbin/service pmie stop >/dev/null 2>&1 + /sbin/service pmproxy stop >/dev/null 2>&1 + /sbin/service pmcd stop >/dev/null 2>&1 + + /sbin/chkconfig --del pcp >/dev/null 2>&1 + /sbin/chkconfig --del pmcd >/dev/null 2>&1 + /sbin/chkconfig --del pmlogger >/dev/null 2>&1 + /sbin/chkconfig --del pmie >/dev/null 2>&1 + /sbin/chkconfig --del pmproxy >/dev/null 2>&1 + %endif + # cleanup namespace state/flag, may still exist + PCP_PMNS_DIR=%{_pmnsdir} + rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1 +fi + +%post zeroconf +PCP_PMDAS_DIR=%{_pmdasdir} +PCP_SYSCONFIG_DIR=%{_sysconfdir}/sysconfig +PCP_PMCDCONF_PATH=%{_confdir}/pmcd/pmcd.conf +# auto-install important PMDAs for RH Support (if not present already) +for PMDA in dm nfsclient openmetrics ; do + if ! grep -q "$PMDA/pmda$PMDA" "$PCP_PMCDCONF_PATH" + then + %{install_file "$PCP_PMDAS_DIR/$PMDA" .NeedInstall} + fi +done +# auto-enable these usually optional pmie rules +pmieconf -c enable dmthin +%if 0%{?rhel} +%if !%{disable_systemd} + systemctl restart pmcd pmlogger pmie >/dev/null 2>&1 + systemctl enable pmcd pmlogger pmie >/dev/null 2>&1 +%else + /sbin/chkconfig --add pmcd >/dev/null 2>&1 + /sbin/chkconfig --add pmlogger >/dev/null 2>&1 + /sbin/chkconfig --add pmie >/dev/null 2>&1 + /sbin/service pmcd condrestart + /sbin/service pmlogger condrestart + /sbin/service pmie condrestart +%endif +%endif + +%if !%{disable_selinux} +%post selinux +%{selinux_handle_policy "$1" "pcpupstream"} + +%triggerin selinux -- docker-selinux +%{selinux_handle_policy "$1" "pcpupstream-docker"} + +%triggerin selinux -- container-selinux +%{selinux_handle_policy "$1" "pcpupstream-container"} +%endif + +%post +PCP_PMNS_DIR=%{_pmnsdir} +PCP_LOG_DIR=%{_logsdir} +%{install_file "$PCP_PMNS_DIR" .NeedRebuild} +%{install_file "$PCP_LOG_DIR/pmlogger" .NeedRewrite} +%if !%{disable_systemd} + # clean up any stale symlinks for deprecated pm*-poll services + rm -f %{_sysconfdir}/systemd/system/pm*.requires/pm*-poll.* >/dev/null 2>&1 || true + + %systemd_postun_with_restart pmcd.service + %systemd_post pmcd.service + %systemd_postun_with_restart pmlogger.service + %systemd_post pmlogger.service + %systemd_postun_with_restart pmie.service + %systemd_post pmie.service + %systemd_postun_with_restart pmproxy.service + %systemd_post pmproxy.service + %systemd_post pmfind.service +%else + /sbin/chkconfig --add pmcd >/dev/null 2>&1 + /sbin/service pmcd condrestart + /sbin/chkconfig --add pmlogger >/dev/null 2>&1 + /sbin/service pmlogger condrestart + /sbin/chkconfig --add pmie >/dev/null 2>&1 + /sbin/service pmie condrestart + /sbin/chkconfig --add pmproxy >/dev/null 2>&1 + /sbin/service pmproxy condrestart +%endif +%{rebuild_pmns "$PCP_PMNS_DIR" .NeedRebuild} + +%if 0%{?fedora} >= 26 || 0%{?rhel} > 7 +%ldconfig_scriptlets libs +%else +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig +%endif + +%if !%{disable_selinux} +%preun selinux +%{selinux_handle_policy "$1" "pcpupstream"} + +%triggerun selinux -- docker-selinux +%{selinux_handle_policy "$1" "pcpupstream-docker"} + +%triggerun selinux -- container-selinux +%{selinux_handle_policy "$1" "pcpupstream-container"} +%endif + +%files -f pcp-files.rpm +%doc CHANGELOG COPYING INSTALL.md README.md VERSION.pcp pcp.lsm +%ghost %dir %attr(0775,pcp,pcp) %{_localstatedir}/run/pcp + +%files conf -f pcp-conf-files.rpm + +%files libs -f pcp-libs-files.rpm + +%files libs-devel -f pcp-libs-devel-files.rpm + +%files devel -f pcp-devel-files.rpm + +%files doc -f pcp-doc-files.rpm + +%if !%{disable_selinux} +%files selinux -f pcp-selinux-files.rpm +%endif + +%if !%{disable_qt} +%files gui -f pcp-gui-files.rpm +%endif + +%files testsuite -f pcp-testsuite-files.rpm + +%if !%{disable_infiniband} +%files pmda-infiniband -f pcp-pmda-infiniband-files.rpm +%endif + +%if !%{disable_podman} +%files pmda-podman -f pcp-pmda-podman-files.rpm +%endif + +%if !%{disable_statsd} +%files pmda-statsd -f pcp-pmda-statsd-files.rpm +%endif + +%if !%{disable_perfevent} +%files pmda-perfevent -f pcp-pmda-perfevent-files.rpm +%endif + +%if !%{disable_perl} +%files pmda-activemq -f pcp-pmda-activemq-files.rpm +%endif + +%if !%{disable_perl} +%files pmda-bind2 -f pcp-pmda-bind2-files.rpm +%endif + +%if !%{disable_nutcracker} +%files pmda-nutcracker -f pcp-pmda-nutcracker-files.rpm +%endif + +%if !%{disable_python2} || !%{disable_python3} +%files pmda-elasticsearch -f pcp-pmda-elasticsearch-files.rpm +%endif + +%if !%{disable_perl} +%files pmda-redis -f pcp-pmda-redis-files.rpm + +%files pmda-bonding -f pcp-pmda-bonding-files.rpm + +%files pmda-dbping -f pcp-pmda-dbping-files.rpm + +%files pmda-ds389log -f pcp-pmda-ds389log-files.rpm + +%files pmda-ds389 -f pcp-pmda-ds389-files.rpm + +%files pmda-gpfs -f pcp-pmda-gpfs-files.rpm + +%files pmda-gpsd -f pcp-pmda-gpsd-files.rpm + +%files pmda-lustre -f pcp-pmda-lustre-files.rpm + +%files pmda-memcache -f pcp-pmda-memcache-files.rpm + +%files pmda-named -f pcp-pmda-named-files.rpm + +%files pmda-netfilter -f pcp-pmda-netfilter-files.rpm + +%files pmda-news -f pcp-pmda-news-files.rpm + +%files pmda-pdns -f pcp-pmda-pdns-files.rpm + +%files pmda-rsyslog -f pcp-pmda-rsyslog-files.rpm + +%files pmda-samba -f pcp-pmda-samba-files.rpm + +%files pmda-slurm -f pcp-pmda-slurm-files.rpm + +%files pmda-zimbra -f pcp-pmda-zimbra-files.rpm +%endif + +%files pmda-denki -f pcp-pmda-denki-files.rpm + +%files pmda-docker -f pcp-pmda-docker-files.rpm + +%files pmda-lustrecomm -f pcp-pmda-lustrecomm-files.rpm + +%if !%{disable_perl} +%files pmda-mysql -f pcp-pmda-mysql-files.rpm +%endif + +%files pmda-nginx -f pcp-pmda-nginx-files.rpm + +%if !%{disable_perl} +%files pmda-postfix -f pcp-pmda-postfix-files.rpm +%endif + +%if !%{disable_python2} || !%{disable_python3} +%files pmda-postgresql -f pcp-pmda-postgresql-files.rpm +%endif + +%if !%{disable_perl} +%files pmda-oracle -f pcp-pmda-oracle-files.rpm +%endif + +%if !%{disable_perl} +%files pmda-snmp -f pcp-pmda-snmp-files.rpm +%endif + +%files pmda-dm -f pcp-pmda-dm-files.rpm + +%if !%{disable_bcc} +%files pmda-bcc -f pcp-pmda-bcc-files.rpm +%endif + +%if !%{disable_bpf} +%files pmda-bpf -f pcp-pmda-bpf-files.rpm +%endif + +%if !%{disable_bpftrace} +%files pmda-bpftrace -f pcp-pmda-bpftrace-files.rpm +%endif + +%if !%{disable_python2} || !%{disable_python3} +%files pmda-gluster -f pcp-pmda-gluster-files.rpm + +%files pmda-zswap -f pcp-pmda-zswap-files.rpm + +%files pmda-unbound -f pcp-pmda-unbound-files.rpm + +%files pmda-mic -f pcp-pmda-mic-files.rpm + +%files pmda-haproxy -f pcp-pmda-haproxy-files.rpm + +%files pmda-lmsensors -f pcp-pmda-lmsensors-files.rpm + +%files pmda-mongodb -f pcp-pmda-mongodb-files.rpm + +%if !%{disable_mssql} +%files pmda-mssql -f pcp-pmda-mssql-files.rpm +%endif + +%files pmda-netcheck -f pcp-pmda-netcheck-files.rpm + +%files pmda-nfsclient -f pcp-pmda-nfsclient-files.rpm + +%files pmda-openvswitch -f pcp-pmda-openvswitch-files.rpm + +%files pmda-rabbitmq -f pcp-pmda-rabbitmq-files.rpm + +%files export-pcp2graphite -f pcp-export-pcp2graphite-files.rpm + +%files export-pcp2json -f pcp-export-pcp2json-files.rpm + +%files export-pcp2spark -f pcp-export-pcp2spark-files.rpm + +%files export-pcp2xml -f pcp-export-pcp2xml-files.rpm + +%files export-pcp2zabbix -f pcp-export-pcp2zabbix-files.rpm +%endif + +%if !%{disable_python2} || !%{disable_python3} +%files export-pcp2elasticsearch -f pcp-export-pcp2elasticsearch-files.rpm +%endif + +%if !%{disable_python2} || !%{disable_python3} +%files export-pcp2influxdb -f pcp-export-pcp2influxdb-files.rpm +%endif + +%if !%{disable_xlsx} +%files export-pcp2xlsx -f pcp-export-pcp2xlsx-files.rpm +%endif + +%files export-zabbix-agent -f pcp-export-zabbix-agent-files.rpm + +%if !%{disable_json} +%files pmda-json -f pcp-pmda-json-files.rpm +%endif + +%if !%{disable_python2} || !%{disable_python3} +%files pmda-libvirt -f pcp-pmda-libvirt-files.rpm + +%files pmda-lio -f pcp-pmda-lio-files.rpm + +%files pmda-openmetrics -f pcp-pmda-openmetrics-files.rpm +%endif + +%files pmda-apache -f pcp-pmda-apache-files.rpm + +%files pmda-bash -f pcp-pmda-bash-files.rpm + +%files pmda-cifs -f pcp-pmda-cifs-files.rpm + +%files pmda-cisco -f pcp-pmda-cisco-files.rpm + +%files pmda-gfs2 -f pcp-pmda-gfs2-files.rpm + +%files pmda-logger -f pcp-pmda-logger-files.rpm + +%files pmda-mailq -f pcp-pmda-mailq-files.rpm + +%files pmda-mounts -f pcp-pmda-mounts-files.rpm + +%files pmda-nvidia-gpu -f pcp-pmda-nvidia-files.rpm + +%files pmda-roomtemp -f pcp-pmda-roomtemp-files.rpm + +%files pmda-sendmail -f pcp-pmda-sendmail-files.rpm + +%files pmda-shping -f pcp-pmda-shping-files.rpm + +%files pmda-smart -f pcp-pmda-smart-files.rpm + +%files pmda-sockets -f pcp-pmda-sockets-files.rpm + +%files pmda-hacluster -f pcp-pmda-hacluster-files.rpm + +%files pmda-summary -f pcp-pmda-summary-files.rpm + +%if !%{disable_systemd} +%files pmda-systemd -f pcp-pmda-systemd-files.rpm +%endif + +%files pmda-trace -f pcp-pmda-trace-files.rpm + +%files pmda-weblog -f pcp-pmda-weblog-files.rpm + +%if !%{disable_perl} +%files import-sar2pcp -f pcp-import-sar2pcp-files.rpm + +%files import-iostat2pcp -f pcp-import-iostat2pcp-files.rpm + +#TODO: +#%%files import-sheet2pcp -f pcp-import-sheet2pcp-files.rpm + +%files import-mrtg2pcp -f pcp-import-mrtg2pcp-files.rpm + +%files import-ganglia2pcp -f pcp-import-ganglia2pcp-files.rpm +%endif + +%files import-collectl2pcp -f pcp-import-collectl2pcp-files.rpm + +%if !%{disable_perl} +%files -n perl-PCP-PMDA -f perl-pcp-pmda.list + +%files -n perl-PCP-MMV -f perl-pcp-mmv.list + +%files -n perl-PCP-LogImport -f perl-pcp-logimport.list + +%files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list +%endif + +%if !%{disable_python2} +%files -n %{__python2}-pcp -f python-pcp.list.rpm +%endif + +%if !%{disable_python3} +%files -n python3-pcp -f python3-pcp.list.rpm +%endif + +%files system-tools -f pcp-system-tools-files.rpm + +%files zeroconf -f pcp-zeroconf-files.rpm + +%changelog +* Wed Feb 02 2022 Nathan Scott - 5.3.5-8 +- Fix pcp-zeroconf logger interval override regression (BZ 1991763) +- Remove warnings from spec setup of PCP systemd units (BZ 2048024) + +* Thu Dec 16 2021 Andreas Gerstmayr - 5.3.5-6 +- pmdabcc: update qa/1118 testcase to match new output (BZ 2003956) + +* Wed Dec 15 2021 Nathan Scott - 5.3.5-4 +- pmdabcc: resolve compilation issues of some bcc PMDA modules on + aarch64, ppc64le and s390x (BZ 2003956) +- Further improve pmlogger service startup latency (BZ 1973833) +- Additional improvements to farm systemd services (BZ 2027753) + +* Thu Dec 09 2021 Nathan Scott - 5.3.5-3 +- Resolve failure in the Nvidia metrics agent (BZ 2029301) +- PMDA indom cache loading performance improvements (BZ 2030121) +- Consistent user experience for new farm services (BZ 2027753) +- Resilience improvements for the pmproxy service (BZ 2030140) + +* Fri Nov 26 2021 Nathan Scott - 5.3.5-2 +- Updates to pmlogconf persistence changes (BZ 2017632) + +* Wed Nov 10 2021 Nathan Scott - 5.3.5-1 +- Extend pmlogger(1) man page --interval option (BZ 2018083) +- Disable Avahi service advertisement by default (BZ 1899625) +- Use separate localhost and farm service cgroups (BZ 1991896) +- Update and extend the Nvidia GPU metric coverage (BZ 1690590) +- Assessment API and pmdamssql(1) share credentials (BZ 1951342) +- Improve remote pmlogger over slow network connections (BZ 1973833) +- Implement pcp-atop(1) support for Nvidia GPU reports (BZ 1984273) +- Drop DMA[32] zones when the zone is not in node 0 (BZ 1985519) +- Support kernel changes to /proc/zoneinfo metrics (BZ 1985523) +- Ensure pmlogconf persists configuration changes (BZ 2017632) +- Auto-reconnect lost redis connection in pmproxy (BZ 1989287) +- Rebase to a more recent upstream version of PCP (BZ 1991763) + +* Fri Oct 15 2021 Mark Goodwin - 5.3.4-2 +- Fix pmlogger manual start with service disabled (BZ 2018011) + +* Fri Oct 08 2021 Nathan Scott - 5.3.4-1 +- Add pcp-atop(1) support for 'curscal' values (BZ 1984271) +- Fix pcp-atop(1) reporting perfevent 'ipc' values (BZ 1986264) +- Fix pmlogger(1) exiting on receipt of SIGALRM (BZ 2004771) +- Fix values of some hacluster metrics on s390x (BZ 2008298) +- Add new pmdads389(1) metrics for replication (BZ 1966122) +- Rebase to a more recent upstream version of PCP (BZ 1991763) + +* Wed Sep 15 2021 Nathan Scott - 5.3.3-1 +- Add new pmdads389(1) metrics for replication (BZ 1966122) +- Add label support to pmdahacluster(1) metrics (BZ 1972277) +- Improve pmieconf rules for saturated processors (BZ 1994680) +- Auto-upgrade pmcd.conf for python2 to python3 (BZ 1988403) +- Document unloading pmdakvm(1) for kernel module (BZ 1977740) +- Add option to pmdalinux(1) for slabinfo metrics (BZ 1962902) +- Fix for OpenMetrics scripting generating AVCs (BZ 1985818) +- Resolve some pcp-testsuite failures (BZ 1980459, 1981686) +- Rebase to a more recent upstream version of PCP (BZ 1991763) + +* Sat Aug 28 2021 Nathan Scott - 5.3.1-5 +- Fix pmdapodman initialization and selinux policy (BZ 1962019) + +* Fri Jul 09 2021 Mark Goodwin - 5.3.1-3 +- Improve pmproxy and libpcp_web scalability (BZ 1975069) +- Provide a pcp-ss(1) tool in pcp-system-tools (BZ 1879350) + +* Thu Jun 24 2021 Nathan Scott - 5.3.1-2 +- Fix pmproxy parallel TLS requests bug (BZ 1947989) +- Backport pmrep archive creation fix (BZ 1974266) + +* Fri Jun 04 2021 Nathan Scott - 5.3.1-1 +- Improved diagnostics from pmie service scripts (BZ 1954576) +- Drop option configuration file env var setting (BZ 1967174) +- Add pmie support for thermal throttle detection (BZ 1908212) +- Annotate a couple of obscure config files in rpm (BZ 1964253) +- Rebase to a more recent upstream version of PCP (BZ 1922040) + +* Fri May 14 2021 Nathan Scott - 5.3.0-4 +- Improve pmchart duplicate archive diagnostics (BZ 1615718) +- Save pmchart users prefered archive locations (BZ 1615742) +- Remove libvarlink dependency from podman PMDA (BZ 1956608) + +* Thu Apr 22 2021 Nathan Scott - 5.3.0-3 +- Correct pcp-testsuite file permissions (BZ 1922040) + +* Tue Apr 20 2021 Nathan Scott - 5.3.0-2 +- Resolve pcp-testsuite linkage problems (BZ 1950263) + +* Fri Apr 16 2021 Nathan Scott - 5.3.0-1 +- Allow pcp-atop to filter processes on state (BZ 1807046) +- Dynamically adjust the pmproxy open file limit (BZ 1954711) +- Rebase to a more recent upstream version of PCP (BZ 1922040) +- PCP scalability and memory footprint improvements (BZ 1942292) + +* Fri Feb 19 2021 Nathan Scott - 5.2.5-4 +- Revert removal of pmcd unit dependencies (BZs 1929556, 1930284) + +* Fri Feb 12 2021 Mark Goodwin - 5.2.5-3 +- Specify pmns_name in sockets PMDA Install and Remove scripts +- Add selinux rules for pmcd to use netlink tcpdiag sockets (BZ 1926756) + +* Mon Feb 08 2021 Andreas Gerstmayr - 5.2.5-2 +- Fixed typo in specfile (pcp-testsuite requires pcp-pmda-hacluster + and pcp-pmda-sockets instead of pcp-pmdas-hacluster etc.) + +* Mon Feb 08 2021 Nathan Scott - 5.2.5-1 +- Extended socket statistic metrics (BZ 1491892) +- Add explicit umask to startup scripts (BZ 1833647) +- Fix pmlogger scripts fore remote loggers (BZ 1919950) +- Enhance selinux policy for netcheck metrics (BZ 1897719) +- Resolve packaging issue related to tmpfiles (BZ 1919974) +- Ensure online help text exists for all metrics (BZ 1670029) +- Adds HA cluster metrics (Pacemaker, Corosync, DRBD and SBD) +- Rebase to a more recent upstream version of PCP (BZ 1854035) + +* Fri Dec 18 2020 Nathan Scott - 5.2.3-1 +- Adds a new pcp-htop(1) utility (BZ 1716242) +- Adds per-process network metrics to pcp-atop(1) (BZ 1733901) +- Rebase to latest upstream stable release of PCP (BZ 1854035) +- Resolves an selinux issue in the netcheck agent (BZ 1897719) +- Rebase to a more recent upstream version of PCP (BZ 1854035) + +* Wed Nov 11 2020 Nathan Scott - 5.2.2-1 +- Add online help text for PCP derived metrics (BZ 1670029) +- Add process accounting metrics and pcp-atop support (BZ 1814526) +- Fix pmchart recorded archive folio host names (BZ 1824403) +- Fix selinux issue with secure pmcd connections (BZ 1857396) +- Extend pmlogger_daily script compression docs (BZ 1880392) +- perfevent support for hv_24x7/hv_gpci dynamic events (BZ 1889613) +- Improve pmlogger multiple remote node setups (BZ 1892326) +- Rebase to a more recent upstream version of PCP (BZ 1854035) + +* Tue Sep 29 2020 Nathan Scott - 5.2.1-2 +- Fix rpm spec permissions for pmie and sa directories (BZ 1882615) +- Add versioned rpm spec dependencies for pcp-zeroconf (BZ 1882664) + +* Fri Sep 25 2020 Nathan Scott - 5.2.1-1 +- Interactive mode in pcp-atop for time intervals (BZ 1806824) +- Add branch-to-specific-time feature in pcp-atop (BZ 1806927) +- Fix hostname written to archive folio by pmchart (BZ 1824403) +- Allow pmafm to function with compressed archives (BZ 1839666) +- Fix folio handling of archive files outside /tmp (BZ 1839698) +- pcp-pmda-lio deals with a missing kernel module (BZ 1843792) +- Windows authentication mode for SQL Server PMDA (BZ 1847808) +- Fix previous sample selection within pcp-atop (BZ 1847925) +- Make pcp-atopsar honour the -e (end time) option (BZ 1851838) +- Fix pcp-pmda-zswap crashing with namespace error (BZ 1851887) +- Fix pcp-atopsar handling of -H (header) option (BZ 1857121) +- Update pcp-free(1) to show 'shared' memory usage (BZ 1878768) +- Rebase to a more recent upstream version of PCP (BZ 1854035) + +* Tue Jun 23 2020 Mark Goodwin - 5.1.1-3 +- Fix for missing runtime deps on perl Net::SNMP (BZ 1790433) +- Resolve covscan and other issues from upstream QA (BZ 1849511) +- Possible memory leak detected in pcp-atop (BZ 1846705) +- Installation of pcp-pmda-samba causes SELinux issues (BZ 1790452) +- Fix Intermittent pminfo crashes (BZ 1848995) +- Silence openmetrics PMDA warnings, add status metrics (BZ 1846711) +- Set PACKAGE_BUILD in VERSION.pcp so pmcd.build metric is correct + +* Thu Jun 11 2020 Mark Goodwin - 5.1.1-2 +- Activate pmlogger_rewrite on upgrades (BZ 1541406) +- Fix Coverity issues in pmdastatsd and pmlogconf (BZ 1792971) +- libpcp_web: ensure context is freed only after timer is fully closed +- Services: pmlogger and pmie services Want pmcd on boot +- Fix intermittent pmlogconf core dumps (BZ 1845241) +- pcp-atop: resolve potential null task pointer dereference +- pmproxy: improve diagnostics, particularly relating to http requests +- pmproxy: cleanup, remove unused flags and dead code in http encoding +- pmproxy: support the OPTIONS protocol in HTTP 1.1 +- libpcp_web: add resilience to descriptor lookup paths (BZ 1837153) + +* Fri May 29 2020 Mark Goodwin - 5.1.1-1 +- Rebuild to pick up changed HdrHistogram_c version (BZ 1831502) +- pmdakvm: handle kernel lockdown in integrity mode (BZ 1824297) +- PCP_NSSDB_DIR should not be mentioned in /etc/pcp.conf (BZ 1826020) +- pmie_daily.service runs as pcp but tries to do root things (BZ 1832262) +- pcp-testsuite-5.1.0-2.el8 package is missing pcpqa.pp file (BZ 1835422) +- GFS2 kernel trace points turning on by themselves (BZ 1825386) +- pcp-atop various fixes (BZ 1818710) +- SELinux prevents pmlogger from secure connection to remote pmcd (BZ 1826047) +- pmda-lustre fails to start since lustre 2.12 (BZ 1788937) +- Added labels support for pmrep and various pcp2xxx tools +- Update to latest pcp-5.1.1 PCP sources. + +* Fri May 08 2020 Mark Goodwin - 5.1.0-2 +- Replace pmdads389log dep on 389-ds-base with a softdep +- Fix install deps for pcp-testsuite on pcp-pmda-mssql +- Improve pmlogger and pmie system log messages (BZ 1806428) +- Missing dep of pcp-pmda-dbping on perl-DBI (BZ 1790421) +- Missing dep of pcp-pmda-ds389log on 389-ds-base (BZ 1790422) +- Missing dep of pcp-pmda-gpsd on perl-JSON and perl-Time-HiRes (BZ 1790426) +- Missing dep of pcp-pmda-lmsensors on lm_sensors (BZ 1790427) +- Missing dep of pcp-pmda-redis on perl-autodie (BZ 1790431) +- Missing dep of pcp-pmda-smart on smartmontools (BZ 1790432) +- Missing dep of pcp-pmda-snmp on net-snmp-perl (BZ 1790433) +- SELinux issues with pcp-pmda-zimbra (BZ 1790437) +- Missing dep of pcp-pmda-pdns on perl-Time-HiRes (BZ 1790441) +- Installation of pcp-pmda-netcheck causes SELinux issue (BZ 1790450) +- Installation of pcp-pmda-samba causes SELinux issues (BZ 1790452) +- Some PMDAs are missing dependency on PCP (BZ 1790526) +- pmieconf randomly fails (BZ 1800545) +- collectl2pcp does not handle large collectl archives well (BZ 1785101) +- Missing dep of pcp-pmda-redis on perl-autodie and perl-Time-HiRes (BZ 1788519) +- Cannot install pcp-pmda-activemq, wrong location of RESTClient (BZ 1788878) +- Missing dep of pcp-pmda-bind2 on various perl packages (BZ 1790415) +- pmlogger_daily_report causing PCP upstream testsuite to fail (BZ 1805146) +- Missing selinux rules preventing pcp-pmda-named runing rndc(BZ 1825663) +- SELinux is preventing PostgreSQL PMDA to collect metrics (BZ 1825957) +- pmnewlog generates inaccessible config file (BZ 1810110) +- pmnewlog is causing PCP testsuite to hang (BZ 1810118) +- pmdakvm: debugfs access is restricted (BZ 1824297) +- Error starting pmlogger; pid file not owned by root (BZ 1761962) +- Update to latest PCP sources. + +* Wed Mar 11 2020 Mark Goodwin - 5.0.3-3 +- Resolve pcp-selinux issues causing services failures - (BZ 1810458) + +* Mon Mar 02 2020 Mark Goodwin - 5.0.3-2 +- Fix typo in Requires: perl-Time-HiRes affecting pcp-pmda-bind2 + +* Thu Feb 27 2020 Mark Goodwin - 5.0.3-1 +- Avoid python ctypes bitfield struct on-stack (BZ 1800685) +- Add dstat support for DM/MD/part devices (BZ 1794273) +- Fix compilation with gcc version 10 (BZ 1793495) +- Fix dstat sub-sample averaging (BZ 1780039) +- Update to latest PCP sources. + +* Wed Dec 11 2019 Nathan Scott - 5.0.2-1 +- Resolve fresh install pmlogger timeout bug (BZ 1721223) +- Fix dstat exception writing to a closed fd (BZ 1768619) +- Fix chan lib dependency of pcp-pmda-statsd (BZ 1770815) +- Update to latest PCP sources. + +* Mon Nov 04 2019 Nathan Scott - 5.0.1-1 +- Resolve selinux policy issues in PCP tools (BZ 1743040) +- Update to latest PCP sources. + +* Sun Oct 20 2019 Mark Goodwin - 5.0.0-2 +- Various spec fixes for pmdastatsd +- Add patch1 to fix pmdastatsd build on rawhide + +* Fri Oct 11 2019 Mark Goodwin - 5.0.0-1 +- Update to latest PCP sources. + +* Fri Aug 16 2019 Nathan Scott - 4.3.4-1 +- Resolve bootup issues with pmlogger service (BZ 1737091, BZ 1721223) +- Resolve selinux policy issues in PCP tools (BZ 1721644, BZ 1711547) +- Update to latest PCP sources. + +* Fri Jul 26 2019 Fedora Release Engineering - 4.3.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Jun 28 2019 Mark Goodwin - 4.3.3-1 +- Resolve segv running pmchart with bogus timezone (BZ 1718948) +- Resolve pmrep wait.formula for collectl-dm-sD and collectl-sD (BZ 1724288) +- Update to latest PCP sources. + +* Mon Jun 10 22:13:21 CET 2019 Igor Gnatenko - 4.3.2-4 +- Rebuild for RPM 4.15 + +* Mon Jun 10 15:42:04 CET 2019 Igor Gnatenko - 4.3.2-3 +- Rebuild for RPM 4.15 + +* Fri May 31 2019 Jitka Plesnikova - 4.3.2-2 +- Perl 5.30 rebuild + +* Fri Apr 26 2019 Mark Goodwin - 4.3.2-1 +- Resolve selinux policy issues for pmie daemon mode (BZ 1702589) +- Resolve selinux policy issues for BPF permissions (BZ 1693332) +- Further improvements to daily archive processing (BZ 1647390) +- Update to latest PCP sources. + +* Wed Feb 27 2019 Mark Goodwin - 4.3.1-1 +- Fixes pcp-dstat in --full (all instances) mode (BZ 1661912) +- Remove package dependencies on initscripts (BZ 1592380) +- Set include directory for cppcheck use (BZ 1663372) +- Update to latest PCP sources. + +* Fri Dec 21 2018 Nathan Scott - 4.3.0-1 +- Add the dstat -f/--full option to expand instances (BZ 1651536) +- Improve systemd interaction for local pmie (BZ 1650999) +- SELinux is preventing ps from 'search' accesses on the directory + .config (BZ 1569697) +- SELinux is preventing pmdalinux from 'search' accesses on + the directory /var/lib/libvirt/images (BZ 1579988) +- SELinux is preventing pmdalinux from 'unix_read' accesses + on the semáforo Unknown (BZ 1607658) +- SELinux is preventing pmdalinux from 'unix_read' accesses + on the shared memory Unknown (BZ 1618756, BZ 1619381, BZ 1601721) +- Update to latest PCP sources. + +* Fri Nov 16 2018 Mark Goodwin - 4.2.0-1 +- Resolves dstat packaging issues (BZ 1640912) +- Resolves dstat cursor positioning problem (BZ 1640913) +- Resolve a signal handling issue in dstat shutdown (BZ 1648552) +- Rename variable named await in python code (BZ 1633367) +- New conditionally-built pcp-pmda-podman sub-package. +- SELinux is preventing pmdalinux from 'unix_read' accesses on the shared memory labeled gpsd_t + (BZ 1626487) +- SELinux is preventing ps from 'search' accesses on the directory .cache + (BZ 1634205, BZ 1635522) +- SELinux is preventing ps from 'sys_ptrace' accesses on the cap_userns Unknown + (BZ 1635394) +- PCP SELinux AVCs (BZ 1633211) +- SELinux is preventing pmdalinux from 'search' accesses on the directory spider + (BZ 1647843) +- Update to latest PCP sources. + +* Fri Sep 21 2018 Nathan Scott - 4.1.3-1 +- Update to latest PCP sources. + +* Wed Aug 29 2018 Nathan Scott - 4.1.1-3 +- Updated versions of Vector (1.3.1) and Blinkenlights (1.0.1) webapps + +* Fri Aug 03 2018 Dave Brolley - 4.1.1-2 +- pcp.spec: Fix the _with_dstat reference in the %%configure command + +* Fri Aug 03 2018 Dave Brolley - 4.1.1-1 +- SELinux is preventing pmdalinux from 'unix_read' accesses on the shared memory Unknown + (BZ 1592901) +- SELinux is preventing pmdalinux from getattr, associate access on the shared memory Unknown + (BZ 1594991) +- PCP BCC PMDA AVCs (BZ 1597978) +- PCP BCC PMDA packaging issue (BZ 1597979) +- pmdaproc only reads the first 1024 bytes of the /proc/*/status file resulting in lost metric + values(BZ 1600262) +- Update to latest PCP sources. + +* Fri Jul 13 2018 Fedora Release Engineering - 4.1.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jul 03 2018 Petr Pisar - 4.1.0-6 +- Perl 5.28 rebuild + +* Fri Jun 29 2018 Miro Hrončok - 4.1.0-5 +- Rebuilt for Python 3.7 + +* Thu Jun 28 2018 Jitka Plesnikova - 4.1.0-4 +- Perl 5.28 rebuild + +* Tue Jun 19 2018 Miro Hrončok - 4.1.0-3 +- Rebuilt for Python 3.7 + +* Fri Jun 15 2018 Nathan Scott - 4.1.0-2 +- Rapid compression of PCP log data and metadata (BZ 1293471) +- Added Perl package build dependencies. +- Update to latest PCP sources. + +* Fri May 11 2018 Mark Goodwin - 4.0.2-1 +- Propogate build flags throughout PCP (BZ 1538187) +- Further additions to selinux policy (BZ 1565158) +- Update to Vector v1.2.2 in pcp-webapp-vector. +- Update to latest PCP sources. + +* Thu Mar 29 2018 Mark Goodwin - 4.0.1-1 +- Fix selinux policy to allow pmdagluster to work (BZ 1558708) +- pmcd binding only to localhost:44321 by default (BZ 1529915) +- Update to latest PCP sources. + +* Thu Mar 01 2018 Iryna Shcherbina - 4.0.0-3 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Tue Feb 20 2018 Nathan Scott - 4.0.0-2 +- Disable pmdabcc on architectures without BCC/eBPF support. + +* Fri Feb 16 2018 Nathan Scott - 4.0.0-1 +- pcp-atopsar: robustness around missing data (BZ 1508028) +- python pmcc method checking for missing metrics (BZ 1508026) +- Fix generic -s and -T option handling in libpcp (BZ 1352461) +- Resolve crash in local context mode in libpcp_pmda (BZ 1451475) +- python api: fix timezone segv from incorrect free (BZ 1352465) +- Remove section 1 and 5 man pages for pmview tool (BZ 1289126) +- Update to latest PCP sources. + +* Thu Feb 08 2018 Nathan Scott - 3.12.2-5 +- Update the Vector webapp to latest upstream (v1.2.1). + +* Wed Jan 10 2018 Lukas Berk - 3.12.2-4 +- Remove Obsoletes line for pcp-gui-debuginfo +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Tue Nov 07 2017 Igor Gnatenko - 3.12.2-2 +- Remove old crufty coreutils requires + +* Wed Oct 18 2017 Lukas Berk - 3.12.2-1 +- selinux: add pmlogger_exec_t rule from (BZ 1483320) +- selinux: pmlc accessing tcp port 4330 (BZ 1447585) +- selinux: pmnewlog.sh using ps to check pid's for pmloggers (BZ 1488116) +- Update to latest PCP sources. + +* Mon Aug 28 2017 Nathan Scott - 3.12.1-3 +- Disable infiniband and papi packages on armv7hl (BZ 1485692) + +* Fri Aug 25 2017 Lukas Berk - 3.12.1-2 +- Rebuild for infiniband dep breakage. + +* Wed Aug 16 2017 Nathan Scott - 3.12.1-1 +- Update to latest PCP sources. + +* Thu Jul 13 2017 Petr Pisar - 3.12.0-2 +- perl dependency renamed to perl-interpreter + + +* Fri Jun 30 2017 Lukas Berk - 3.12.0-1 +- Fix pcp-atop failure in open-ended write mode (BZ 1431292) +- Resolve additional selinux policy issues (BZ 1317515) +- Improve poor pmlogconf performance (BZ1376857) +- Update to latest PCP sources. + +* Mon Jun 05 2017 Jitka Plesnikova - 3.11.10-3 +- Perl 5.26 rebuild + +* Fri Jun 2 2017 Lukas Berk - 3.11.10-2 +- Correct subrpm inclusion of zeroconf config files (BZ 1456262) + +* Wed May 17 2017 Dave Brolley - 3.11.10-1 +- python api: handle non-POSIXLY_CORRECT getopt cases (BZ 1289912) +- Fix pmchart reaction to timezone changes from pmtime (BZ 968823) +- Require Qt5 for Fedora. +- Update to latest PCP sources. + +* Fri Mar 31 2017 Nathan Scott - 3.11.9-1 +- Fix pmchart chart legends toggling behaviour (BZ 1359961) +- Improve multiple local context attr handling (BZ 1430248) +- Fix error during installation of pcp-selinux (BZ 1433271) +- Update to latest PCP sources. + +* Fri Feb 17 2017 Lukas Berk - 3.11.8-1 +- Support newer kernels /proc/vmstat file contents (BZ 1396148) +- Added pcp-selinux policy (BZs 1214090, 1381127, 1337968, 1398147) + +* Wed Dec 21 2016 Dave Brolley - 3.11.7-1 +- pmchart run-away mem leak replaying multi-archive when rewinding (BZ 1359975) + +* Fri Nov 11 2016 Mark Goodwin - 3.11.6-1 +- Optimize DSO lookups for local context mode startup (BZ 1275293) +- Correct return code for derive metric help text (BZ 1336208) +- Improve pmrep metrics collection via extend_indom (BZ 1377464) +- Fix network.interface.speed value extraction (BZ 1379431) + +* Mon Sep 26 2016 Mark Goodwin - 3.11.5-1 +- Allow systemd-based auto-restart of all daemons (BZ 1365658) +- Ensure pmieconf and pmlogconf handle empty files (BZ 1249123) +- Ignore rpmsave and rpmnew suffixed control files (BZ 1375415) +- Add new pcp-pmda-libvirt package for virtual machine metrics +- Update to latest PCP sources. + +* Fri Aug 05 2016 Nathan Scott - 3.11.4-1 +- Support inside-container metric values in python (BZ 1333702) +- Fix pmdaproc handling of commands with whitespace (BZ 1350816) +- Use persistent DM names for the filesystem metrics (BZ 1349932) +- Add to the ds389{,log} RPM package dependencies (BZ 1354055) +- Use "dirsrv" as default pmdads389log user account (BZ 1357607) +- Make pmie(1) honour SIGINT while parsing rules (BZ 1327226) +- Add pmlogconf support for pcp-pidstat and pcp-mpstat (BZ 1361943) +- Update to latest PCP sources. + +* Fri Jun 17 2016 Nathan Scott - 3.11.3-1 +- Fix memory leak in derived metrics error handling (BZ 1331973) +- Correctly propogate indom in mixed derived metrics (BZ 1337212, BZ 1336130) +- Disallow stopping pmie/pmlogger daemons from cron (BZ 1336792) +- Fail fast for easily detected bad pmcd configuration (BZ 1336210) +- Implement primary (local) pmie concept in rc pmie (BZ 1323851) +- Update to latest PCP sources. + +* Mon May 16 2016 Jitka Plesnikova - 3.11.2-2.1 +- Perl 5.24 rebuild + +* Fri Apr 29 2016 Lukas Berk - 3.11.2-1 +- Negative nice values reported incorrectly (BZ 1328432) +- Multithreaded clients with concurrent pmNewContext improvements (BZ 1325363) +- PMCD agent auto-restart (BZ 1323521) +- Segv in libpcp during discovery error processing (BZ 1319288) +- Update to latest PCP sources. + +* Fri Mar 18 2016 Dave Brolley - 3.11.1-1 +- Call Remove script when uninstalling individual PMDAs (BZ 1304722) +- Restrict pmcd.services to checking known pcp services (BZ 1286361) +- Support for multi-archive contexts, across all clients (BZ 1262723) +- Remove the default shotgun approach to stopping daemons (BZ 1210976) +- Add mechanism for automatic recovery from PMDA timeouts (BZ 1065803) +- Update to latest PCP sources. + +* Fri Jan 29 2016 Mark Goodwin - 3.11.0-1 +- Significant speedups to elapsed time stopping pmcd (BZ 1292027) +- Fix python derived metric exception handling issues (BZ 1299806) +- incorrect interpolation across record in a merged archive (BZ 1296750) +- pcp requires pcp-compat pulling in a lot of unneeded pcp-pmda-* packages (BZ 1293466) +- Update to latest PCP sources. + +* Wed Dec 16 2015 Lukas Berk - 3.10.9-1 +- Add -V/--version support to several more commands (BZ 1284411) +- Resolve a pcp-iostat(1) transient device exception (BZ 1249572) +- Provides pmdapipe, an output-capturing domain agent (BZ 1163413) +- Python PMAPI pmSetMode allows None timeval parameter (BZ 1284417) +- Python PMI pmiPutValue now supports singular metrics (BZ 1285371) +- Fix python PMAPI pmRegisterDerived wrapper interface (BZ 1286733) +- Fix pmstat SEGV when run with graphical time control (BZ 1287678) +- Make pmNonOptionsFromList error message less cryptic (BZ 1287778) +- Drop unimplemented pmdumptext options from usage, man page (BZ 1289909) +- Stop creating configuration files in tmp_t locations (BZ 1256125) +- Update to latest PCP sources. + +* Fri Oct 30 2015 Mark Goodwin - 3.10.8-1 +- Update pmlogger to log an immediate sample first (BZ 1269921) +- Add pmOption host and archive setter python APIs (BZ 1270176) +- Replace old pmatop(1) man page with pcp-atop(1) (BZ 1270761) +- Update to latest PCP sources. + +* Wed Sep 16 2015 Nathan Scott - 3.10.7-1 +- Resolved pmchart sigsegv opening view without context (BZ 1256708) +- Fixed pmchart memory corruption restoring Saved Hosts (BZ 1257009) +- Fix perl PMDA API double-free on socket error path (BZ 1258862) +- Fix python API pmGetOption(3) alignment interface (BZ 1262722) +- Added missing RPM dependencies to several PMDA sub-packages. +- Update to latest stable Vector release for pcp-vector-webapp. +- Update to latest PCP sources. + +* Sat Sep 05 2015 Kalev Lember - 3.10.6-2.1 +- Rebuilt for librpm soname bump + +* Thu Aug 06 2015 Lukas Berk - 3.10.6-2 +- Fix SDT related build error (BZ 1250894) + +* Tue Aug 04 2015 Nathan Scott - 3.10.6-1 +- Fix pcp2graphite write method invocation failure (BZ 1243123) +- Reduce diagnostics in pmdaproc unknown state case (BZ 1224431) +- Derived metrics via multiple files, directory expansion (BZ 1235556) +- Update to latest PCP sources. + +* Mon Jun 15 2015 Mark Goodwin - 3.10.5-1 +- Provide and use non-exit(1)ing pmGetConfig(3) variant (BZ 1187588) +- Resolve a pmdaproc.sh pmlogger restart regression (BZ 1229458) +- Replacement of pmatop/pcp-atop(1) utility (BZ 1160811, BZ 1018575) +- Reduced installation size for minimal applications (BZ 1182184) +- Ensure pmlogger start scripts wait on pmcd startup (BZ 1185760) +- Need to run pmcd at least once before pmval -L will work (BZ 185749) + +* Wed Apr 15 2015 Nathan Scott - 3.10.4-1 +- Update to latest PCP, pcp-webjs and Vector sources. +- Packaging improvements after re-review (BZ 1204467) +- Start pmlogger/pmie independent of persistent state (BZ 1185755) +- Fix cron error reports for disabled pmlogger service (BZ 1208699) +- Incorporate Vector from Netflix (https://github.com/Netflix/vector) +- Sub-packages for pcp-webjs allowing choice and reducing used space. + +* Wed Mar 04 2015 Dave Brolley - 3.10.3-2 +- papi 5.4.1 rebuild + +* Mon Mar 02 2015 Dave Brolley - 3.10.3-1 +- Update to latest PCP sources. +- New sub-package for pcp-import-ganglia2pcp. +- Python3 support, enabled by default in f22 onward (BZ 1194324) + +* Mon Feb 23 2015 Slavek Kabrda - 3.10.2-3 +- Only use Python 3 in Fedora >= 23, more info at + https://bugzilla.redhat.com/show_bug.cgi?id=1194324#c4 + +* Mon Feb 23 2015 Nathan Scott - 3.10.2-2 +- Initial changes to support python3 as default (BZ 1194324) + +* Fri Jan 23 2015 Dave Brolley - 3.10.2-1 +- Update to latest PCP sources. +- Improve pmdaInit diagnostics for DSO helptext (BZ 1182949) +- Tighten up PMDA termination on pmcd stop (BZ 1180109) +- Correct units for cgroup memory metrics (BZ 1180351) +- Add the pcp2graphite(1) export script (BZ 1163986) + +* Mon Dec 01 2014 Nathan Scott - 3.10.1-1 +- New conditionally-built pcp-pmda-perfevent sub-package. +- Update to latest PCP sources. + +* Tue Nov 18 2014 Dave Brolley - 3.10.0-2 +- papi 5.4.0 rebuild + +* Fri Oct 31 2014 Nathan Scott - 3.10.0-1 +- Create new sub-packages for pcp-webjs and python3-pcp. +- Fix __pmDiscoverServicesWithOptions(1) codes (BZ 1139529) +- Update to latest PCP sources. + +* Fri Sep 05 2014 Nathan Scott - 3.9.10-1 +- Convert PCP init scripts to systemd services (BZ 996438) +- Fix pmlogsummary -S/-T time window reporting (BZ 1132476) +- Resolve pmdumptext segfault with invalid host (BZ 1131779) +- Fix signedness in some service discovery codes (BZ 1136166) +- New conditionally-built pcp-pmda-papi sub-package. +- Update to latest PCP sources. + +* Tue Aug 26 2014 Jitka Plesnikova - 3.9.9-1.2 +- Perl 5.20 rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 3.9.9-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Wed Aug 13 2014 Nathan Scott - 3.9.9-1 +- Update to latest PCP sources. + +* Wed Jul 16 2014 Mark Goodwin - 3.9.7-1 +- Update to latest PCP sources. + +* Wed Jun 18 2014 Dave Brolley - 3.9.5-1 +- Daemon signal handlers no longer use unsafe APIs (BZ 847343) +- Handle /var/run setups on a temporary filesystem (BZ 656659) +- Resolve pmlogcheck sigsegv for some archives (BZ 1077432) +- Ensure pcp-gui-{testsuite,debuginfo} packages get replaced. +- Revive support for EPEL5 builds, post pcp-gui merge. +- Update to latest PCP sources. + +* Fri Jun 06 2014 Fedora Release Engineering - 3.9.4-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu May 15 2014 Nathan Scott - 3.9.4-1 +- Merged pcp-gui and pcp-doc packages into core PCP. +- Allow for conditional libmicrohttpd builds in spec file. +- Adopt slow-start capability in systemd PMDA (BZ 1073658) +- Resolve pmcollectl network/disk mis-reporting (BZ 1097095) +- Update to latest PCP sources. + +* Tue Apr 15 2014 Dave Brolley - 3.9.2-1 +- Improve pmdarpm(1) concurrency complications (BZ 1044297) +- Fix pmconfig(1) shell output string quoting (BZ 1085401) +- Update to latest PCP sources. + +* Wed Mar 19 2014 Nathan Scott - 3.9.1-1 +- Update to latest PCP sources. + +* Thu Feb 20 2014 Nathan Scott - 3.9.0-2 +- Workaround further PowerPC/tapset-related build fallout. + +* Wed Feb 19 2014 Nathan Scott - 3.9.0-1 +- Create new sub-packages for pcp-webapi and pcp-manager +- Split configuration from pcp-libs into pcp-conf (multilib) +- Fix pmdagluster to handle more volumes, fileops (BZ 1066544) +- Update to latest PCP sources. + +* Wed Jan 29 2014 Nathan Scott - 3.8.12-1 +- Resolves SNMP procfs file ICMP line parse issue (BZ 1055818) +- Update to latest PCP sources. + +* Wed Jan 15 2014 Nathan Scott - 3.8.10-1 +- Update to latest PCP sources. + +* Thu Dec 12 2013 Nathan Scott - 3.8.9-1 +- Reduce set of exported symbols from DSO PMDAs (BZ 1025694) +- Symbol-versioning for PCP shared libraries (BZ 1037771) +- Fix pmcd/Avahi interaction with multiple ports (BZ 1035513) +- Update to latest PCP sources. + +* Sun Nov 03 2013 Nathan Scott - 3.8.8-1 +- Update to latest PCP sources (simple build fixes only). + +* Fri Nov 01 2013 Nathan Scott - 3.8.6-1 +- Update to latest PCP sources. +- Rework pmpost test which confused virus checkers (BZ 1024850) +- Tackle pmatop reporting issues via alternate metrics (BZ 998735) + +* Fri Oct 18 2013 Nathan Scott - 3.8.5-1 +- Update to latest PCP sources. +- Disable pcp-pmda-infiniband sub-package on RHEL5 (BZ 1016368) + +* Mon Sep 16 2013 Nathan Scott - 3.8.4-2 +- Disable the pcp-pmda-infiniband sub-package on s390 platforms. + +* Sun Sep 15 2013 Nathan Scott - 3.8.4-1 +- Very minor release containing mostly QA related changes. +- Enables many more metrics to be logged for Linux hosts. + +* Wed Sep 11 2013 Stan Cox - 3.8.3-2 +- Disable pmcd.stp on el5 ppc. + +* Mon Sep 09 2013 Nathan Scott - 3.8.3-1 +- Default to Unix domain socket (authenticated) local connections. +- Introduces new pcp-pmda-infiniband sub-package. +- Disable systemtap-sdt-devel usage on ppc. + +* Sat Aug 03 2013 Petr Pisar - 3.8.2-1.1 +- Perl 5.18 rebuild + +* Wed Jul 31 2013 Nathan Scott - 3.8.2-1 +- Update to latest PCP sources. +- Integrate gluster related stats with PCP (BZ 969348) +- Fix for iostat2pcp not parsing iostat output (BZ 981545) +- Start pmlogger with usable config by default (BZ 953759) +- Fix pmatop failing to start, gives stacktrace (BZ 963085) + +* Wed Jun 19 2013 Nathan Scott - 3.8.1-1 +- Update to latest PCP sources. +- Fix log import silently dropping >1024 metrics (BZ 968210) +- Move some commonly used tools on the usual PATH (BZ 967709) +- Improve pmatop handling of missing proc metrics (BZ 963085) +- Stop out-of-order records corrupting import logs (BZ 958745) + +* Tue May 14 2013 Nathan Scott - 3.8.0-1 +- Update to latest PCP sources. +- Validate metric names passed into pmiAddMetric (BZ 958019) +- Install log directories with correct ownership (BZ 960858) + +* Fri Apr 19 2013 Nathan Scott - 3.7.2-1 +- Update to latest PCP sources. +- Ensure root namespace exists at the end of install (BZ 952977) + +* Wed Mar 20 2013 Nathan Scott - 3.7.1-1 +- Update to latest PCP sources. +- Migrate all tempfiles correctly to the new tempdir hierarchy. + +* Sun Mar 10 2013 Nathan Scott - 3.7.0-1 +- Update to latest PCP sources. +- Migrate all configuration files below the /etc/pcp hierarchy. + +* Thu Feb 14 2013 Fedora Release Engineering - 3.6.10-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Nov 28 2012 Nathan Scott - 3.6.10-2 +- Ensure tmpfile directories created in %%files section. +- Resolve tmpfile create/teardown race conditions. + +* Mon Nov 19 2012 Nathan Scott - 3.6.10-1 +- Update to latest PCP sources. +- Resolve tmpfile security flaws: CVE-2012-5530 +- Introduces new "pcp" user account for all daemons to use. + +* Fri Oct 12 2012 Nathan Scott - 3.6.9-1 +- Update to latest PCP sources. +- Fix pmcd sigsegv in NUMA/CPU indom setup (BZ 858384) +- Fix sar2pcp uninitialised perl variable warning (BZ 859117) +- Fix pcp.py and pmcollectl with older python versions (BZ 852234) + +* Fri Sep 14 2012 Nathan Scott - 3.6.8-1 +- Update to latest PCP sources. + +* Wed Sep 05 2012 Nathan Scott - 3.6.6-1.1 +- Move configure step from prep to build section of spec (BZ 854128) + +* Tue Aug 28 2012 Mark Goodwin - 3.6.6-1 +- Update to latest PCP sources, see installed CHANGELOG for details. +- Introduces new python-pcp and pcp-testsuite sub-packages. + +* Thu Aug 16 2012 Mark Goodwin - 3.6.5-1 +- Update to latest PCP sources, see installed CHANGELOG for details. +- Fix security flaws: CVE-2012-3418 CVE-2012-3419 CVE-2012-3420 and CVE-2012-3421 (BZ 848629) + +* Thu Jul 19 2012 Mark Goodwin +- pmcd and pmlogger services are not supposed to be enabled by default (BZ 840763) - 3.6.3-1.3 + +* Thu Jun 21 2012 Mark Goodwin +- remove pcp-import-sheet2pcp subpackage due to missing deps (BZ 830923) - 3.6.3-1.2 + +* Fri May 18 2012 Dan Hork - 3.6.3-1.1 +- fix build on s390x + +* Mon Apr 30 2012 Mark Goodwin - 3.6.3-1 +- Update to latest PCP sources + +* Thu Apr 26 2012 Mark Goodwin - 3.6.2-1 +- Update to latest PCP sources + +* Thu Apr 12 2012 Mark Goodwin - 3.6.1-1 +- Update to latest PCP sources + +* Thu Mar 22 2012 Mark Goodwin - 3.6.0-1 +- use %%configure macro for correct libdir logic +- update to latest PCP sources + +* Thu Dec 15 2011 Mark Goodwin - 3.5.11-2 +- patched configure.in for libdir=/usr/lib64 on ppc64 + +* Thu Dec 01 2011 Mark Goodwin - 3.5.11-1 +- Update to latest PCP sources. + +* Fri Nov 04 2011 Mark Goodwin - 3.5.10-1 +- Update to latest PCP sources. + +* Mon Oct 24 2011 Mark Goodwin - 3.5.9-1 +- Update to latest PCP sources. + +* Mon Aug 08 2011 Mark Goodwin - 3.5.8-1 +- Update to latest PCP sources. + +* Fri Aug 05 2011 Mark Goodwin - 3.5.7-1 +- Update to latest PCP sources. + +* Fri Jul 22 2011 Mark Goodwin - 3.5.6-1 +- Update to latest PCP sources. + +* Tue Jul 19 2011 Mark Goodwin - 3.5.5-1 +- Update to latest PCP sources. + +* Thu Feb 03 2011 Mark Goodwin - 3.5.0-1 +- Update to latest PCP sources. + +* Thu Sep 30 2010 Mark Goodwin - 3.4.0-1 +- Update to latest PCP sources. + +* Fri Jul 16 2010 Mark Goodwin - 3.3.3-1 +- Update to latest PCP sources. + +* Sat Jul 10 2010 Mark Goodwin - 3.3.2-1 +- Update to latest PCP sources. + +* Tue Jun 29 2010 Mark Goodwin - 3.3.1-1 +- Update to latest PCP sources. + +* Fri Jun 25 2010 Mark Goodwin - 3.3.0-1 +- Update to latest PCP sources. + +* Thu Mar 18 2010 Mark Goodwin - 3.1.2-1 +- Update to latest PCP sources. + +* Wed Jan 27 2010 Mark Goodwin - 3.1.0-1 +- BuildRequires: initscripts for %%{_vendor} == redhat. + +* Thu Dec 10 2009 Mark Goodwin - 3.0.3-1 +- BuildRequires: initscripts for FC12. + +* Wed Dec 02 2009 Mark Goodwin - 3.0.2-1 +- Added sysfs.kernel metrics, rebased to minor community release. + +* Mon Oct 19 2009 Martin Hicks - 3.0.1-2 +- Remove IB dependencies. The Infiniband PMDA is being moved to + a stand-alone package. +- Move cluster PMDA to a stand-alone package. + +* Fri Oct 09 2009 Mark Goodwin - 3.0.0-9 +- This is the initial import for Fedora +- See 3.0.0 details in CHANGELOG diff --git a/redhat-bugzilla-1973833.patch b/redhat-bugzilla-1973833.patch new file mode 100644 index 0000000..ef1b249 --- /dev/null +++ b/redhat-bugzilla-1973833.patch @@ -0,0 +1,193 @@ +commit 6b907e90c74fce82d6b712493d8b362bdd1a1ec1 +Author: Nathan Scott +Date: Tue Dec 14 08:54:14 2021 +1100 + + pmlogconf: switch to the bulk pmLookupDescs(3) interface + + No functional change, all existing regression tests pass. + + Related to Red Hat BZ #1973833. + +diff --git a/src/pmlogconf/pmlogconf.c b/src/pmlogconf/pmlogconf.c +index fa1156859d..ef4fc08bbd 100644 +--- a/src/pmlogconf/pmlogconf.c ++++ b/src/pmlogconf/pmlogconf.c +@@ -473,13 +473,19 @@ fetch_groups(void) + { + static pmResult *result; + const char **names; ++ pmDesc *descs; + pmID *pmids; +- int i, n, sts; ++ int i, n, sts, count; + +- /* prepare arrays of names and identifiers for PMAPI metric lookup */ ++ /* prepare arrays of names, descriptors and IDs for PMAPI metric lookup */ + if ((names = calloc(ngroups, sizeof(char *))) == NULL) + return -ENOMEM; ++ if ((descs = calloc(ngroups, sizeof(pmDesc))) == NULL) { ++ free(names); ++ return -ENOMEM; ++ } + if ((pmids = calloc(ngroups, sizeof(pmID))) == NULL) { ++ free(descs); + free(names); + return -ENOMEM; + } +@@ -490,15 +496,16 @@ fetch_groups(void) + continue; + names[n++] = (const char *)groups[i].metric; + } ++ count = n; + +- if ((sts = pmLookupName(n, names, pmids)) < 0) { +- if (n == 1) ++ if ((sts = pmLookupName(count, names, pmids)) < 0) { ++ if (count == 1) + groups[0].pmid = PM_ID_NULL; + else + fprintf(stderr, "%s: cannot lookup metric names: %s\n", + pmGetProgname(), pmErrStr(sts)); + } +- else if ((sts = pmFetch(n, pmids, &result)) < 0) { ++ else if ((sts = pmFetch(count, pmids, &result)) < 0) { + fprintf(stderr, "%s: cannot fetch metric values: %s\n", + pmGetProgname(), pmErrStr(sts)); + } +@@ -510,6 +517,13 @@ fetch_groups(void) + else + groups[i].pmid = pmids[n++]; + } ++ /* descriptor lookup, descs_hash handles failure here */ ++ (void) pmLookupDescs(count, pmids, descs); ++ ++ /* create a hash over the descs for quick PMID lookup */ ++ if ((sts = descs_hash(count, descs)) < 0) ++ fprintf(stderr, "%s: cannot hash metric descs: %s\n", ++ pmGetProgname(), pmErrStr(sts)); + /* create a hash over the result for quick PMID lookup */ + if ((sts = values_hash(result)) < 0) + fprintf(stderr, "%s: cannot hash metric values: %s\n", +@@ -806,14 +820,16 @@ evaluate_string_regexp(group_t *group, regex_cmp_t compare) + int i, found; + pmValueSet *vsp; + pmValue *vp; ++ pmDesc *dp; + pmAtomValue atom; + regex_t regex; + int sts, type; + +- if ((vsp = metric_values(group->pmid)) == NULL) ++ if ((vsp = metric_values(group->pmid)) == NULL || ++ (dp = metric_desc(group->pmid)) == NULL) + return 0; + +- type = metric_type(group->pmid); ++ type = dp->type; + if (type < 0 || type > PM_TYPE_STRING) { + fprintf(stderr, "%s: %s uses regular expression on non-scalar metric\n", + pmGetProgname(), group->tag); +@@ -849,11 +865,14 @@ evaluate_string_regexp(group_t *group, regex_cmp_t compare) + static int + evaluate_values(group_t *group, numeric_cmp_t ncmp, string_cmp_t scmp) + { +- int type = metric_type(group->pmid); ++ pmDesc *dp; ++ ++ if ((dp = metric_desc(group->pmid)) == NULL) ++ return 0; + +- if (type == PM_TYPE_STRING) ++ if (dp->type == PM_TYPE_STRING) + return evaluate_string_values(group, scmp); +- return evaluate_number_values(group, type, ncmp); ++ return evaluate_number_values(group, dp->type, ncmp); + } + + int +diff --git a/src/pmlogconf/util.c b/src/pmlogconf/util.c +index d44c2e529a..293eb2eca3 100644 +--- a/src/pmlogconf/util.c ++++ b/src/pmlogconf/util.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2020 Red Hat. All Rights Reserved. ++ * Copyright (c) 2020-2021 Red Hat. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the +@@ -14,7 +14,7 @@ + #include "util.h" + + static __pmHashCtl valuesctl; /* pointers to values in pmResult */ +-static __pmHashCtl typesctl; /* metric types from pmLookupDesc */ ++static __pmHashCtl descsctl; /* metric descs from pmLookupDesc */ + + int + values_hash(pmResult *result) +@@ -47,27 +47,33 @@ metric_values(pmID pmid) + } + + int +-metric_type(pmID pmid) ++descs_hash(int numpmid, pmDesc *descs) + { +- __pmHashNode *node; +- pmDesc desc; +- int sts, *data; ++ unsigned int i; ++ pmDesc *dp; ++ int sts; + +- if (pmid == PM_IN_NULL) +- return PM_TYPE_UNKNOWN; +- if ((node = __pmHashSearch(pmid, &typesctl)) == NULL) { +- if ((sts = pmLookupDesc(pmid, &desc)) < 0) +- return sts; +- if ((data = malloc(sizeof(int))) == NULL) +- return sts; +- *data = desc.type; +- if ((sts = __pmHashAdd(pmid, data, &typesctl)) < 0) { +- free(data); ++ if ((sts = __pmHashPreAlloc(numpmid, &descsctl)) < 0) ++ return sts; ++ ++ for (i = 0; i < numpmid; i++) { ++ dp = &descs[i]; ++ if ((sts = __pmHashAdd(dp->pmid, dp, &descsctl)) < 0) + return sts; +- } +- return *data; + } +- return *(int *)node->data; ++ return numpmid; ++} ++ ++pmDesc * ++metric_desc(pmID pmid) ++{ ++ __pmHashNode *node; ++ ++ if (pmid == PM_IN_NULL) ++ return NULL; ++ if ((node = __pmHashSearch(pmid, &descsctl)) == NULL) ++ return NULL; ++ return (pmDesc *)node->data; + } + + int +diff --git a/src/pmlogconf/util.h b/src/pmlogconf/util.h +index 17d856a0d7..a11350d899 100644 +--- a/src/pmlogconf/util.h ++++ b/src/pmlogconf/util.h +@@ -34,7 +34,9 @@ extern void fmt(const char *, char *, size_t, int, int, fmt_t, void *); + + extern int values_hash(pmResult *); + extern pmValueSet *metric_values(pmID); +-extern int metric_type(pmID); ++ ++extern int descs_hash(int, pmDesc *); ++extern pmDesc *metric_desc(pmID); + + typedef int (*numeric_cmp_t)(double, double); + extern int number_equal(double, double); diff --git a/redhat-bugzilla-1991763.patch b/redhat-bugzilla-1991763.patch new file mode 100644 index 0000000..4d9dc7b --- /dev/null +++ b/redhat-bugzilla-1991763.patch @@ -0,0 +1,83 @@ +commit 69c7d9bf5ac24bda51f8c876dc258bfe054b7cf8 +Author: Sunil Mohan Adapa +Date: Tue Feb 1 09:55:23 2022 -0800 + + pmlogger: zeroconf: Prioritize user configuration over zeroconf + + In 2c17ba0cc16f58de511dff1e3122096d60c50bb0, zeroconf provided + defaults (/usr/share/pcp/zeroconf/pmlogger, which was actually + /etc/sysconf/pmlogger_zeroconf at the time of the change) were prioritized over + user configuration (/etc/sysconf/pmlogger). This lead to regression in clients + which edited the user configuration and expected the changes to be given + priority over zeroconf configuration. This was identified at least in + ansible-pcp[1]. + + Undo the changes in this commit so that the final priority is as follows: + + User configuration (/etc/sysconfig/pmlogger) + (priority over) + Zeroconf defaults (/usr/share/pcp/zeroconf/pmlogger) + (priority over) + Code defaults (pmlogger.c) + + Links: + + 1) https://github.com/performancecopilot/pcp/pull/1462#issuecomment-1022714960 + + Tests: + + - Install pcp. Ensure pmlogger is running. Notice that there is no + PMLOGGER_INTERVAL set in the pmlogger daemon's environment. + + - Install pcp-zeroconf. Restart pmlogger. Notice that PMLOGGER_INTERVAL + environment is set in the pmlogger daemon's environment. The value is 10. + + - Edit /etc/sysconfig/pmlogger and set the value of PMLOGGER_INTERVAL to 15. + Restart pmlogger and notice that PMLOGGER_INTERVAL is set to 15 in pmlogger + daemon's environment. + + Signed-off-by: Sunil Mohan Adapa + Tested-by: Sunil Mohan Adapa + +diff --git a/src/pmlogger/pmlogger.defaults b/src/pmlogger/pmlogger.defaults +index 1765760b5..1e96cd6ff 100644 +--- a/src/pmlogger/pmlogger.defaults ++++ b/src/pmlogger/pmlogger.defaults +@@ -1,7 +1,7 @@ + # Environment variables for the primary pmlogger daemon. See also + # the pmlogger control file and pmlogconf(1) for additional details. +-# Settings defined in this file will be overridden by any settings +-# in the pmlogger zeroconf file (if present). ++# Settings defined in this file will override any settings in the ++# pmlogger zeroconf file (if present). + + # Behaviour regarding listening on external-facing interfaces; + # unset PMLOGGER_LOCAL to allow connections from remote hosts. +diff --git a/src/pmlogger/pmlogger.zeroconf b/src/pmlogger/pmlogger.zeroconf +index 9defc6e3d..fe86dedcc 100644 +--- a/src/pmlogger/pmlogger.zeroconf ++++ b/src/pmlogger/pmlogger.zeroconf +@@ -1,6 +1,6 @@ + # +-# PMLOGGER environment variables defined in this file take precedence over +-# the same variables defined in the standard pmlogger config file. ++# PMLOGGER environment variables defined in the standard pmlogger config file ++# take precedence over the same variables defined in this file. + # + # The PMLOGGER_INTERVAL setting affects the default primary pmlogger recording + # frequency. This only affects the *default* interval setting when specified +diff --git a/src/pmlogger/pmlogger_check.sh b/src/pmlogger/pmlogger_check.sh +index 6cc2a8ed7..64750cb5f 100755 +--- a/src/pmlogger/pmlogger_check.sh ++++ b/src/pmlogger/pmlogger_check.sh +@@ -983,8 +983,8 @@ END { print m }'` + then + if [ "X$primary" = Xy ] + then +- # pcp-zeroconf environment variables (if present) take precedence +- envs=`grep -h ^PMLOGGER "$PMLOGGERENVS" "$PMLOGGERZEROCONFENVS" 2>/dev/null` ++ # User configuration takes precedence over pcp-zeroconf ++ envs=`grep -h ^PMLOGGER "$PMLOGGERZEROCONFENVS" "$PMLOGGERENVS" 2>/dev/null` + args="-P $args" + iam=" primary" + # clean up port-map, just in case diff --git a/redhat-bugzilla-2003956-pmdabcc-update-kernel-version-check-due-to-backporting.patch b/redhat-bugzilla-2003956-pmdabcc-update-kernel-version-check-due-to-backporting.patch new file mode 100644 index 0000000..3c7eaec --- /dev/null +++ b/redhat-bugzilla-2003956-pmdabcc-update-kernel-version-check-due-to-backporting.patch @@ -0,0 +1,20 @@ +bcc included in RHEL 8.6 doesn't support the kernel_struct_has_field function. +The 4.18.x kernel in RHEL 8.6 did backport the `state` to `__state` rename (upstream: +change was in kernel v5.14+), and now we're in a situation where we can't test for +the existence of this kernel struct member and also can't rely on a kernel version check. + +Therefore, let's patch it here for RHEL 8.x only: + +diff --git a/src/pmdas/bcc/modules/runqlat.python b/src/pmdas/bcc/modules/runqlat.python +index 1c6c6b4b0..efc30e958 100644 +--- a/src/pmdas/bcc/modules/runqlat.python ++++ b/src/pmdas/bcc/modules/runqlat.python +@@ -100,7 +100,7 @@ class PCPBCCModule(PCPBCCBase): + if ( + hasattr(BPF, "kernel_struct_has_field") + and BPF.kernel_struct_has_field(b"task_struct", b"__state") == 1 +- ) or self.kernel_version() >= (5, 14, 0): ++ ) or self.kernel_version() >= (4, 18, 0): + self.bpf_text = self.bpf_text.replace('STATE_FIELD', '__state') + else: + self.bpf_text = self.bpf_text.replace('STATE_FIELD', 'state') diff --git a/redhat-bugzilla-2003956.patch b/redhat-bugzilla-2003956.patch new file mode 100644 index 0000000..a027740 --- /dev/null +++ b/redhat-bugzilla-2003956.patch @@ -0,0 +1,1433 @@ +commit 14ffcd934e1c5099b471f4e73da32d1b32bac7e6 +Author: Andreas Gerstmayr +Date: Mon Dec 13 20:10:40 2021 +0100 + + pmdabcc: sync bcc PMDA modules with upstream bcc tools + +diff --git a/src/pmdas/bcc/modules/execsnoop.bpf b/src/pmdas/bcc/modules/execsnoop.bpf +index f69200773..aa755b3a1 100644 +--- a/src/pmdas/bcc/modules/execsnoop.bpf ++++ b/src/pmdas/bcc/modules/execsnoop.bpf +@@ -4,40 +4,57 @@ + #include + #include + #include ++ + #define ARGSIZE 128 ++ + enum event_type { + EVENT_ARG, + EVENT_RET, + }; ++ + struct data_t { + u32 pid; // PID as in the userspace term (i.e. task->tgid in kernel) + u32 ppid; // Parent PID as in the userspace term (i.e task->real_parent->tgid in kernel) ++ u32 uid; + char comm[TASK_COMM_LEN]; + enum event_type type; + char argv[ARGSIZE]; + int retval; + }; ++ + BPF_PERF_OUTPUT(events); ++ + static int __submit_arg(struct pt_regs *ctx, void *ptr, struct data_t *data) + { +- bpf_probe_read(data->argv, sizeof(data->argv), ptr); ++ bpf_probe_read_user(data->argv, sizeof(data->argv), ptr); + events.perf_submit(ctx, data, sizeof(struct data_t)); + return 1; + } ++ + static int submit_arg(struct pt_regs *ctx, void *ptr, struct data_t *data) + { + const char *argp = NULL; +- bpf_probe_read(&argp, sizeof(argp), ptr); ++ bpf_probe_read_user(&argp, sizeof(argp), ptr); + if (argp) { + return __submit_arg(ctx, (void *)(argp), data); + } + return 0; + } ++ + int syscall__execve(struct pt_regs *ctx, + const char __user *filename, + const char __user *const __user *__argv, + const char __user *const __user *__envp) + { ++ ++ u32 uid = bpf_get_current_uid_gid() & 0xffffffff; ++ ++ UID_FILTER ++ ++ if (container_should_be_filtered()) { ++ return 0; ++ } ++ + // create data here and pass to submit_arg to save stack space (#555) + struct data_t data = {}; + struct task_struct *task; +@@ -52,25 +69,37 @@ int syscall__execve(struct pt_regs *ctx, + + bpf_get_current_comm(&data.comm, sizeof(data.comm)); + data.type = EVENT_ARG; ++ + __submit_arg(ctx, (void *)filename, &data); ++ + // skip first arg, as we submitted filename + #pragma unroll + for (int i = 1; i < MAXARG; i++) { + if (submit_arg(ctx, (void *)&__argv[i], &data) == 0) + goto out; + } ++ + // handle truncated argument list + char ellipsis[] = "..."; + __submit_arg(ctx, (void *)ellipsis, &data); + out: + return 0; + } ++ + int do_ret_sys_execve(struct pt_regs *ctx) + { ++ if (container_should_be_filtered()) { ++ return 0; ++ } ++ + struct data_t data = {}; + struct task_struct *task; + ++ u32 uid = bpf_get_current_uid_gid() & 0xffffffff; ++ UID_FILTER ++ + data.pid = bpf_get_current_pid_tgid() >> 32; ++ data.uid = uid; + + task = (struct task_struct *)bpf_get_current_task(); + // Some kernels, like Ubuntu 4.13.0-generic, return 0 +@@ -82,5 +111,6 @@ int do_ret_sys_execve(struct pt_regs *ctx) + data.type = EVENT_RET; + data.retval = PT_REGS_RC(ctx); + events.perf_submit(ctx, &data, sizeof(data)); ++ + return 0; + } +diff --git a/src/pmdas/bcc/modules/execsnoop.python b/src/pmdas/bcc/modules/execsnoop.python +index 54382fa9b..1127cc471 100644 +--- a/src/pmdas/bcc/modules/execsnoop.python ++++ b/src/pmdas/bcc/modules/execsnoop.python +@@ -44,20 +44,6 @@ MODULE = 'execsnoop' + BASENS = 'proc.exec.' + units_none = pmUnits(0, 0, 0, 0, 0, 0) + +-TASK_COMM_LEN = 16 # linux/sched.h +-ARGSIZE = 128 # should match #define in execsnoop.bpf +- +-class Data(ct.Structure): +- """ execsnoop data struct """ +- _fields_ = [ +- ("pid", ct.c_uint), +- ("ppid", ct.c_uint), +- ("comm", ct.c_char * TASK_COMM_LEN), +- ("type", ct.c_int), +- ("argv", ct.c_char * ARGSIZE), +- ("retval", ct.c_int), +- ] +- + class EventType(object): + """ Event type """ + EVENT_ARG = 0 +@@ -137,7 +123,7 @@ class PCPBCCModule(PCPBCCBase): + + def handle_event(self, _cpu, data, _size): + """ Event handler """ +- event = ct.cast(data, ct.POINTER(Data)).contents ++ event = self.bpf["events"].event(data) + skip = False + + if event.type == EventType.EVENT_ARG: +@@ -145,9 +131,9 @@ class PCPBCCModule(PCPBCCBase): + elif event.type == EventType.EVENT_RET: + if event.retval != 0 and not self.include_failed: + skip = True +- if self.command and not re.search(self.command, event.comm): ++ if self.command and not re.search(bytes(self.command), event.comm): + skip = True +- if self.args and not re.search(self.args, b" ".join(self.argv_cache[event.pid])): ++ if self.args and not re.search(bytes(self.args), b" ".join(self.argv_cache[event.pid])): + skip = True + + if not skip: +@@ -177,10 +163,14 @@ class PCPBCCModule(PCPBCCBase): + + self.bpf_text = self.bpf_text.replace("MAXARG", str(self.max_args)) + ++ bpf_text = self.bpf_text ++ bpf_text = bpf_text.replace('UID_FILTER', '') ++ bpf_text = bpf_text.replace('container_should_be_filtered()', '0') ++ + if self.debug: +- self.log("BPF to be compiled:\n" + self.bpf_text.strip()) ++ self.log("BPF to be compiled:\n" + bpf_text.strip()) + +- self.bpf = BPF(text=self.bpf_text) ++ self.bpf = BPF(text=bpf_text) + execve_fnname = self.get_syscall_fnname("execve") + self.bpf.attach_kprobe(event=execve_fnname, fn_name="syscall__execve") + self.bpf.attach_kretprobe(event=execve_fnname, fn_name="do_ret_sys_execve") +diff --git a/src/pmdas/bcc/modules/pcpbcc.python b/src/pmdas/bcc/modules/pcpbcc.python +index 0555dc33f..62783b7fc 100644 +--- a/src/pmdas/bcc/modules/pcpbcc.python ++++ b/src/pmdas/bcc/modules/pcpbcc.python +@@ -14,6 +14,7 @@ + """ PCP BCC PMDA module base class """ + + import re ++import platform + import ctypes as ct + from os import kill, listdir, path + from collections import OrderedDict +@@ -348,6 +349,16 @@ class PCPBCCBase(object): + """ Returns BCC version as an int tuple (for comparisons) """ + return tuple(map(int, PCPBCCBase.bcc_version().split('.'))) + ++ @staticmethod ++ def kernel_version(): ++ """Returns the kernel version""" ++ version_str = platform.release() ++ m = re.match(r'^(\d+)\.(\d+)\.(\d+)', version_str) ++ if m: ++ return tuple(map(int, m.groups())) ++ else: ++ return (0, 0, 0) ++ + def perf_buffer_poller(self): + """ BPF poller """ + try: +diff --git a/src/pmdas/bcc/modules/runqlat.python b/src/pmdas/bcc/modules/runqlat.python +index 27007c7e5..1c6c6b4b0 100644 +--- a/src/pmdas/bcc/modules/runqlat.python ++++ b/src/pmdas/bcc/modules/runqlat.python +@@ -30,7 +30,11 @@ from modules.pcpbcc import PCPBCCBase + # + # BPF program + # +-bpf_src = "modules/runqlat.bpf" ++is_support_raw_tp = BPF.support_raw_tracepoint() ++if is_support_raw_tp: ++ bpf_src = "modules/runqlat_tp.bpf" ++else: ++ bpf_src = "modules/runqlat_kp.bpf" + + # + # PCP BCC PMDA constants +@@ -59,6 +63,7 @@ class PCPBCCModule(PCPBCCBase): + self.proc_filter = self.config.get(MODULE, opt) + self.update_pids(self.get_proc_info(self.proc_filter)) + ++ self.log("Using BPF source file %s." % bpf_src) + self.log("Initialized.") + + def metrics(self): +@@ -89,7 +94,23 @@ class PCPBCCModule(PCPBCCBase): + with open(path.dirname(__file__) + '/../' + bpf_src) as src: + self.bpf_text = src.read() + ++ # BPF.kernel_struct_has_field requires BCC v0.23.0 ++ # use kernel version check as alternative ++ # pylint: disable=no-member ++ if ( ++ hasattr(BPF, "kernel_struct_has_field") ++ and BPF.kernel_struct_has_field(b"task_struct", b"__state") == 1 ++ ) or self.kernel_version() >= (5, 14, 0): ++ self.bpf_text = self.bpf_text.replace('STATE_FIELD', '__state') ++ else: ++ self.bpf_text = self.bpf_text.replace('STATE_FIELD', 'state') ++ + self.bpf_text = self.bpf_text.replace("FILTER", "PID_CHECK") ++ self.bpf_text = self.bpf_text.replace('FACTOR', 'delta /= 1000;') ++ ++ self.bpf_text = self.bpf_text.replace('STORAGE', 'BPF_HISTOGRAM(dist);') ++ self.bpf_text = self.bpf_text.replace('STORE', ++ 'dist.increment(bpf_log2l(delta));') + + if not self.pids and self.proc_filter and self.proc_refresh: + self.log("No process to attach found, activation postponed.") +@@ -102,9 +123,11 @@ class PCPBCCModule(PCPBCCBase): + + self.reset_cache() + self.bpf = BPF(text=bpf_text) +- self.bpf.attach_kprobe(event="ttwu_do_wakeup", fn_name="trace_ttwu_do_wakeup") +- self.bpf.attach_kprobe(event="wake_up_new_task", fn_name="trace_wake_up_new_task") +- self.bpf.attach_kprobe(event_re=r"^finish_task_switch$|^finish_task_switch\.isra\.\d$", fn_name="trace_run") ++ if not is_support_raw_tp: ++ self.bpf.attach_kprobe(event="ttwu_do_wakeup", fn_name="trace_ttwu_do_wakeup") ++ self.bpf.attach_kprobe(event="wake_up_new_task", fn_name="trace_wake_up_new_task") ++ self.bpf.attach_kprobe(event_re=r"^finish_task_switch$|^finish_task_switch\.isra\.\d$", ++ fn_name="trace_run") + self.log("Compiled.") + except Exception as error: # pylint: disable=broad-except + self.bpf = None +diff --git a/src/pmdas/bcc/modules/runqlat.bpf b/src/pmdas/bcc/modules/runqlat_kp.bpf +similarity index 54% +rename from src/pmdas/bcc/modules/runqlat.bpf +rename to src/pmdas/bcc/modules/runqlat_kp.bpf +index a3664a035..dd643d600 100644 +--- a/src/pmdas/bcc/modules/runqlat.bpf ++++ b/src/pmdas/bcc/modules/runqlat_kp.bpf +@@ -5,6 +5,7 @@ + #include + #include + #include ++#include + + typedef struct pid_key { + u64 id; // work around +@@ -17,7 +18,7 @@ typedef struct pidns_key { + } pidns_key_t; + + BPF_HASH(start, u32); +-BPF_HISTOGRAM(dist); ++STORAGE + + struct rq; + +@@ -31,6 +32,45 @@ static int trace_enqueue(u32 tgid, u32 pid) + return 0; + } + ++static __always_inline unsigned int pid_namespace(struct task_struct *task) ++{ ++ ++/* pids[] was removed from task_struct since commit 2c4704756cab7cfa031ada4dab361562f0e357c0 ++ * Using the macro INIT_PID_LINK as a conditional judgment. ++ */ ++#ifdef INIT_PID_LINK ++ struct pid_link pids; ++ unsigned int level; ++ struct upid upid; ++ struct ns_common ns; ++ ++ /* get the pid namespace by following task_active_pid_ns(), ++ * pid->numbers[pid->level].ns ++ */ ++ bpf_probe_read_kernel(&pids, sizeof(pids), &task->pids[PIDTYPE_PID]); ++ bpf_probe_read_kernel(&level, sizeof(level), &pids.pid->level); ++ bpf_probe_read_kernel(&upid, sizeof(upid), &pids.pid->numbers[level]); ++ bpf_probe_read_kernel(&ns, sizeof(ns), &upid.ns->ns); ++ ++ return ns.inum; ++#else ++ struct pid *pid; ++ unsigned int level; ++ struct upid upid; ++ struct ns_common ns; ++ ++ /* get the pid namespace by following task_active_pid_ns(), ++ * pid->numbers[pid->level].ns ++ */ ++ bpf_probe_read_kernel(&pid, sizeof(pid), &task->thread_pid); ++ bpf_probe_read_kernel(&level, sizeof(level), &pid->level); ++ bpf_probe_read_kernel(&upid, sizeof(upid), &pid->numbers[level]); ++ bpf_probe_read_kernel(&ns, sizeof(ns), &upid.ns->ns); ++ ++ return ns.inum; ++#endif ++} ++ + int trace_wake_up_new_task(struct pt_regs *ctx, struct task_struct *p) + { + return trace_enqueue(p->tgid, p->pid); +@@ -48,7 +88,7 @@ int trace_run(struct pt_regs *ctx, struct task_struct *prev) + u32 pid, tgid; + + // ivcsw: treat like an enqueue event and store timestamp +- if (prev->state == TASK_RUNNING) { ++ if (prev->STATE_FIELD == TASK_RUNNING) { + tgid = prev->tgid; + pid = prev->pid; + if (!(FILTER || pid == 0)) { +@@ -69,10 +109,10 @@ int trace_run(struct pt_regs *ctx, struct task_struct *prev) + return 0; // missed enqueue + } + delta = bpf_ktime_get_ns() - *tsp; +- delta /= 1000; ++ FACTOR + + // store as histogram +- dist.increment(bpf_log2l(delta)); ++ STORE + + start.delete(&pid); + return 0; +diff --git a/src/pmdas/bcc/modules/runqlat_tp.bpf b/src/pmdas/bcc/modules/runqlat_tp.bpf +new file mode 100644 +index 000000000..f0e9ce69b +--- /dev/null ++++ b/src/pmdas/bcc/modules/runqlat_tp.bpf +@@ -0,0 +1,124 @@ ++// Copyright 2016 Netflix, Inc. ++// Licensed under the Apache License, Version 2.0 (the "License") ++ ++#include ++#include ++#include ++#include ++#include ++ ++typedef struct pid_key { ++ u64 id; // work around ++ u64 slot; ++} pid_key_t; ++ ++typedef struct pidns_key { ++ u64 id; // work around ++ u64 slot; ++} pidns_key_t; ++ ++BPF_HASH(start, u32); ++STORAGE ++ ++struct rq; ++ ++// record enqueue timestamp ++static int trace_enqueue(u32 tgid, u32 pid) ++{ ++ if (FILTER || pid == 0) ++ return 0; ++ u64 ts = bpf_ktime_get_ns(); ++ start.update(&pid, &ts); ++ return 0; ++} ++ ++static __always_inline unsigned int pid_namespace(struct task_struct *task) ++{ ++ ++/* pids[] was removed from task_struct since commit 2c4704756cab7cfa031ada4dab361562f0e357c0 ++ * Using the macro INIT_PID_LINK as a conditional judgment. ++ */ ++#ifdef INIT_PID_LINK ++ struct pid_link pids; ++ unsigned int level; ++ struct upid upid; ++ struct ns_common ns; ++ ++ /* get the pid namespace by following task_active_pid_ns(), ++ * pid->numbers[pid->level].ns ++ */ ++ bpf_probe_read_kernel(&pids, sizeof(pids), &task->pids[PIDTYPE_PID]); ++ bpf_probe_read_kernel(&level, sizeof(level), &pids.pid->level); ++ bpf_probe_read_kernel(&upid, sizeof(upid), &pids.pid->numbers[level]); ++ bpf_probe_read_kernel(&ns, sizeof(ns), &upid.ns->ns); ++ ++ return ns.inum; ++#else ++ struct pid *pid; ++ unsigned int level; ++ struct upid upid; ++ struct ns_common ns; ++ ++ /* get the pid namespace by following task_active_pid_ns(), ++ * pid->numbers[pid->level].ns ++ */ ++ bpf_probe_read_kernel(&pid, sizeof(pid), &task->thread_pid); ++ bpf_probe_read_kernel(&level, sizeof(level), &pid->level); ++ bpf_probe_read_kernel(&upid, sizeof(upid), &pid->numbers[level]); ++ bpf_probe_read_kernel(&ns, sizeof(ns), &upid.ns->ns); ++ ++ return ns.inum; ++#endif ++} ++ ++RAW_TRACEPOINT_PROBE(sched_wakeup) ++{ ++ // TP_PROTO(struct task_struct *p) ++ struct task_struct *p = (struct task_struct *)ctx->args[0]; ++ return trace_enqueue(p->tgid, p->pid); ++} ++ ++RAW_TRACEPOINT_PROBE(sched_wakeup_new) ++{ ++ // TP_PROTO(struct task_struct *p) ++ struct task_struct *p = (struct task_struct *)ctx->args[0]; ++ return trace_enqueue(p->tgid, p->pid); ++} ++ ++RAW_TRACEPOINT_PROBE(sched_switch) ++{ ++ // TP_PROTO(bool preempt, struct task_struct *prev, struct task_struct *next) ++ struct task_struct *prev = (struct task_struct *)ctx->args[1]; ++ struct task_struct *next = (struct task_struct *)ctx->args[2]; ++ u32 pid, tgid; ++ ++ // ivcsw: treat like an enqueue event and store timestamp ++ if (prev->STATE_FIELD == TASK_RUNNING) { ++ tgid = prev->tgid; ++ pid = prev->pid; ++ if (!(FILTER || pid == 0)) { ++ u64 ts = bpf_ktime_get_ns(); ++ start.update(&pid, &ts); ++ } ++ } ++ ++ tgid = next->tgid; ++ pid = next->pid; ++ if (FILTER || pid == 0) ++ return 0; ++ u64 *tsp, delta; ++ ++ // fetch timestamp and calculate delta ++ tsp = start.lookup(&pid); ++ if (tsp == 0) { ++ return 0; // missed enqueue ++ } ++ delta = bpf_ktime_get_ns() - *tsp; ++ FACTOR ++ ++ // store as histogram ++ STORE ++ ++ start.delete(&pid); ++ return 0; ++} +diff --git a/src/pmdas/bcc/modules/tcplife.python b/src/pmdas/bcc/modules/tcplife.python +index 0c6f17c36..02c693a6a 100644 +--- a/src/pmdas/bcc/modules/tcplife.python ++++ b/src/pmdas/bcc/modules/tcplife.python +@@ -37,16 +37,11 @@ from modules.pcpbcc import PCPBCCBase + # + # BPF program + # +-bpf_src = "modules/tcplife.bpf" +-# Compat with kernel < 4.16, bcc < 0.6 +-TRACEFS = "/sys/kernel/debug/tracing" +-bpf_src_old_tp = "modules/tcplife_old_tp.bpf" +-bpf_src_old_kb = "modules/tcplife_old_kb.bpf" +-if not path.exists(TRACEFS + "/events/sock/inet_sock_set_state"): +- if path.exists(TRACEFS + "/events/tcp/tcp_set_state"): +- bpf_src = bpf_src_old_tp +- else: +- bpf_src = bpf_src_old_kb ++if BPF.tracepoint_exists("sock", "inet_sock_set_state"): ++ bpf_src = "modules/tcplife_tp.bpf" ++else: ++ bpf_src = "modules/tcplife_kp.bpf" ++ + + # + # PCP BCC PMDA constants +@@ -57,35 +52,6 @@ units_bytes = pmUnits(1, 0, 0, PM_SPACE_BYTE, 0, 0) + units_usecs = pmUnits(0, 1, 0, 0, PM_TIME_USEC, 0) + units_none = pmUnits(0, 0, 0, 0, 0, 0) + +-TASK_COMM_LEN = 16 # linux/sched.h +- +-class Data_ipv4(ct.Structure): +- """ IPv4 data struct """ +- _fields_ = [ +- ("ts_us", ct.c_ulonglong), +- ("pid", ct.c_ulonglong), +- ("saddr", ct.c_ulonglong), +- ("daddr", ct.c_ulonglong), +- ("ports", ct.c_ulonglong), +- ("rx_b", ct.c_ulonglong), +- ("tx_b", ct.c_ulonglong), +- ("span_us", ct.c_ulonglong), +- ("task", ct.c_char * TASK_COMM_LEN) +- ] +- +-class Data_ipv6(ct.Structure): +- """ IPv6 data struct """ +- _fields_ = [ +- ("ts_us", ct.c_ulonglong), +- ("pid", ct.c_ulonglong), +- ("saddr", (ct.c_ulonglong * 2)), +- ("daddr", (ct.c_ulonglong * 2)), +- ("ports", ct.c_ulonglong), +- ("rx_b", ct.c_ulonglong), +- ("tx_b", ct.c_ulonglong), +- ("span_us", ct.c_ulonglong), +- ("task", ct.c_char * TASK_COMM_LEN) +- ] + + # + # PCP BCC Module +@@ -129,24 +95,22 @@ class PCPBCCModule(PCPBCCBase): + self.lock = Lock() + self.thread = None + +- # Compat with kernel < 4.16 + self.log("Using BPF source file %s." % bpf_src) + + # Exit hard if impossible to continue +- if self.bcc_version() == "0.6.1" and bpf_src == bpf_src_old_kb: +- raise RuntimeError("BCC 0.6.1 bug makes it incompatible with this module " +- "on kernel < 4.15.") ++ if self.bcc_version_tuple() < (0, 6, 1): ++ raise RuntimeError("BCC 0.6.1+ is required for this module.") + + self.log("Initialized.") + + def handle_ip_event(self, data, version): + """ IP event handler """ + if version == 4: +- event = ct.cast(data, ct.POINTER(Data_ipv4)).contents ++ event = self.bpf["ipv4_events"].event(data) + laddr = inet_ntop(AF_INET, pack("I", event.saddr)) + daddr = inet_ntop(AF_INET, pack("I", event.daddr)) + else: +- event = ct.cast(data, ct.POINTER(Data_ipv6)).contents ++ event = self.bpf["ipv6_events"].event(data) + laddr = inet_ntop(AF_INET6, event.saddr) + daddr = inet_ntop(AF_INET6, event.daddr) + +@@ -205,31 +169,25 @@ class PCPBCCModule(PCPBCCBase): + if not self.bpf_text: + with open(path.dirname(__file__) + '/../' + bpf_src) as src: + self.bpf_text = src.read() +- # Compat with bcc < 0.6 +- self.log("Testing BCC compatilibility, possible errors below are safe to ignore.") +- try: +- test_txt = self.bpf_text.replace("// NEW: ", "").replace("FILTER_PID", "") +- test_bpf = BPF(text=test_txt) +- test_bpf.cleanup() +- self.bpf_text = self.bpf_text.replace("// NEW: ", "") +- except Exception: # pylint: disable=broad-except +- self.bpf_text = self.bpf_text.replace("// OLD: ", "") +- self.log("Tested BCC compatilibility, possible errors above are safe to ignore.") + + if self.dports: + filterp = " && ".join(["dport != %d" % port for port in self.dports]) + filter_txt = "if (%s) { birth.delete(&sk); return 0; }" % filterp +- self.bpf_text = self.bpf_text.replace("//FILTER_DPORT", filter_txt) ++ self.bpf_text = self.bpf_text.replace("FILTER_DPORT", filter_txt) + if self.lports: + filterp = " && ".join(["lport != %d" % port for port in self.lports]) + filter_txt = "if (%s) { birth.delete(&sk); return 0; }" % filterp +- self.bpf_text = self.bpf_text.replace("//FILTER_LPORT", filter_txt) ++ self.bpf_text = self.bpf_text.replace("FILTER_LPORT", filter_txt) + + if not self.pids and self.proc_filter and self.proc_refresh: + self.log("No process to attach found, activation postponed.") + return + + bpf_text = self.apply_pid_filter(self.bpf_text, self.pids, False) ++ bpf_text = bpf_text.replace('FILTER_PID', '') ++ bpf_text = bpf_text.replace('FILTER_DPORT', '') ++ bpf_text = bpf_text.replace('FILTER_LPORT', '') ++ bpf_text = bpf_text.replace('FILTER_FAMILY', '') + + if self.debug: + self.log("BPF to be compiled:\n" + bpf_text.strip()) +diff --git a/src/pmdas/bcc/modules/tcplife_old_kb.bpf b/src/pmdas/bcc/modules/tcplife_kp.bpf +similarity index 81% +rename from src/pmdas/bcc/modules/tcplife_old_kb.bpf +rename to src/pmdas/bcc/modules/tcplife_kp.bpf +index eed01941a..5486c6a37 100644 +--- a/src/pmdas/bcc/modules/tcplife_old_kb.bpf ++++ b/src/pmdas/bcc/modules/tcplife_kp.bpf +@@ -2,7 +2,6 @@ + // Licensed under the Apache License, Version 2.0 (the "License") + + #include +-#define KBUILD_MODNAME "pcpbcctcplife" + #include + #include + #include +@@ -11,11 +10,10 @@ BPF_HASH(birth, struct sock *, u64); + + // separate data structs for ipv4 and ipv6 + struct ipv4_data_t { +- // XXX: switch some to u32's when supported + u64 ts_us; +- u64 pid; +- u64 saddr; +- u64 daddr; ++ u32 pid; ++ u32 saddr; ++ u32 daddr; + u64 ports; + u64 rx_b; + u64 tx_b; +@@ -26,7 +24,7 @@ BPF_PERF_OUTPUT(ipv4_events); + + struct ipv6_data_t { + u64 ts_us; +- u64 pid; ++ u32 pid; + unsigned __int128 saddr; + unsigned __int128 daddr; + u64 ports; +@@ -49,12 +47,12 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) + + // lport is either used in a filter here, or later + u16 lport = sk->__sk_common.skc_num; +- //FILTER_LPORT ++ FILTER_LPORT + + // dport is either used in a filter here, or later + u16 dport = sk->__sk_common.skc_dport; + dport = ntohs(dport); +- //FILTER_DPORT ++ FILTER_DPORT + + /* + * This tool includes PID and comm context. It's best effort, and may +@@ -74,6 +72,9 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) + * sets ESTABLISHED without a tcp_set_state() call. Until we know + * that for sure, match all early states to increase chances a + * timestamp is set. ++ * Note that this needs to be set before the PID filter later on, ++ * since the PID isn't reliable for these early stages, so we must ++ * save all timestamps and do the PID filter later when we can. + */ + u64 ts = bpf_ktime_get_ns(); + birth.update(&sk, &ts); +@@ -101,7 +102,7 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) + delta_us = (bpf_ktime_get_ns() - *tsp) / 1000; + birth.delete(&sk); + +- // fetch possible cached data ++ // fetch possible cached data, and filter + struct id_t *mep; + mep = whoami.lookup(&sk); + if (mep != 0) +@@ -116,9 +117,13 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) + + u16 family = sk->__sk_common.skc_family; + ++ FILTER_FAMILY ++ + if (family == AF_INET) { +- struct ipv4_data_t data4 = {.span_us = delta_us, +- .rx_b = rx_b, .tx_b = tx_b}; ++ struct ipv4_data_t data4 = {}; ++ data4.span_us = delta_us; ++ data4.rx_b = rx_b; ++ data4.tx_b = tx_b; + data4.ts_us = bpf_ktime_get_ns() / 1000; + data4.saddr = sk->__sk_common.skc_rcv_saddr; + data4.daddr = sk->__sk_common.skc_daddr; +@@ -128,17 +133,19 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) + if (mep == 0) { + bpf_get_current_comm(&data4.task, sizeof(data4.task)); + } else { +- bpf_probe_read(&data4.task, sizeof(data4.task), (void *)mep->task); ++ bpf_probe_read_kernel(&data4.task, sizeof(data4.task), (void *)mep->task); + } + ipv4_events.perf_submit(ctx, &data4, sizeof(data4)); + + } else /* 6 */ { +- struct ipv6_data_t data6 = {.span_us = delta_us, +- .rx_b = rx_b, .tx_b = tx_b}; ++ struct ipv6_data_t data6 = {}; ++ data6.span_us = delta_us; ++ data6.rx_b = rx_b; ++ data6.tx_b = tx_b; + data6.ts_us = bpf_ktime_get_ns() / 1000; +- bpf_probe_read(&data6.saddr, sizeof(data6.saddr), ++ bpf_probe_read_kernel(&data6.saddr, sizeof(data6.saddr), + sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); +- bpf_probe_read(&data6.daddr, sizeof(data6.daddr), ++ bpf_probe_read_kernel(&data6.daddr, sizeof(data6.daddr), + sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); + // a workaround until data6 compiles with separate lport/dport + data6.ports = dport + ((0ULL + lport) << 32); +@@ -146,7 +153,7 @@ int kprobe__tcp_set_state(struct pt_regs *ctx, struct sock *sk, int state) + if (mep == 0) { + bpf_get_current_comm(&data6.task, sizeof(data6.task)); + } else { +- bpf_probe_read(&data6.task, sizeof(data6.task), (void *)mep->task); ++ bpf_probe_read_kernel(&data6.task, sizeof(data6.task), (void *)mep->task); + } + ipv6_events.perf_submit(ctx, &data6, sizeof(data6)); + } +diff --git a/src/pmdas/bcc/modules/tcplife_old_tp.bpf b/src/pmdas/bcc/modules/tcplife_old_tp.bpf +deleted file mode 100644 +index a7c9c625c..000000000 +--- a/src/pmdas/bcc/modules/tcplife_old_tp.bpf ++++ /dev/null +@@ -1,166 +0,0 @@ +-// Copyright 2016 Netflix, Inc. +-// Licensed under the Apache License, Version 2.0 (the "License") +- +-#include +-#define KBUILD_MODNAME "pcpbcctcplife" +-#include +-#include +-#include +- +-BPF_HASH(birth, struct sock *, u64); +- +-// separate data structs for ipv4 and ipv6 +-struct ipv4_data_t { +- // XXX: switch some to u32's when supported +- u64 ts_us; +- u64 pid; +- u64 saddr; +- u64 daddr; +- u64 ports; +- u64 rx_b; +- u64 tx_b; +- u64 span_us; +- char task[TASK_COMM_LEN]; +-}; +-BPF_PERF_OUTPUT(ipv4_events); +- +-struct ipv6_data_t { +- u64 ts_us; +- u64 pid; +- unsigned __int128 saddr; +- unsigned __int128 daddr; +- u64 ports; +- u64 rx_b; +- u64 tx_b; +- u64 span_us; +- char task[TASK_COMM_LEN]; +-}; +-BPF_PERF_OUTPUT(ipv6_events); +- +-struct id_t { +- u32 pid; +- char task[TASK_COMM_LEN]; +-}; +-BPF_HASH(whoami, struct sock *, struct id_t); +- +-TRACEPOINT_PROBE(tcp, tcp_set_state) +-{ +- u32 pid = bpf_get_current_pid_tgid() >> 32; +- // sk is mostly used as a UUID, once for skc_family, and two tcp stats: +- struct sock *sk = (struct sock *)args->skaddr; +- +- // lport is either used in a filter here, or later +- u16 lport = args->sport; +- //FILTER_LPORT +- +- // dport is either used in a filter here, or later +- u16 dport = args->dport; +- //FILTER_DPORT +- +- /* +- * This tool includes PID and comm context. It's best effort, and may +- * be wrong in some situations. It currently works like this: +- * - record timestamp on any state < TCP_FIN_WAIT1 +- * - cache task context on: +- * TCP_SYN_SENT: tracing from client +- * TCP_LAST_ACK: client-closed from server +- * - do output on TCP_CLOSE: +- * fetch task context if cached, or use current task +- */ +- +- // capture birth time +- if (args->newstate < TCP_FIN_WAIT1) { +- /* +- * Matching just ESTABLISHED may be sufficient, provided no code-path +- * sets ESTABLISHED without a tcp_set_state() call. Until we know +- * that for sure, match all early states to increase chances a +- * timestamp is set. +- * Note that this needs to be set before the PID filter later on, +- * since the PID isn't reliable for these early stages, so we must +- * save all timestamps and do the PID filter later when we can. +- */ +- u64 ts = bpf_ktime_get_ns(); +- birth.update(&sk, &ts); +- } +- +- // record PID & comm on SYN_SENT +- if (args->newstate == TCP_SYN_SENT || args->newstate == TCP_LAST_ACK) { +- // now we can PID filter, both here and a little later on for CLOSE +- FILTER_PID +- struct id_t me = {.pid = pid}; +- bpf_get_current_comm(&me.task, sizeof(me.task)); +- whoami.update(&sk, &me); +- } +- +- if (args->newstate != TCP_CLOSE) +- return 0; +- +- // calculate lifespan +- u64 *tsp, delta_us; +- tsp = birth.lookup(&sk); +- if (tsp == 0) { +- whoami.delete(&sk); // may not exist +- return 0; // missed create +- } +- delta_us = (bpf_ktime_get_ns() - *tsp) / 1000; +- birth.delete(&sk); +- +- // fetch possible cached data, and filter +- struct id_t *mep; +- mep = whoami.lookup(&sk); +- if (mep != 0) +- pid = mep->pid; +- FILTER_PID +- +- // get throughput stats. see tcp_get_info(). +- u64 rx_b = 0, tx_b = 0, sport = 0; +- struct tcp_sock *tp = (struct tcp_sock *)sk; +- // OLD: bpf_probe_read(&rx_b, sizeof(rx_b), &tp->bytes_received); +- // OLD: bpf_probe_read(&tx_b, sizeof(tx_b), &tp->bytes_acked); +- // NEW: rx_b = tp->bytes_received; +- // NEW: tx_b = tp->bytes_acked; +- +- u16 family = 0; +- // OLD: bpf_probe_read(&family, sizeof(family), &sk->__sk_common.skc_family); +- // NEW: family = sk->__sk_common.skc_family; +- +- if (family == AF_INET) { +- +- struct ipv4_data_t data4 = {.span_us = delta_us, +- .rx_b = rx_b, .tx_b = tx_b}; +- data4.ts_us = bpf_ktime_get_ns() / 1000; +- bpf_probe_read(&data4.saddr, sizeof(u32), args->saddr); +- bpf_probe_read(&data4.daddr, sizeof(u32), args->daddr); +- // a workaround until data4 compiles with separate lport/dport +- data4.ports = dport + ((0ULL + lport) << 32); +- data4.pid = pid; +- +- if (mep == 0) { +- bpf_get_current_comm(&data4.task, sizeof(data4.task)); +- } else { +- bpf_probe_read(&data4.task, sizeof(data4.task), (void *)mep->task); +- } +- ipv4_events.perf_submit(args, &data4, sizeof(data4)); +- +- } else /* 6 */ { +- struct ipv6_data_t data6 = {.span_us = delta_us, +- .rx_b = rx_b, .tx_b = tx_b}; +- data6.ts_us = bpf_ktime_get_ns() / 1000; +- bpf_probe_read(&data6.saddr, sizeof(data6.saddr), args->saddr_v6); +- bpf_probe_read(&data6.daddr, sizeof(data6.daddr), args->saddr_v6); +- // a workaround until data6 compiles with separate lport/dport +- data6.ports = dport + ((0ULL + lport) << 32); +- data6.pid = pid; +- if (mep == 0) { +- bpf_get_current_comm(&data6.task, sizeof(data6.task)); +- } else { +- bpf_probe_read(&data6.task, sizeof(data6.task), (void *)mep->task); +- } +- ipv6_events.perf_submit(args, &data6, sizeof(data6)); +- } +- +- if (mep != 0) +- whoami.delete(&sk); +- +- return 0; +-} +diff --git a/src/pmdas/bcc/modules/tcplife.bpf b/src/pmdas/bcc/modules/tcplife_tp.bpf +similarity index 80% +rename from src/pmdas/bcc/modules/tcplife.bpf +rename to src/pmdas/bcc/modules/tcplife_tp.bpf +index 19ca8d740..2b16b98e7 100644 +--- a/src/pmdas/bcc/modules/tcplife.bpf ++++ b/src/pmdas/bcc/modules/tcplife_tp.bpf +@@ -2,7 +2,6 @@ + // Licensed under the Apache License, Version 2.0 (the "License") + + #include +-#define KBUILD_MODNAME "pcpbcctcplife" + #include + #include + #include +@@ -11,11 +10,10 @@ BPF_HASH(birth, struct sock *, u64); + + // separate data structs for ipv4 and ipv6 + struct ipv4_data_t { +- // XXX: switch some to u32's when supported + u64 ts_us; +- u64 pid; +- u64 saddr; +- u64 daddr; ++ u32 pid; ++ u32 saddr; ++ u32 daddr; + u64 ports; + u64 rx_b; + u64 tx_b; +@@ -26,7 +24,7 @@ BPF_PERF_OUTPUT(ipv4_events); + + struct ipv6_data_t { + u64 ts_us; +- u64 pid; ++ u32 pid; + unsigned __int128 saddr; + unsigned __int128 daddr; + u64 ports; +@@ -54,11 +52,11 @@ TRACEPOINT_PROBE(sock, inet_sock_set_state) + + // lport is either used in a filter here, or later + u16 lport = args->sport; +- //FILTER_LPORT ++ FILTER_LPORT + + // dport is either used in a filter here, or later + u16 dport = args->dport; +- //FILTER_DPORT ++ FILTER_DPORT + + /* + * This tool includes PID and comm context. It's best effort, and may +@@ -115,20 +113,23 @@ TRACEPOINT_PROBE(sock, inet_sock_set_state) + pid = mep->pid; + FILTER_PID + ++ u16 family = args->family; ++ FILTER_FAMILY ++ + // get throughput stats. see tcp_get_info(). + u64 rx_b = 0, tx_b = 0, sport = 0; + struct tcp_sock *tp = (struct tcp_sock *)sk; +- // OLD: bpf_probe_read(&rx_b, sizeof(rx_b), &tp->bytes_received); +- // OLD: bpf_probe_read(&tx_b, sizeof(tx_b), &tp->bytes_acked); +- // NEW: rx_b = tp->bytes_received; +- // NEW: tx_b = tp->bytes_acked; ++ rx_b = tp->bytes_received; ++ tx_b = tp->bytes_acked; + + if (args->family == AF_INET) { +- struct ipv4_data_t data4 = {.span_us = delta_us, +- .rx_b = rx_b, .tx_b = tx_b}; ++ struct ipv4_data_t data4 = {}; ++ data4.span_us = delta_us; ++ data4.rx_b = rx_b; ++ data4.tx_b = tx_b; + data4.ts_us = bpf_ktime_get_ns() / 1000; +- bpf_probe_read(&data4.saddr, sizeof(u32), args->saddr); +- bpf_probe_read(&data4.daddr, sizeof(u32), args->daddr); ++ __builtin_memcpy(&data4.saddr, args->saddr, sizeof(data4.saddr)); ++ __builtin_memcpy(&data4.daddr, args->daddr, sizeof(data4.daddr)); + // a workaround until data4 compiles with separate lport/dport + data4.ports = dport + ((0ULL + lport) << 32); + data4.pid = pid; +@@ -136,23 +137,25 @@ TRACEPOINT_PROBE(sock, inet_sock_set_state) + if (mep == 0) { + bpf_get_current_comm(&data4.task, sizeof(data4.task)); + } else { +- bpf_probe_read(&data4.task, sizeof(data4.task), (void *)mep->task); ++ bpf_probe_read_kernel(&data4.task, sizeof(data4.task), (void *)mep->task); + } + ipv4_events.perf_submit(args, &data4, sizeof(data4)); + + } else /* 6 */ { +- struct ipv6_data_t data6 = {.span_us = delta_us, +- .rx_b = rx_b, .tx_b = tx_b}; ++ struct ipv6_data_t data6 = {}; ++ data6.span_us = delta_us; ++ data6.rx_b = rx_b; ++ data6.tx_b = tx_b; + data6.ts_us = bpf_ktime_get_ns() / 1000; +- bpf_probe_read(&data6.saddr, sizeof(data6.saddr), args->saddr_v6); +- bpf_probe_read(&data6.daddr, sizeof(data6.daddr), args->saddr_v6); ++ __builtin_memcpy(&data6.saddr, args->saddr_v6, sizeof(data6.saddr)); ++ __builtin_memcpy(&data6.daddr, args->daddr_v6, sizeof(data6.daddr)); + // a workaround until data6 compiles with separate lport/dport + data6.ports = dport + ((0ULL + lport) << 32); + data6.pid = pid; + if (mep == 0) { + bpf_get_current_comm(&data6.task, sizeof(data6.task)); + } else { +- bpf_probe_read(&data6.task, sizeof(data6.task), (void *)mep->task); ++ bpf_probe_read_kernel(&data6.task, sizeof(data6.task), (void *)mep->task); + } + ipv6_events.perf_submit(args, &data6, sizeof(data6)); + } +diff --git a/src/pmdas/bcc/modules/tcpperpid.python b/src/pmdas/bcc/modules/tcpperpid.python +index 3cb2cfcfd..0096929a6 100644 +--- a/src/pmdas/bcc/modules/tcpperpid.python ++++ b/src/pmdas/bcc/modules/tcpperpid.python +@@ -32,16 +32,10 @@ from modules.pcpbcc import PCPBCCBase + # + # BPF program + # +-bpf_src = "modules/tcplife.bpf" +-# Compat with kernel < 4.16, bcc < 0.6 +-TRACEFS = "/sys/kernel/debug/tracing" +-bpf_src_old_tp = "modules/tcplife_old_tp.bpf" +-bpf_src_old_kb = "modules/tcplife_old_kb.bpf" +-if not path.exists(TRACEFS + "/events/sock/inet_sock_set_state"): +- if path.exists(TRACEFS + "/events/tcp/tcp_set_state"): +- bpf_src = bpf_src_old_tp +- else: +- bpf_src = bpf_src_old_kb ++if BPF.tracepoint_exists("sock", "inet_sock_set_state"): ++ bpf_src = "modules/tcplife_tp.bpf" ++else: ++ bpf_src = "modules/tcplife_kp.bpf" + + # Alternative, "high resolution" BPF + bpf_highres = "modules/tcptop.bpf" +@@ -53,36 +47,6 @@ MODULE = 'tcpperpid' + BASENS = 'proc.io.net.total.' + units_bytes = pmUnits(1, 0, 0, PM_SPACE_BYTE, 0, 0) + +-TASK_COMM_LEN = 16 # linux/sched.h +- +-class Data_ipv4(ct.Structure): +- """ IPv4 data struct """ +- _fields_ = [ +- ("ts_us", ct.c_ulonglong), +- ("pid", ct.c_ulonglong), +- ("saddr", ct.c_ulonglong), +- ("daddr", ct.c_ulonglong), +- ("ports", ct.c_ulonglong), +- ("rx_b", ct.c_ulonglong), +- ("tx_b", ct.c_ulonglong), +- ("span_us", ct.c_ulonglong), +- ("task", ct.c_char * TASK_COMM_LEN) +- ] +- +-class Data_ipv6(ct.Structure): +- """ IPv6 data struct """ +- _fields_ = [ +- ("ts_us", ct.c_ulonglong), +- ("pid", ct.c_ulonglong), +- ("saddr", (ct.c_ulonglong * 2)), +- ("daddr", (ct.c_ulonglong * 2)), +- ("ports", ct.c_ulonglong), +- ("rx_b", ct.c_ulonglong), +- ("tx_b", ct.c_ulonglong), +- ("span_us", ct.c_ulonglong), +- ("task", ct.c_char * TASK_COMM_LEN) +- ] +- + # + # PCP BCC Module + # +@@ -133,15 +97,14 @@ class PCPBCCModule(PCPBCCBase): + self.log("Using BPF source file %s." % src) + + # Exit hard if impossible to continue +- if self.bcc_version() == "0.6.1" and src == bpf_src_old_kb and not self.highres: +- raise RuntimeError("BCC 0.6.1 bug makes it incompatible with this module " +- "on kernel < 4.15 in non-highres mode.") ++ if self.bcc_version_tuple() < (0, 6, 1) and not self.highres: ++ raise RuntimeError("BCC 0.6.1+ is required for this module in non-highres mode.") + + self.log("Initialized.") + + def handle_ipv4_event(self, _cpu, data, _size): + """ IPv4 event handler """ +- event = ct.cast(data, ct.POINTER(Data_ipv4)).contents ++ event = self.bpf["ipv4_events"].event(data) + pid = str(event.pid).zfill(6) + self.lock.acquire() + if pid not in self.ipv4_stats: +@@ -153,7 +116,7 @@ class PCPBCCModule(PCPBCCBase): + + def handle_ipv6_event(self, _cpu, data, _size): + """ IPv6 event handler """ +- event = ct.cast(data, ct.POINTER(Data_ipv6)).contents ++ event = self.bpf["ipv6_events"].event(data) + pid = str(event.pid).zfill(6) + self.lock.acquire() + if pid not in self.ipv6_stats: +@@ -199,31 +162,25 @@ class PCPBCCModule(PCPBCCBase): + self.bpf_text = src.read() + if self.highres: + self.bpf_text = self.bpf_text.replace("FILTER", "FILTER_PID") +- # Compat with bcc < 0.6 +- self.log("Testing BCC compatilibility, possible errors below are safe to ignore.") +- try: +- test_txt = self.bpf_text.replace("// NEW: ", "").replace("FILTER_PID", "") +- test_bpf = BPF(text=test_txt) +- test_bpf.cleanup() +- self.bpf_text = self.bpf_text.replace("// NEW: ", "") +- except Exception: # pylint: disable=broad-except +- self.bpf_text = self.bpf_text.replace("// OLD: ", "") +- self.log("Tested BCC compatilibility, possible errors above are safe to ignore.") + + if self.dports: + filterp = " && ".join(["dport != %d" % port for port in self.dports]) + filter_txt = "if (%s) { birth.delete(&sk); return 0; }" % filterp +- self.bpf_text = self.bpf_text.replace("//FILTER_DPORT", filter_txt) ++ self.bpf_text = self.bpf_text.replace("FILTER_DPORT", filter_txt) + if self.lports: + filterp = " && ".join(["lport != %d" % port for port in self.lports]) + filter_txt = "if (%s) { birth.delete(&sk); return 0; }" % filterp +- self.bpf_text = self.bpf_text.replace("//FILTER_LPORT", filter_txt) ++ self.bpf_text = self.bpf_text.replace("FILTER_LPORT", filter_txt) + + if not self.pids and self.proc_filter and self.proc_refresh: + self.log("No process to attach found, activation postponed.") + return + + bpf_text = self.apply_pid_filter(self.bpf_text, self.pids, False) ++ bpf_text = bpf_text.replace('FILTER_PID', '') ++ bpf_text = bpf_text.replace('FILTER_DPORT', '') ++ bpf_text = bpf_text.replace('FILTER_LPORT', '') ++ bpf_text = bpf_text.replace('FILTER_FAMILY', '') + + if self.debug: + self.log("BPF to be compiled:\n" + bpf_text.strip()) +diff --git a/src/pmdas/bcc/modules/tcptop.bpf b/src/pmdas/bcc/modules/tcptop.bpf +index 349ee1529..c1fed7aef 100644 +--- a/src/pmdas/bcc/modules/tcptop.bpf ++++ b/src/pmdas/bcc/modules/tcptop.bpf +@@ -4,6 +4,7 @@ + #include + #include + #include ++ + struct ipv4_key_t { + u32 pid; + u32 saddr; +@@ -13,25 +14,32 @@ struct ipv4_key_t { + }; + BPF_HASH(ipv4_send_bytes, struct ipv4_key_t); + BPF_HASH(ipv4_recv_bytes, struct ipv4_key_t); ++ + struct ipv6_key_t { ++ unsigned __int128 saddr; ++ unsigned __int128 daddr; + u32 pid; +- // workaround until unsigned __int128 support: +- u64 saddr0; +- u64 saddr1; +- u64 daddr0; +- u64 daddr1; + u16 lport; + u16 dport; ++ u64 __pad__; + }; + BPF_HASH(ipv6_send_bytes, struct ipv6_key_t); + BPF_HASH(ipv6_recv_bytes, struct ipv6_key_t); ++ + int kprobe__tcp_sendmsg(struct pt_regs *ctx, struct sock *sk, + struct msghdr *msg, size_t size) + { +- u32 pid = bpf_get_current_pid_tgid(); +- FILTER ++ if (container_should_be_filtered()) { ++ return 0; ++ } ++ ++ u32 pid = bpf_get_current_pid_tgid() >> 32; ++ FILTER_PID ++ + u16 dport = 0, family = sk->__sk_common.skc_family; +- u64 *val, zero = 0; ++ ++ FILTER_FAMILY ++ + if (family == AF_INET) { + struct ipv4_key_t ipv4_key = {.pid = pid}; + ipv4_key.saddr = sk->__sk_common.skc_rcv_saddr; +@@ -39,31 +47,24 @@ int kprobe__tcp_sendmsg(struct pt_regs *ctx, struct sock *sk, + ipv4_key.lport = sk->__sk_common.skc_num; + dport = sk->__sk_common.skc_dport; + ipv4_key.dport = ntohs(dport); +- val = ipv4_send_bytes.lookup_or_init(&ipv4_key, &zero); +- if (val) { +- (*val) += size; +- } ++ ipv4_send_bytes.increment(ipv4_key, size); ++ + } else if (family == AF_INET6) { + struct ipv6_key_t ipv6_key = {.pid = pid}; +- bpf_probe_read(&ipv6_key.saddr0, sizeof(ipv6_key.saddr0), +- &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32[0]); +- bpf_probe_read(&ipv6_key.saddr1, sizeof(ipv6_key.saddr1), +- &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32[2]); +- bpf_probe_read(&ipv6_key.daddr0, sizeof(ipv6_key.daddr0), +- &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32[0]); +- bpf_probe_read(&ipv6_key.daddr1, sizeof(ipv6_key.daddr1), +- &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32[2]); ++ bpf_probe_read_kernel(&ipv6_key.saddr, sizeof(ipv6_key.saddr), ++ &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); ++ bpf_probe_read_kernel(&ipv6_key.daddr, sizeof(ipv6_key.daddr), ++ &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); + ipv6_key.lport = sk->__sk_common.skc_num; + dport = sk->__sk_common.skc_dport; + ipv6_key.dport = ntohs(dport); +- val = ipv6_send_bytes.lookup_or_init(&ipv6_key, &zero); +- if (val) { +- (*val) += size; +- } ++ ipv6_send_bytes.increment(ipv6_key, size); + } + // else drop ++ + return 0; + } ++ + /* + * tcp_recvmsg() would be obvious to trace, but is less suitable because: + * - we'd need to trace both entry and return, to have both sock and size +@@ -72,12 +73,21 @@ int kprobe__tcp_sendmsg(struct pt_regs *ctx, struct sock *sk, + */ + int kprobe__tcp_cleanup_rbuf(struct pt_regs *ctx, struct sock *sk, int copied) + { +- u32 pid = bpf_get_current_pid_tgid(); +- FILTER ++ if (container_should_be_filtered()) { ++ return 0; ++ } ++ ++ u32 pid = bpf_get_current_pid_tgid() >> 32; ++ FILTER_PID ++ + u16 dport = 0, family = sk->__sk_common.skc_family; + u64 *val, zero = 0; ++ + if (copied <= 0) + return 0; ++ ++ FILTER_FAMILY ++ + if (family == AF_INET) { + struct ipv4_key_t ipv4_key = {.pid = pid}; + ipv4_key.saddr = sk->__sk_common.skc_rcv_saddr; +@@ -85,28 +95,20 @@ int kprobe__tcp_cleanup_rbuf(struct pt_regs *ctx, struct sock *sk, int copied) + ipv4_key.lport = sk->__sk_common.skc_num; + dport = sk->__sk_common.skc_dport; + ipv4_key.dport = ntohs(dport); +- val = ipv4_recv_bytes.lookup_or_init(&ipv4_key, &zero); +- if (val) { +- (*val) += copied; +- } ++ ipv4_recv_bytes.increment(ipv4_key, copied); ++ + } else if (family == AF_INET6) { + struct ipv6_key_t ipv6_key = {.pid = pid}; +- bpf_probe_read(&ipv6_key.saddr0, sizeof(ipv6_key.saddr0), +- &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32[0]); +- bpf_probe_read(&ipv6_key.saddr1, sizeof(ipv6_key.saddr1), +- &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32[2]); +- bpf_probe_read(&ipv6_key.daddr0, sizeof(ipv6_key.daddr0), +- &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32[0]); +- bpf_probe_read(&ipv6_key.daddr1, sizeof(ipv6_key.daddr1), +- &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32[2]); ++ bpf_probe_read_kernel(&ipv6_key.saddr, sizeof(ipv6_key.saddr), ++ &sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32); ++ bpf_probe_read_kernel(&ipv6_key.daddr, sizeof(ipv6_key.daddr), ++ &sk->__sk_common.skc_v6_daddr.in6_u.u6_addr32); + ipv6_key.lport = sk->__sk_common.skc_num; + dport = sk->__sk_common.skc_dport; + ipv6_key.dport = ntohs(dport); +- val = ipv6_recv_bytes.lookup_or_init(&ipv6_key, &zero); +- if (val) { +- (*val) += copied; +- } ++ ipv6_recv_bytes.increment(ipv6_key, copied); + } + // else drop ++ + return 0; + } +diff --git a/src/pmdas/bcc/modules/tcptop.python b/src/pmdas/bcc/modules/tcptop.python +index 45063dff3..db1c1da15 100644 +--- a/src/pmdas/bcc/modules/tcptop.python ++++ b/src/pmdas/bcc/modules/tcptop.python +@@ -120,13 +120,14 @@ class PCPBCCModule(PCPBCCBase): + with open(path.dirname(__file__) + '/../' + bpf_src) as src: + self.bpf_text = src.read() + +- self.bpf_text = self.bpf_text.replace("FILTER", "FILTER_PID") +- + if not self.pids and self.proc_filter and self.proc_refresh: + self.log("No process to attach found, activation postponed.") + return + + bpf_text = self.apply_pid_filter(self.bpf_text, self.pids, False) ++ bpf_text = bpf_text.replace('FILTER_PID', '') ++ bpf_text = bpf_text.replace('FILTER_FAMILY', '') ++ bpf_text = bpf_text.replace('container_should_be_filtered()', '0') + + if self.debug: + self.log("BPF to be compiled:\n" + bpf_text.strip()) +@@ -155,21 +156,31 @@ class PCPBCCModule(PCPBCCBase): + + @staticmethod + def ipv4_table_to_dict(table): +- """ Build hashable dict from IPv4 BPF table """ +- return {TCPSessionKey(pid=k.pid, +- laddr=inet_ntop(AF_INET, pack("I", k.saddr)), +- lport=k.lport, +- daddr=inet_ntop(AF_INET, pack("I", k.daddr)), +- dport=k.dport):v.value for k, v in table.items()} ++ """Build hashable dict from IPv4 BPF table""" ++ return { ++ TCPSessionKey( ++ pid=k.pid, ++ laddr=inet_ntop(AF_INET, pack("I", k.saddr)), ++ lport=k.lport, ++ daddr=inet_ntop(AF_INET, pack("I", k.daddr)), ++ dport=k.dport, ++ ): v.value ++ for k, v in table.items() ++ } + + @staticmethod + def ipv6_table_to_dict(table): +- """ Build hashable dict from IPv6 BPF table """ +- return {TCPSessionKey(pid=k.pid, +- laddr=inet_ntop(AF_INET6, pack("QQ", k.saddr0, k.saddr1)), +- lport=k.lport, +- daddr=inet_ntop(AF_INET6, pack("QQ", k.daddr0, k.daddr1)), +- dport=k.dport):v.value for k, v in table.items()} ++ """Build hashable dict from IPv6 BPF table""" ++ return { ++ TCPSessionKey( ++ pid=k.pid, ++ laddr=inet_ntop(AF_INET6, k.saddr), ++ lport=k.lport, ++ daddr=inet_ntop(AF_INET6, k.daddr), ++ dport=k.dport, ++ ): v.value ++ for k, v in table.items() ++ } + + def refresh_stats(self): + """ Refresh statistics from BPF table """ +commit d45ce8e85035cc95ba897cd19967fad6d5d741be (cherry-picked) +Author: Andreas Gerstmayr +Date: Wed Dec 15 08:03:40 2021 +0100 + + qa: update qa/1118 to add new log output of runqlat bcc module + +diff --git a/qa/1118 b/qa/1118 +index 4123495b5..bcaec0a0d 100755 +--- a/qa/1118 ++++ b/qa/1118 +@@ -21,12 +21,19 @@ _label_filter() + grep '"0-1"' | grep '"statistic":"histogram"' | grep '"lower_bound":0' | grep 'upper_bound":1' > /dev/null && echo 'OK' + } + ++_install_filter() ++{ ++ sed \ ++ -e "s/Using BPF source file .\+/Using BPF source file X/g" \ ++ #end ++} ++ + _prepare_pmda bcc + trap "_pmdabcc_cleanup; exit \$status" 0 1 2 3 15 + _stop_auto_restart pmcd + + # real QA test starts here +-cat < +Date: Tue Nov 23 16:11:24 2021 +1100 + + pmlogconf: fix reprobing with interactive changes + + In testing an earlier persistance fix it was discovered + that reprobe was inadvertently overwriting user requests + for changes interactively. + + Related to Red Hat BZ #2017632 + +diff --git a/qa/368.out b/qa/368.out +index 829162f859..179a1142cf 100644 +--- a/qa/368.out ++++ b/qa/368.out +@@ -80,44 +80,10 @@ Differences ... + Keep changes? [y] + Group: qa group one + Log this group? [y] ... +-Differences ... +-*** TMP.orig ... +---- TMP.conf.new ... +-*************** +-*** 22,35 **** +- sample.long.million +- } +- #---- +-! #+ 02:x:: +-! #---- +-! #+ 03:y:default: +-! ## qa group three +- log advisory on default { +-! sample.longlong.ten +- } +- #---- +- #+ 04:n:default: +- ## qa group four +- #---- +---- 22,36 ---- +- sample.long.million +- } +- #---- +-! #+ 02:y:default: +-! ## qa group two +- log advisory on default { +-! sample.ulong.ten +- } +- #---- +-+ #+ 03:n:default: +-+ ## qa group three +-+ #---- +- #+ 04:n:default: +- ## qa group four +- #---- +-Keep changes? [y] ++No changes ++ + Group: qa group one +-Log this group? [y] ...... ++Log this group? [y] ..... + Differences ... + *** TMP.orig ... + --- TMP.conf.new ... +@@ -132,18 +98,8 @@ Differences ... + #---- + --- 18,23 ---- + *************** +-*** 26,31 **** +---- 25,31 ---- +- ## qa group two +- log advisory on default { +- sample.ulong.ten +-+ sample.ulong.million +- } +- #---- +- #+ 03:n:default: +-*************** +-*** 37,42 **** +---- 37,53 ---- ++*** 36,41 **** ++--- 35,51 ---- + #+ 05:n:default: + ## qa group five + #---- +@@ -185,15 +141,13 @@ log advisory on default { + sample.long.million + } + #---- +-#+ 02:y:default: +-## qa group two +-log advisory on default { +- sample.ulong.ten +- sample.ulong.million +-} ++#+ 02:x:: + #---- +-#+ 03:n:default: ++#+ 03:y:default: + ## qa group three ++log advisory on default { ++ sample.longlong.ten ++} + #---- + #+ 04:n:default: + ## qa group four +diff --git a/src/pmlogconf/pmlogconf.c b/src/pmlogconf/pmlogconf.c +index c03c61e797..fa1156859d 100644 +--- a/src/pmlogconf/pmlogconf.c ++++ b/src/pmlogconf/pmlogconf.c +@@ -913,13 +913,13 @@ evaluate_state(group_t *group) + if ((group->pmlogger || group->pmrep) && !group->pmlogconf) { + state = group->saved_state; + } else if (evaluate_group(group)) { /* probe */ +- if (reprobe == 0 && group->saved_state != 0) ++ if (group->saved_state != 0) + state = group->saved_state; + else + state = group->true_state; + group->success = 1; + } else { +- if (reprobe == 0 && group->saved_state != 0) ++ if (group->saved_state != 0) + state = group->saved_state; + else + state = group->false_state; diff --git a/redhat-bugzilla-2027753.patch b/redhat-bugzilla-2027753.patch new file mode 100644 index 0000000..918a6d5 --- /dev/null +++ b/redhat-bugzilla-2027753.patch @@ -0,0 +1,841 @@ +diff -Naurp pcp-5.3.5.orig/qa/032 pcp-5.3.5/qa/032 +--- pcp-5.3.5.orig/qa/032 2021-11-01 13:02:26.000000000 +1100 ++++ pcp-5.3.5/qa/032 2022-01-21 10:55:30.286602172 +1100 +@@ -34,13 +34,6 @@ trap "_cleanup" 0 1 2 3 15 + + _stop_auto_restart pmcd + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _service pcp stop | _filter_pcp_stop + _wait_pmcd_end + _writable_primary_logger +@@ -48,7 +41,7 @@ _writable_primary_logger + _service pmcd start 2>&1 | _filter_pcp_start + _wait_for_pmcd + _service pmlogger start 2>&1 | _filter_pcp_start +-_wait_for_pmlogger -P $LOGGING_DIR/$LOCALHOST/pmlogger.log ++_wait_for_pmlogger + + # real QA test starts here + _echo "expect this to be off" +diff -Naurp pcp-5.3.5.orig/qa/041 pcp-5.3.5/qa/041 +--- pcp-5.3.5.orig/qa/041 2021-09-01 08:58:41.000000000 +1000 ++++ pcp-5.3.5/qa/041 2022-01-21 10:55:30.286602172 +1100 +@@ -40,12 +40,11 @@ _expect() + echo "" | tee -a $seq.full + } + ++status=1 + _needclean=true + TAG=000666000magic +-status=1 +-[ -z "$PCP_PMLOGGERCONTROL_PATH" ] && \ +- PCP_PMLOGGERCONTROL_PATH="$PCP_SYSCONF_DIR/pmlogger/control" +- ++LOGGING_DIR="$PCP_ARCHIVE_DIR" ++rm -f $seq.full + trap "_cleanup" 0 1 2 3 15 + + _stop_auto_restart pmcd +@@ -68,15 +67,6 @@ _cleanup() + exit $status + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- +-rm -f $seq.full +- + # real QA test starts here + + # disable all pmloggers ... +diff -Naurp pcp-5.3.5.orig/qa/066 pcp-5.3.5/qa/066 +--- pcp-5.3.5.orig/qa/066 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/066 2022-01-21 10:55:30.286602172 +1100 +@@ -42,6 +42,7 @@ signal=$PCP_BINADM_DIR/pmsignal + log=$PCP_PMCDLOG_PATH + _needclean=true + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _filter_log() + { +@@ -80,13 +81,6 @@ interrupt() + exit + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + cleanup() + { + if [ $_needclean ] +diff -Naurp pcp-5.3.5.orig/qa/067 pcp-5.3.5/qa/067 +--- pcp-5.3.5.orig/qa/067 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/067 2022-01-21 10:55:30.287602155 +1100 +@@ -31,6 +31,7 @@ trap "rm -f $tmp.*; exit" 0 1 2 3 15 + signal=$PCP_BINADM_DIR/pmsignal + log=$PCP_PMCDLOG_PATH + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _filter_log() + { +@@ -69,13 +70,6 @@ interrupt() + exit + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + cleanup() + { + _restore_config $PCP_PMCDCONF_PATH +diff -Naurp pcp-5.3.5.orig/qa/068 pcp-5.3.5/qa/068 +--- pcp-5.3.5.orig/qa/068 2019-01-13 14:14:12.000000000 +1100 ++++ pcp-5.3.5/qa/068 2022-01-21 10:55:30.287602155 +1100 +@@ -19,22 +19,11 @@ echo "QA output created by $seq" + + _needclean=true + LOCALHOST=`hostname` +- ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + trap "_cleanup" 0 1 2 3 15 + +-# don't need to regenerate config.default with pmlogconf +-# +-export PMLOGGER_CHECK_SKIP_LOGCONF=yes +- + _stop_auto_restart pmcd + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _cleanup() + { + echo >>$seq.full +diff -Naurp pcp-5.3.5.orig/qa/069 pcp-5.3.5/qa/069 +--- pcp-5.3.5.orig/qa/069 2021-11-08 09:45:56.000000000 +1100 ++++ pcp-5.3.5/qa/069 2022-01-21 10:55:30.287602155 +1100 +@@ -45,6 +45,7 @@ nconfig=$tmp.pmcd.conf.new + log=$PCP_PMCDLOG_PATH + LOCALHOST=`hostname` + LOCALHOST_FULL=`pmhostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + _needclean=true + + rm -f $seq.full +@@ -104,13 +105,6 @@ skip > 0 { skip--; next } + + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + cleanup() + { + if $_needclean +diff -Naurp pcp-5.3.5.orig/qa/1055 pcp-5.3.5/qa/1055 +--- pcp-5.3.5.orig/qa/1055 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/1055 2022-01-21 10:55:30.287602155 +1100 +@@ -17,6 +17,7 @@ signal=$PCP_BINADM_DIR/pmsignal + status=1 + done_clean=false + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _cleanup() + { +@@ -66,13 +67,7 @@ $sudo cp $tmp.tmp $PCP_PMCDCONF_PATH + _writable_primary_logger + _service pcp restart 2>&1 | _filter_pcp_start + _wait_for_pmcd +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +-_wait_for_pmlogger -P $LOGGING_DIR/$LOCALHOST/pmlogger.log ++_wait_for_pmlogger + + # Reset pmlogger + echo "log sample.dynamic.meta.metric" +diff -Naurp pcp-5.3.5.orig/qa/172 pcp-5.3.5/qa/172 +--- pcp-5.3.5.orig/qa/172 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/172 2022-01-21 10:55:30.287602155 +1100 +@@ -39,6 +39,7 @@ else + esac + fi + ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + LOCALHOST=`hostname` + _needclean=true + status=0 +@@ -48,13 +49,6 @@ _interrupt() + status=1 + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _cleanup() + { + if $_needclean +diff -Naurp pcp-5.3.5.orig/qa/192 pcp-5.3.5/qa/192 +--- pcp-5.3.5.orig/qa/192 2019-01-13 14:14:12.000000000 +1100 ++++ pcp-5.3.5/qa/192 2022-01-21 10:55:30.287602155 +1100 +@@ -13,6 +13,7 @@ echo "QA output created by $seq" + . ./common.filter + . ./common.check + ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + LOCALHOST=`hostname` + _needclean=true + status=0 +@@ -22,13 +23,6 @@ _interrupt() + status=1 + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _cleanup() + { + if $_needclean +diff -Naurp pcp-5.3.5.orig/qa/220 pcp-5.3.5/qa/220 +--- pcp-5.3.5.orig/qa/220 2021-07-13 09:34:38.000000000 +1000 ++++ pcp-5.3.5/qa/220 2022-01-21 10:55:30.287602155 +1100 +@@ -18,13 +18,7 @@ which netstat >/dev/null 2>&1 || _notrun + status=0 + clean=false + LOCALHOST=`hostname` +- +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _cleanup() + { +diff -Naurp pcp-5.3.5.orig/qa/258 pcp-5.3.5/qa/258 +--- pcp-5.3.5.orig/qa/258 2019-01-30 14:22:38.000000000 +1100 ++++ pcp-5.3.5/qa/258 2022-01-21 10:55:30.287602155 +1100 +@@ -19,6 +19,7 @@ echo "QA output created by $seq" + signal=$PCP_BINADM_DIR/pmsignal + status=1 + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + _needclean=true + + _interrupt() +@@ -26,13 +27,6 @@ _interrupt() + status=1 + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _cleanup() + { + cd $here +diff -Naurp pcp-5.3.5.orig/qa/279 pcp-5.3.5/qa/279 +--- pcp-5.3.5.orig/qa/279 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/279 2022-01-21 10:55:30.287602155 +1100 +@@ -17,6 +17,7 @@ echo "QA output created by $seq" + status=1 # failure is the default! + killer=`pwd`/src/killparent + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + _needclean=true + + rm -f $seq.full +@@ -76,13 +77,6 @@ _filter_pmcd() + # end + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _save_config $PCP_PMCDCONF_PATH + _disable_loggers + pmafm $LOGGING_DIR/$LOCALHOST/Latest remove >$tmp.cmd 2>&1 \ +diff -Naurp pcp-5.3.5.orig/qa/280 pcp-5.3.5/qa/280 +--- pcp-5.3.5.orig/qa/280 2021-08-16 14:12:25.000000000 +1000 ++++ pcp-5.3.5/qa/280 2022-01-21 10:55:30.287602155 +1100 +@@ -13,16 +13,6 @@ echo "QA output created by $seq" + . ./common.filter + . ./common.check + +-if [ -d "$PCP_ARCHIVE_DIR" ] +-then +- LOGGING_DIR=$PCP_ARCHIVE_DIR +-elif [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _filter() + { + [ -z "$PCP_PMLOGGERCONTROL_PATH" ] && \ +@@ -52,6 +42,7 @@ _filter() + status=1 # failure is the default! + signal=$PCP_BINADM_DIR/pmsignal + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + trap "_cleanup; $sudo rm -f $tmp.* $LOGGING_DIR/$LOCALHOST/lock; exit \$status" 0 1 2 3 15 + + _stop_auto_restart pmcd +diff -Naurp pcp-5.3.5.orig/qa/282 pcp-5.3.5/qa/282 +--- pcp-5.3.5.orig/qa/282 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/282 2022-01-21 10:55:30.287602155 +1100 +@@ -32,7 +32,7 @@ _needclean=true + sleepy=false + + LOCALHOST=`hostname` +-LOGGING_DIR=$PCP_LOG_DIR/pmlogger ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + CHECK=`which pmlogger_check` + [ -z "$CHECK" -o ! -x "$CHECK" ] && \ + _notrun "Cannot find an executable pmlogger_check: \"$CHECK\"" +diff -Naurp pcp-5.3.5.orig/qa/336 pcp-5.3.5/qa/336 +--- pcp-5.3.5.orig/qa/336 2018-10-23 07:37:45.000000000 +1100 ++++ pcp-5.3.5/qa/336 2022-01-21 10:55:30.288602138 +1100 +@@ -19,6 +19,7 @@ echo "QA output created by $seq" + signal=$PCP_BINADM_DIR/pmsignal + status=1 # failure is the default! + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + _needclean=true + + if [ -n "$PCP_TRACE_HOST" ] +@@ -31,13 +32,6 @@ _interrupt() + status=1 + } + +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +- + _cleanup() + { + cd $here +diff -Naurp pcp-5.3.5.orig/qa/854 pcp-5.3.5/qa/854 +--- pcp-5.3.5.orig/qa/854 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/854 2022-01-21 10:55:30.288602138 +1100 +@@ -17,6 +17,7 @@ signal=$PCP_BINADM_DIR/pmsignal + status=1 + done_clean=false + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _cleanup() + { +@@ -59,20 +60,14 @@ cat <$tmp.tmp + # Installed by PCP QA test $seq on `date` + pmcd 2 dso pmcd_init $PMDA_PMCD_PATH + sample 29 pipe binary $PCP_PMDAS_DIR/sample/pmdasample -d 29 +-simple 253 pipe binary /var/lib/pcp/pmdas/simple/pmdasimple -d 253 ++simple 253 pipe binary $PCP_PMDAS_DIR/simple/pmdasimple -d 253 + End-of-File + $sudo cp $tmp.tmp $PCP_PMCDCONF_PATH + + _writable_primary_logger + _service pcp restart 2>&1 | _filter_pcp_start + _wait_for_pmcd +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +-_wait_for_pmlogger -P $LOGGING_DIR/$LOCALHOST/pmlogger.log ++_wait_for_pmlogger + + # Reset pmlogger + echo "log sample.dynamic.meta.metric" +diff -Naurp pcp-5.3.5.orig/qa/856 pcp-5.3.5/qa/856 +--- pcp-5.3.5.orig/qa/856 2019-01-13 14:14:12.000000000 +1100 ++++ pcp-5.3.5/qa/856 2022-01-21 10:55:30.288602138 +1100 +@@ -17,6 +17,7 @@ signal=$PCP_BINADM_DIR/pmsignal + status=1 + done_clean=false + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _cleanup() + { +@@ -69,13 +70,7 @@ $sudo cp $tmp.tmp $PCP_PMCDCONF_PATH + _writable_primary_logger + _service pcp restart 2>&1 | _filter_pcp_start + _wait_for_pmcd +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +-_wait_for_pmlogger -P $LOGGING_DIR/$LOCALHOST/pmlogger.log ++_wait_for_pmlogger + + # Reset pmlogger + echo "log sample.dynamic.meta.metric" +diff -Naurp pcp-5.3.5.orig/qa/882 pcp-5.3.5/qa/882 +--- pcp-5.3.5.orig/qa/882 2019-01-13 14:14:12.000000000 +1100 ++++ pcp-5.3.5/qa/882 2022-01-21 10:55:30.288602138 +1100 +@@ -17,6 +17,7 @@ signal=$PCP_BINADM_DIR/pmsignal + status=1 + done_clean=false + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _cleanup() + { +@@ -69,13 +70,7 @@ $sudo cp $tmp.tmp $PCP_PMCDCONF_PATH + _writable_primary_logger + _service pcp restart 2>&1 | _filter_pcp_start + _wait_for_pmcd +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +-_wait_for_pmlogger -P $LOGGING_DIR/$LOCALHOST/pmlogger.log ++_wait_for_pmlogger + + # Reset pmlogger + echo "log sample.dynamic.meta.metric" +diff -Naurp pcp-5.3.5.orig/qa/932 pcp-5.3.5/qa/932 +--- pcp-5.3.5.orig/qa/932 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/qa/932 2022-01-21 10:55:30.288602138 +1100 +@@ -17,6 +17,7 @@ signal=$PCP_BINADM_DIR/pmsignal + status=1 + done_clean=false + LOCALHOST=`hostname` ++LOGGING_DIR="$PCP_ARCHIVE_DIR" + + _cleanup() + { +@@ -67,13 +68,7 @@ $sudo cp $tmp.tmp $PCP_PMCDCONF_PATH + _writable_primary_logger + _service pcp restart 2>&1 | _filter_pcp_start + _wait_for_pmcd +-if [ -d $PCP_LOG_DIR/pmlogger ] +-then +- LOGGING_DIR=$PCP_LOG_DIR/pmlogger +-else +- LOGGING_DIR=$PCP_LOG_DIR +-fi +-_wait_for_pmlogger -P $LOGGING_DIR/$LOCALHOST/pmlogger.log ++_wait_for_pmlogger + + # Reset pmlogger + echo "log sample.dynamic.meta.metric" +diff -Naurp pcp-5.3.5.orig/qa/common.check pcp-5.3.5/qa/common.check +--- pcp-5.3.5.orig/qa/common.check 2021-11-05 09:54:05.000000000 +1100 ++++ pcp-5.3.5/qa/common.check 2022-01-21 10:55:30.288602138 +1100 +@@ -262,7 +262,7 @@ _service() + # good reason for this) + # ditto for pmlogger_daily and pmlogger_daily-poll + # +- for svc in pmlogger_check pmlogger_daily pmlogger_daily-poll ++ for svc in pmlogger_check pmlogger_daily pmlogger_farm_check pmlogger_daily-poll + do + if systemctl show --property=ActiveState $svc.timer 2>&1 \ + | grep '=active$' >/dev/null +@@ -1940,9 +1940,11 @@ _remove_job_scheduler() + $rc_sudo rm -f $rc_cron_backup $rc_systemd_state + + if systemctl cat pmie_daily.timer >/dev/null 2>&1; then +- for i in pmie.service pmie_daily.timer pmie_check.timer pmlogger_daily.timer \ ++ for i in pmie.service pmie_daily.timer \ ++ pmie_check.timer pmie_farm_check.timer \ + pmlogger_daily_report.timer pmlogger_daily_report-poll.timer \ +- pmlogger_daily-poll.timer pmlogger_check.timer ; do ++ pmlogger_daily-poll.timer pmlogger_daily.timer \ ++ pmlogger_check.timer pmlogger_farm_check.timer ; do + $rc_sudo systemctl is-active "$i" > /dev/null || continue + $rc_sudo systemctl stop $i >/dev/null + echo "$i" >> $rc_systemd_state +diff -Naurp pcp-5.3.5.orig/src/pmie/GNUmakefile pcp-5.3.5/src/pmie/GNUmakefile +--- pcp-5.3.5.orig/src/pmie/GNUmakefile 2021-11-09 10:50:58.000000000 +1100 ++++ pcp-5.3.5/src/pmie/GNUmakefile 2022-01-21 10:55:54.918186303 +1100 +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2013-2015,2020-2021 Red Hat. ++# Copyright (c) 2013-2015,2020-2022 Red Hat. + # Copyright (c) 2000,2004 Silicon Graphics, Inc. All Rights Reserved. + # + # This program is free software; you can redistribute it and/or modify it +@@ -84,7 +84,6 @@ pmie.service : pmie.service.in + + pmie_farm.service : pmie_farm.service.in + $(SED) <$< >$@ \ +- -e 's;@CRONTAB_PATH@;'$(CRONTAB_PATH)';' \ + -e 's;@PCP_SYSCONFIG_DIR@;'$(PCP_SYSCONFIG_DIR)';' \ + -e 's;@PCP_BINADM_DIR@;'$(PCP_BINADM_DIR)';' \ + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ +@@ -95,7 +94,10 @@ pmie_farm.service : pmie_farm.service.in + + pmie_farm_check.service : pmie_farm_check.service.in + $(SED) <$< >$@ \ ++ -e 's;@CRONTAB_PATH@;'$(CRONTAB_PATH)';' \ + -e 's;@PCP_BIN_DIR@;'$(PCP_BIN_DIR)';' \ ++ -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmie_check.service : pmie_check.service.in +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_check.service.in pcp-5.3.5/src/pmie/pmie_check.service.in +--- pcp-5.3.5.orig/src/pmie/pmie_check.service.in 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_check.service.in 2022-01-21 10:55:30.288602138 +1100 +@@ -2,7 +2,6 @@ + Description=Check PMIE instances are running + Documentation=man:pmie_check(1) + ConditionPathExists=!@CRONTAB_PATH@ +-PartOf=pmie.service + + [Service] + Type=@SD_SERVICE_TYPE@ +@@ -15,6 +14,3 @@ ExecStart=@PCP_BINADM_DIR@/pmie_check $P + WorkingDirectory=@PCP_VAR_DIR@ + Group=@PCP_GROUP@ + User=@PCP_USER@ +- +-[Install] +-RequiredBy=pmie.service +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_check.timer pcp-5.3.5/src/pmie/pmie_check.timer +--- pcp-5.3.5.orig/src/pmie/pmie_check.timer 2021-02-17 15:27:41.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_check.timer 2022-01-21 10:55:30.288602138 +1100 +@@ -1,6 +1,5 @@ + [Unit] + Description=Half-hourly check of PMIE instances +-PartOf=pmie.service + + [Timer] + # if enabled, runs 1m after boot and every half hour +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_daily.service.in pcp-5.3.5/src/pmie/pmie_daily.service.in +--- pcp-5.3.5.orig/src/pmie/pmie_daily.service.in 2021-10-07 14:28:56.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_daily.service.in 2022-01-21 10:55:30.288602138 +1100 +@@ -6,6 +6,7 @@ ConditionPathExists=!@CRONTAB_PATH@ + [Service] + Type=@SD_SERVICE_TYPE@ + Restart=no ++TimeoutStartSec=1h + Environment="PMIE_DAILY_PARAMS=-X xz -x 3" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmie_timers + ExecStart=@PCP_BINADM_DIR@/pmie_daily $PMIE_DAILY_PARAMS +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_daily.timer pcp-5.3.5/src/pmie/pmie_daily.timer +--- pcp-5.3.5.orig/src/pmie/pmie_daily.timer 2019-02-20 18:03:00.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_daily.timer 2022-01-21 10:55:30.288602138 +1100 +@@ -2,6 +2,7 @@ + Description=Daily processing of PMIE logs + + [Timer] ++Persistent=true + OnCalendar=*-*-* 00:08:00 + + [Install] +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_farm_check.service.in pcp-5.3.5/src/pmie/pmie_farm_check.service.in +--- pcp-5.3.5.orig/src/pmie/pmie_farm_check.service.in 2021-11-09 10:50:58.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_farm_check.service.in 2022-01-21 10:55:54.918186303 +1100 +@@ -1,19 +1,15 @@ + [Unit] +-Description=Check and migrate non-primary pmie instances to pmie_farm +-Documentation=man:pmie_check(1) +-# TODO non-systemd ConditionPathExists=!/etc/cron.d/pcp-pmie ++Description=Check and migrate non-primary pmie farm instances ++Documentation=man:pmiectl(1) ++ConditionPathExists=!@CRONTAB_PATH@ + + [Service] +-Type=exec ++Type=@SD_SERVICE_TYPE@ + Restart=no + TimeoutStartSec=4h + TimeoutStopSec=120 + ExecStart=@PCP_BIN_DIR@/pmiectl -m check +-WorkingDirectory=/var/lib/pcp +- ++WorkingDirectory=@PCP_VAR_DIR@ + # root so pmiectl can migrate pmie processes to the pmie_farm service + Group=root + User=root +- +-[Install] +-RequiredBy=pmie_farm.service +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_farm_check.timer pcp-5.3.5/src/pmie/pmie_farm_check.timer +--- pcp-5.3.5.orig/src/pmie/pmie_farm_check.timer 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_farm_check.timer 2022-01-21 10:49:07.985980678 +1100 +@@ -1,10 +1,11 @@ + [Unit] +-Description=5 minute check of pmie farm instances ++Description=Half-hourly check of pmie farm instances + + [Timer] +-# if enabled, runs 1m after boot and every 5 mins ++# if enabled, runs 1m after boot and every half hour + OnBootSec=1min +-OnCalendar=*:00/5 ++OnCalendar=*-*-* *:28:10 ++OnCalendar=*-*-* *:58:10 + + [Install] + WantedBy=timers.target +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_farm.service.in pcp-5.3.5/src/pmie/pmie_farm.service.in +--- pcp-5.3.5.orig/src/pmie/pmie_farm.service.in 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_farm.service.in 2022-01-21 10:49:07.986980661 +1100 +@@ -1,9 +1,9 @@ + [Unit] + Description=pmie farm service +-Documentation=man:pmie(1) +-After=network-online.target pmcd.service +-Before=pmie_check.timer pmie_daily.timer +-BindsTo=pmie_farm_check.timer pmie_check.timer pmie_daily.timer ++Documentation=man:pmie_check(1) ++Before=pmie_farm_check.timer ++BindsTo=pmie_farm_check.timer ++PartOf=pmie.service + + [Service] + Type=@SD_SERVICE_TYPE@ +@@ -15,13 +15,9 @@ TimeoutStopSec=120 + Environment="PMIE_CHECK_PARAMS=--skip-primary" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmie_timers + ExecStart=@PCP_BINADM_DIR@/pmie_farm $PMIE_CHECK_PARAMS +- + WorkingDirectory=@PCP_VAR_DIR@ + Group=@PCP_GROUP@ + User=@PCP_USER@ + + [Install] +-WantedBy=multi-user.target +- +-# This dependency will be removed in PCPv6. +-WantedBy=pmie.service ++RequiredBy=pmie.service +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie_farm.sh pcp-5.3.5/src/pmie/pmie_farm.sh +--- pcp-5.3.5.orig/src/pmie/pmie_farm.sh 2021-11-05 17:02:47.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie_farm.sh 2022-01-21 10:49:07.986980661 +1100 +@@ -12,8 +12,8 @@ + # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + # for more details. + # +-# Administrative script to start the pmlogger_farm service. +-# All arguments to pmlogger_check are passed from pmlogger_farm.service. ++# Administrative script to start the pmie_farm service. ++# All arguments to pmie_check are passed from pmie_farm.service. + # + . $PCP_DIR/etc/pcp.env + +diff -Naurp pcp-5.3.5.orig/src/pmie/pmie.service.in pcp-5.3.5/src/pmie/pmie.service.in +--- pcp-5.3.5.orig/src/pmie/pmie.service.in 2021-02-22 11:32:05.000000000 +1100 ++++ pcp-5.3.5/src/pmie/pmie.service.in 2022-01-21 10:49:07.986980661 +1100 +@@ -2,8 +2,8 @@ + Description=Performance Metrics Inference Engine + Documentation=man:pmie(1) + After=network-online.target pmcd.service +-Before=pmie_check.timer pmie_daily.timer +-BindsTo=pmie_check.timer pmie_daily.timer ++Before=pmie_farm.service pmie_check.timer pmie_daily.timer ++BindsTo=pmie_farm.service pmie_check.timer pmie_daily.timer + Wants=pmcd.service + + [Service] +diff -Naurp pcp-5.3.5.orig/src/pmlogger/GNUmakefile pcp-5.3.5/src/pmlogger/GNUmakefile +--- pcp-5.3.5.orig/src/pmlogger/GNUmakefile 2021-11-09 09:08:40.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/GNUmakefile 2022-01-21 10:55:54.918186303 +1100 +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2013-2021 Red Hat. ++# Copyright (c) 2013-2022 Red Hat. + # Copyright (c) 2000,2004 Silicon Graphics, Inc. All Rights Reserved. + # + # This program is free software; you can redistribute it and/or modify it +@@ -99,7 +99,6 @@ pmlogger.service : pmlogger.service.in + + pmlogger_farm.service : pmlogger_farm.service.in + $(SED) <$< >$@ \ +- -e 's;@CRONTAB_PATH@;'$(CRONTAB_PATH)';' \ + -e 's;@PCP_SYSCONFIG_DIR@;'$(PCP_SYSCONFIG_DIR)';' \ + -e 's;@PCP_BINADM_DIR@;'$(PCP_BINADM_DIR)';' \ + -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ +@@ -110,7 +109,10 @@ pmlogger_farm.service : pmlogger_farm.se + + pmlogger_farm_check.service : pmlogger_farm_check.service.in + $(SED) <$< >$@ \ ++ -e 's;@CRONTAB_PATH@;'$(CRONTAB_PATH)';' \ + -e 's;@PCP_BIN_DIR@;'$(PCP_BIN_DIR)';' \ ++ -e 's;@PCP_VAR_DIR@;'$(PCP_VAR_DIR)';' \ ++ -e 's;@SD_SERVICE_TYPE@;'$(SD_SERVICE_TYPE)';' \ + # END + + pmlogger_daily.service : pmlogger_daily.service.in +diff -Naurp pcp-5.3.5.orig/src/pmlogger/pmlogger_check.service.in pcp-5.3.5/src/pmlogger/pmlogger_check.service.in +--- pcp-5.3.5.orig/src/pmlogger/pmlogger_check.service.in 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/pmlogger_check.service.in 2022-01-21 10:55:30.289602121 +1100 +@@ -15,6 +15,3 @@ ExecStart=@PCP_BINADM_DIR@/pmlogger_chec + WorkingDirectory=@PCP_VAR_DIR@ + Group=@PCP_GROUP@ + User=@PCP_USER@ +- +-[Install] +-RequiredBy=pmlogger.service +diff -Naurp pcp-5.3.5.orig/src/pmlogger/pmlogger_daily_report.service.in pcp-5.3.5/src/pmlogger/pmlogger_daily_report.service.in +--- pcp-5.3.5.orig/src/pmlogger/pmlogger_daily_report.service.in 2021-10-07 14:28:56.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/pmlogger_daily_report.service.in 2022-01-21 10:55:30.289602121 +1100 +@@ -13,6 +13,3 @@ ExecStart=@PCP_BINADM_DIR@/pmlogger_dail + WorkingDirectory=@PCP_VAR_DIR@ + Group=@PCP_GROUP@ + User=@PCP_USER@ +- +-[Install] +-WantedBy=pmlogger.service +diff -Naurp pcp-5.3.5.orig/src/pmlogger/pmlogger_farm_check.service.in pcp-5.3.5/src/pmlogger/pmlogger_farm_check.service.in +--- pcp-5.3.5.orig/src/pmlogger/pmlogger_farm_check.service.in 2021-11-09 09:08:40.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/pmlogger_farm_check.service.in 2022-01-21 10:55:54.918186303 +1100 +@@ -1,19 +1,15 @@ + [Unit] +-Description=Check and migrate non-primary pmlogger instances to pmlogger_farm +-Documentation=man:pmlogger_check(1) +-# TODO non-systemd ConditionPathExists=!/etc/cron.d/pcp-pmlogger ++Description=Check and migrate non-primary pmlogger farm instances ++Documentation=man:pmlogctl(1) ++ConditionPathExists=!@CRONTAB_PATH@ + + [Service] +-Type=exec ++Type=@SD_SERVICE_TYPE@ + Restart=no + TimeoutStartSec=4h + TimeoutStopSec=120 + ExecStart=@PCP_BIN_DIR@/pmlogctl -m check +-WorkingDirectory=/var/lib/pcp +- +-# root so pmlogctl can migrate pmloggers to the pmlogger_farm service ++WorkingDirectory=@PCP_VAR_DIR@ ++# root so pmlogctl can migrate pmlogger processes to the pmlogger_farm service + Group=root + User=root +- +-[Install] +-RequiredBy=pmlogger_farm.service +diff -Naurp pcp-5.3.5.orig/src/pmlogger/pmlogger_farm_check.timer pcp-5.3.5/src/pmlogger/pmlogger_farm_check.timer +--- pcp-5.3.5.orig/src/pmlogger/pmlogger_farm_check.timer 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/pmlogger_farm_check.timer 2022-01-21 10:49:07.986980661 +1100 +@@ -1,10 +1,11 @@ + [Unit] +-Description=5 minute check of pmlogger farm instances ++Description=Half-hourly check of pmlogger farm instances + + [Timer] +-# if enabled, runs 1m after boot and every 5 mins ++# if enabled, runs 1m after boot and every half hour + OnBootSec=1min +-OnCalendar=*:00/5 ++OnCalendar=*-*-* *:25:10 ++OnCalendar=*-*-* *:55:10 + + [Install] + WantedBy=timers.target +diff -Naurp pcp-5.3.5.orig/src/pmlogger/pmlogger_farm.service.in pcp-5.3.5/src/pmlogger/pmlogger_farm.service.in +--- pcp-5.3.5.orig/src/pmlogger/pmlogger_farm.service.in 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/pmlogger_farm.service.in 2022-01-21 10:55:30.289602121 +1100 +@@ -1,9 +1,9 @@ + [Unit] + Description=pmlogger farm service +-Documentation=man:pmlogger(1) +-After=network-online.target pmcd.service +-Before=pmlogger_check.timer pmlogger_daily.timer +-BindsTo=pmlogger_farm_check.timer pmlogger_check.timer pmlogger_daily.timer ++Documentation=man:pmlogger_check(1) ++Before=pmlogger_farm_check.timer ++BindsTo=pmlogger_farm_check.timer ++PartOf=pmlogger.service + + [Service] + Type=@SD_SERVICE_TYPE@ +@@ -12,16 +12,12 @@ Restart=always + TimeoutStartSec=4h + TimeoutStopSec=120 + # the pmlogger_farm service manages all pmloggers except the primary +-Environment="PMLOGGER_CHECK_PARAMS=--skip-primary" ++Environment="PMLOGGER_CHECK_PARAMS=--skip-primary --quick" + EnvironmentFile=-@PCP_SYSCONFIG_DIR@/pmlogger_timers + ExecStart=@PCP_BINADM_DIR@/pmlogger_farm $PMLOGGER_CHECK_PARAMS +- + WorkingDirectory=@PCP_VAR_DIR@ + Group=@PCP_GROUP@ + User=@PCP_USER@ + + [Install] +-WantedBy=multi-user.target +- +-# This dependency will be removed in PCPv6. +-WantedBy=pmlogger.service ++RequiredBy=pmlogger.service +diff -Naurp pcp-5.3.5.orig/src/pmlogger/pmlogger.service.in pcp-5.3.5/src/pmlogger/pmlogger.service.in +--- pcp-5.3.5.orig/src/pmlogger/pmlogger.service.in 2021-11-04 08:26:15.000000000 +1100 ++++ pcp-5.3.5/src/pmlogger/pmlogger.service.in 2022-01-21 10:49:07.986980661 +1100 +@@ -2,8 +2,8 @@ + Description=Performance Metrics Archive Logger + Documentation=man:pmlogger(1) + After=network-online.target pmcd.service +-Before=pmlogger_check.timer pmlogger_daily.timer +-BindsTo=pmlogger_check.timer pmlogger_daily.timer ++Before=pmlogger_farm.service pmlogger_check.timer pmlogger_daily.timer ++BindsTo=pmlogger_farm.service pmlogger_check.timer pmlogger_daily.timer + Wants=pmcd.service + + [Service] diff --git a/redhat-bugzilla-2029301.patch b/redhat-bugzilla-2029301.patch new file mode 100644 index 0000000..47b515d --- /dev/null +++ b/redhat-bugzilla-2029301.patch @@ -0,0 +1,38 @@ +commit 9d9adc9d6c8eb24a6884da81c18b927ea706a68e +Author: Nathan Scott +Date: Tue Dec 7 11:18:11 2021 +1100 + + pmdanvidia: fix mishandling of zero-byte size passed to realloc + + Picked up during QA of recent nvidia changes - some hardware lacks + support for per-process metrics, or the hardware (GPU) has not yet + been accessed by a process using its resources, which had the side + effect that a zero-byte size argument was passed into realloc. In + turn, this passes back something that can be freed and an issue in + the logic meant this would happen on subsequent calls also. + + Resolves the QA failure and Red Hat BZ #2029301 + +diff --git a/src/pmdas/nvidia/nvidia.c b/src/pmdas/nvidia/nvidia.c +index f1c12f2275..dc5bb93a0d 100644 +--- a/src/pmdas/nvidia/nvidia.c ++++ b/src/pmdas/nvidia/nvidia.c +@@ -617,11 +617,16 @@ refresh(pcp_nvinfo_t *nvinfo, int need_processes) + /* update indoms, cull old entries that remain inactive */ + if (need_processes) { + pmdaIndom *proc_indomp = &indomtab[PROC_INDOM]; +- pmdaInstid *it_set = proc_indomp->it_set; ++ pmdaInstid *it_set = NULL; + size_t bytes = nproc * sizeof(pmdaInstid); + +- if ((it_set = (pmdaInstid *)realloc(it_set, bytes)) == NULL) ++ if (bytes > 0) { ++ it_set = (pmdaInstid *)realloc(proc_indomp->it_set, bytes); ++ if (it_set == NULL) ++ free(proc_indomp->it_set); ++ } else if (proc_indomp->it_set != NULL) { + free(proc_indomp->it_set); ++ } + + if ((proc_indomp->it_set = it_set) != NULL) { + for (i = j = 0; i < processes.hsize && j < nproc; i++) { diff --git a/redhat-bugzilla-2030121.patch b/redhat-bugzilla-2030121.patch new file mode 100644 index 0000000..9a24ef0 --- /dev/null +++ b/redhat-bugzilla-2030121.patch @@ -0,0 +1,50 @@ +commit df7b7bf64eb354114e6c519e3e03ffc446afa8ba +Author: Nathan Scott +Date: Fri Nov 26 09:17:23 2021 +1100 + + libpcp_pmda: add indom cache fast-paths for inst lookup beyond max + + We encountered a situation where indom cache loading consumed vast + CPU resources for an indom of size ~150k instances. Profiling was + used to identify the insert loop that ensures the inst linked list + within the cache hash tables is sorted - this loop is O(N*2) as we + potentially walk this list from the start on every insert during a + cache load. Because cache loading happens from a sorted file, the + worst-case scenario happened every time - each new instance insert + occurs beyond the current maximum. Fortunately we maintain a last + entry pointer, so the new fast path uses that first and falls back + to the original behaviour for an out-of-order insertion. + + A second opportunity for the same optimization was identified when + auditing the rest of cache.c - in the find_inst() routine for inst + identifier lookups beyond the current maximum observed instance. + + Resolves Red Hat BZ #2024648 + +diff --git a/src/libpcp_pmda/src/cache.c b/src/libpcp_pmda/src/cache.c +index 0e66506d74..196ffc1da9 100644 +--- a/src/libpcp_pmda/src/cache.c ++++ b/src/libpcp_pmda/src/cache.c +@@ -328,6 +328,9 @@ find_inst(hdr_t *h, int inst) + { + entry_t *e; + ++ if ((e = h->last) != NULL && e->inst < inst) ++ return NULL; ++ + for (e = h->first; e != NULL; e = e->next) { + if (e->inst == inst && e->state != PMDA_CACHE_EMPTY) + break; +@@ -621,7 +624,11 @@ insert_cache(hdr_t *h, const char *name, int inst, int *sts) + *sts = PM_ERR_INST; + return e; + } +- for (e = h->first; e != NULL; e = e->next) { ++ /* if this entry is beyond the (sorted) list end, avoid linear scan */ ++ if ((e = h->last) == NULL || e->inst > inst) ++ e = h->first; ++ /* linear search over linked list, starting at either first or last */ ++ for (; e != NULL; e = e->next) { + if (e->inst < inst) + last_e = e; + else if (e->inst > inst) diff --git a/redhat-bugzilla-2030140.patch b/redhat-bugzilla-2030140.patch new file mode 100644 index 0000000..3a9687f --- /dev/null +++ b/redhat-bugzilla-2030140.patch @@ -0,0 +1,742 @@ +diff -Naurp pcp-5.3.5.orig/qa/1458 pcp-5.3.5/qa/1458 +--- pcp-5.3.5.orig/qa/1458 1970-01-01 10:00:00.000000000 +1000 ++++ pcp-5.3.5/qa/1458 2021-12-09 11:25:01.973327231 +1100 +@@ -0,0 +1,219 @@ ++#!/bin/sh ++# PCP QA Test No. 1458 ++# Exercise access pmproxy with secure.enabled = false ++# ++# The main purpose of this is to test that the component works correctly ++# when secure.enabled = false; we can expect the https URLs to fail. ++# ++# See https://github.com/performancecopilot/pcp/issues/1490 ++ ++# Copyright (c) 2019,2021 Red Hat ++# Modified by Netflix, Inc. ++# ++ ++seq=`basename $0` ++echo "QA output created by $seq" ++ ++# get standard environment, filters and checks ++. ./common.product ++. ./common.filter ++. ./common.check ++ ++_check_series # pmseries availability means libuv is in use ++_check_valgrind ++openssl help 2>/dev/null || _notrun "No openssl binary found" ++ ++if [ -f /etc/lsb-release ] ++then ++ . /etc/lsb-release ++ if [ "$DISTRIB_ID" = Ubuntu ] ++ then ++ # This test fails for Ubuntu 19.10 with a myriad of errors involving ++ # the use of uninitialized values. The code paths very but typically ++ # involve libuv -> libssl -> libcrypto ++ # ++ case "$DISTRIB_RELEASE" ++ in ++ 19.10) ++ _notrun "problems with libuv, libssl, libcrypto and valgrind on Ubuntu $DISTRIB_RELEASE" ++ ;; ++ esac ++ fi ++fi ++ ++_cleanup() ++{ ++ cd $here ++ if $need_restore ++ then ++ need_restore=false ++ _restore_config $PCP_SYSCONF_DIR/labels ++ _sighup_pmcd ++ fi ++ $sudo rm -rf $tmp $tmp.* ++} ++ ++status=1 # failure is the default! ++need_restore=false ++username=`id -u -n` ++$sudo rm -rf $tmp $tmp.* $seq.full ++trap "_cleanup; exit \$status" 0 1 2 3 15 ++ ++_check_empty() ++{ ++ tee -a $seq.full > $tmp.unfiltered ++ if [ -s $tmp.unfiltered ] ++ then ++ echo "Botch: got output from curl" ++ else ++ echo "Good!, empty output from curl" ++ fi ++} ++ ++_filter_json() ++{ ++ tee -a $seq.full > $tmp.unfiltered ++ if [ -s $tmp.unfiltered ] ++ then ++ pmjson < $tmp.unfiltered > $tmp.filtered ++ status=$? ++ if [ $status -eq 0 ]; then ++ cat $tmp.filtered | \ ++ sed \ ++ -e '/"machineid": .*/d' \ ++ -e 's,"series": .*,"series": "SERIES",g' \ ++ -e 's,"context": .*,"context": "CONTEXT",g' \ ++ -e 's,"hostname": .*,"hostname": "HOSTNAME",g' \ ++ -e 's,"domainname": .*,"domainname": "DOMAINNAME",g' \ ++ #end ++ else ++ echo "Invalid JSON: $status" ++ cat $tmp.unfiltered ++ rm -f $tmp.context ++ fi ++ else ++ echo "Botch: no output from curl" ++ fi ++} ++ ++_filter_port() ++{ ++ sed \ ++ -e '/ ipv6 /d' \ ++ -e "s/ $port / PORT /g" \ ++ #end ++} ++ ++# real QA test starts here ++_save_config $PCP_SYSCONF_DIR/labels ++need_restore=true ++ ++$sudo rm -rf $PCP_SYSCONF_DIR/labels/* ++_sighup_pmcd ++ ++openssl req \ ++ -new -newkey rsa:4096 -days 365 -nodes -x509 \ ++ -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.pcpqa.com" \ ++ -keyout $tmp.key -out $tmp.cert >$seq.full 2>&1 ++# creates a self-signed (insecure) certificate, so for testing only ++ ++echo "[pmproxy]" >> $tmp.conf ++echo "pcp.enabled = true" >> $tmp.conf ++echo "http.enabled = true" >> $tmp.conf ++echo "redis.enabled = false" >> $tmp.conf ++echo "secure.enabled = false" >> $tmp.conf ++ ++port=`_find_free_port` ++mkdir -p $tmp.pmproxy/pmproxy ++export PCP_RUN_DIR=$tmp.pmproxy ++export PCP_TMP_DIR=$tmp.pmproxy ++ ++$_valgrind_clean_assert pmproxy -f -l- --timeseries \ ++ -c $tmp.conf -p $port -U $username \ ++ >$tmp.valout 2>$tmp.valerr & ++pid=$! ++ ++echo "valgrind pid: $pid" >>$seq.full ++echo "pmproxy port: $port" >>$seq.full ++ ++# valgrind takes awhile to fire up ++i=0 ++while [ $i -lt 40 ] ++do ++ $PCP_BINADM_DIR/telnet-probe -c localhost $port && break ++ sleep 1 ++ i=`expr $i + 1` ++done ++if $PCP_BINADM_DIR/telnet-probe -c localhost $port ++then ++ echo "Startup took $i secs" >>$seq.full ++else ++ echo "Arrgh: valgrind failed start pmproxy and get port $port ready after 30 secs" ++ exit ++fi ++ ++date >>$seq.full ++echo "=== checking serial http operation ===" | tee -a $seq.full ++for i in 1 2 3 4; do ++ curl -Gs "http://localhost:$port/pmapi/metric?name=sample.long.ten" 2>$tmp.err$i >$tmp.out$i ++done ++for i in 1 2 3 4; do ++echo === out$i === | tee -a $seq.full ++_filter_json < $tmp.out$i ++done ++ ++date >>$seq.full ++echo "=== checking parallel http operation ===" | tee -a $seq.full ++for i in 1 2 3 4; do ++ curl -Gs "http://localhost:$port/pmapi/metric?name=sample.long.ten" 2>$tmp.err$i >$tmp.out$i & 2>/dev/null eval pid$i=$! ++done ++wait $pid1 $pid2 $pid3 $pid4 ++for i in 1 2 3 4; do ++echo === out$i === | tee -a $seq.full ++_filter_json < $tmp.out$i ++done ++ ++date >>$seq.full ++echo "=== checking serial https/TLS operation ===" | tee -a $seq.full ++for i in 1 2 3 4; do ++ curl -k -Gs "https://localhost:$port/pmapi/metric?name=sample.long.ten" 2>$tmp.err$i >$tmp.out$i ++done ++for i in 1 2 3 4; do ++echo === out$i === | tee -a $seq.full ++_check_empty < $tmp.out$i ++done ++ ++date >>$seq.full ++echo "=== checking parallel https/TLS operation ===" | tee -a $seq.full ++for i in 1 2 3 4; do ++ curl -k -Gs "https://localhost:$port/pmapi/metric?name=sample.long.ten" 2>$tmp.err$i >$tmp.out$i & 2>/dev/null eval pid$i=$! ++done ++wait $pid1 $pid2 $pid3 $pid4 ++for i in 1 2 3 4; do ++echo === out$i === | tee -a $seq.full ++_check_empty < $tmp.out$i ++done ++ ++echo "=== check pmproxy is running ===" ++pminfo -v -h localhost@localhost:$port hinv.ncpu ++if [ $? -eq 0 ]; then ++ echo "pmproxy check passed" ++else ++ echo "pmproxy check failed" ++fi ++ ++# valgrind takes awhile to shutdown too ++pmsignal $pid >/dev/null 2>&1 ++pmsleep 3.5 ++echo "=== valgrind stdout ===" | tee -a $seq.full ++cat $tmp.valout | _filter_valgrind ++ ++echo "=== valgrind stderr ===" | tee -a $seq.full ++cat $tmp.valerr | _filter_pmproxy_log | _filter_port ++ ++# final kill if it's spinning ++$sudo kill -9 $pid >/dev/null 2>&1 ++ ++# success, all done ++status=0 ++exit +diff -Naurp pcp-5.3.5.orig/qa/1458.out pcp-5.3.5/qa/1458.out +--- pcp-5.3.5.orig/qa/1458.out 1970-01-01 10:00:00.000000000 +1000 ++++ pcp-5.3.5/qa/1458.out 2021-12-09 11:25:01.973327231 +1100 +@@ -0,0 +1,221 @@ ++QA output created by 1458 ++=== checking serial http operation === ++=== out1 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== out2 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== out3 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== out4 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== checking parallel http operation === ++=== out1 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== out2 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== out3 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== out4 === ++{ ++ "context": "CONTEXT" ++ "metrics": [ ++ { ++ "name": "sample.long.ten", ++ "series": "SERIES" ++ "pmid": "29.0.11", ++ "type": "32", ++ "sem": "instant", ++ "units": "none", ++ "labels": { ++ "agent": "sample", ++ "cluster": "zero", ++ "domainname": "DOMAINNAME" ++ "hostname": "HOSTNAME" ++ "role": "testing" ++ }, ++ "text-oneline": "10 as a 32-bit integer", ++ "text-help": "10 as a 32-bit integer" ++ } ++ ] ++} ++=== checking serial https/TLS operation === ++=== out1 === ++Good!, empty output from curl ++=== out2 === ++Good!, empty output from curl ++=== out3 === ++Good!, empty output from curl ++=== out4 === ++Good!, empty output from curl ++=== checking parallel https/TLS operation === ++=== out1 === ++Good!, empty output from curl ++=== out2 === ++Good!, empty output from curl ++=== out3 === ++Good!, empty output from curl ++=== out4 === ++Good!, empty output from curl ++=== check pmproxy is running === ++pmproxy check passed ++=== valgrind stdout === ++=== valgrind stderr === ++Log for pmproxy on HOST started DATE ++ ++pmproxy: PID = PID ++pmproxy request port(s): ++ sts fd port family address ++ === ==== ===== ====== ======= ++ok FD unix UNIX_DOMAIN_SOCKET ++ok FD PORT inet INADDR_ANY ++[DATE] pmproxy(PID) Info: pmproxy caught SIGTERM ++[DATE] pmproxy(PID) Info: pmproxy Shutdown ++ ++Log finished DATE +diff -Naurp pcp-5.3.5.orig/src/pmproxy/src/pcp.c pcp-5.3.5/src/pmproxy/src/pcp.c +--- pcp-5.3.5.orig/src/pmproxy/src/pcp.c 2021-09-24 09:33:06.000000000 +1000 ++++ pcp-5.3.5/src/pmproxy/src/pcp.c 2021-12-09 11:22:09.829321418 +1100 +@@ -1,6 +1,6 @@ + /* +- * Copyright (c) 2018-2019 Red Hat. +- * ++ * Copyright (c) 2018-2019,2021 Red Hat. ++ * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or +@@ -19,22 +19,13 @@ + #define PDU_MAXLENGTH (MAXHOSTNAMELEN + HEADER_LENGTH + sizeof("65536")-1) + + static void +-client_free(struct client *client) +-{ +- if (client->u.pcp.hostname) +- sdsfree(client->u.pcp.hostname); +- if (client->buffer) +- sdsfree(client->buffer); +-} +- +-static void + on_server_close(uv_handle_t *handle) + { + struct client *client = (struct client *)handle; + + if (pmDebugOptions.pdu) + fprintf(stderr, "client %p pmcd connection closed\n", client); +- client_free(client); ++ client_put(client); + } + + static void +@@ -92,12 +83,11 @@ on_server_read(uv_stream_t *stream, ssiz + void + on_pcp_client_close(struct client *client) + { +- if (client->u.pcp.connected) { ++ if (client->u.pcp.connected) + uv_close((uv_handle_t *)&client->u.pcp.socket, on_server_close); +- memset(&client->u.pcp, 0, sizeof(client->u.pcp)); +- } else { +- client_free(client); +- } ++ if (client->u.pcp.hostname) ++ sdsfree(client->u.pcp.hostname); ++ memset(&client->u.pcp, 0, sizeof(client->u.pcp)); + } + + static void +@@ -118,6 +108,8 @@ on_pcp_client_connect(uv_connect_t *conn + + /* socket connection to pmcd successfully established */ + client->u.pcp.state = PCP_PROXY_SETUP; ++ client->u.pcp.connected = 1; ++ client_get(client); + + /* if we have already received PDUs, send them on now */ + if ((buffer = client->buffer) != NULL) { +diff -Naurp pcp-5.3.5.orig/src/pmproxy/src/secure.c pcp-5.3.5/src/pmproxy/src/secure.c +--- pcp-5.3.5.orig/src/pmproxy/src/secure.c 2021-11-01 13:02:26.000000000 +1100 ++++ pcp-5.3.5/src/pmproxy/src/secure.c 2021-12-09 11:22:09.831321384 +1100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2019 Red Hat. ++ * Copyright (c) 2019,2021 Red Hat. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published +@@ -16,7 +16,7 @@ + #include + #include + +-/* called with proxy->mutex locked */ ++/* called with proxy->write_mutex locked */ + static void + remove_connection_from_queue(struct client *client) + { +@@ -44,9 +44,9 @@ on_secure_client_close(struct client *cl + if (pmDebugOptions.auth || pmDebugOptions.http) + fprintf(stderr, "%s: client %p\n", "on_secure_client_close", client); + +- uv_mutex_lock(&client->proxy->mutex); ++ uv_mutex_lock(&client->proxy->write_mutex); + remove_connection_from_queue(client); +- uv_mutex_unlock(&client->proxy->mutex); ++ uv_mutex_unlock(&client->proxy->write_mutex); + /* client->read and client->write freed by SSL_free */ + SSL_free(client->secure.ssl); + } +@@ -63,7 +63,7 @@ maybe_flush_ssl(struct proxy *proxy, str + client->secure.pending.writes_count > 0) + return; + +- uv_mutex_lock(&proxy->mutex); ++ uv_mutex_lock(&proxy->write_mutex); + if (proxy->pending_writes == NULL) { + proxy->pending_writes = client; + client->secure.pending.prev = client->secure.pending.next = NULL; +@@ -75,7 +75,7 @@ maybe_flush_ssl(struct proxy *proxy, str + client->secure.pending.prev = c; + } + client->secure.pending.queued = 1; +- uv_mutex_unlock(&proxy->mutex); ++ uv_mutex_unlock(&proxy->write_mutex); + } + + static void +@@ -161,7 +161,7 @@ flush_secure_module(struct proxy *proxy) + size_t i, used; + int sts; + +- uv_mutex_lock(&proxy->mutex); ++ uv_mutex_lock(&proxy->write_mutex); + head = &proxy->pending_writes; + while ((client = *head) != NULL) { + flush_ssl_buffer(client); +@@ -212,7 +212,7 @@ flush_secure_module(struct proxy *proxy) + sizeof(uv_buf_t) * client->secure.pending.writes_count); + } + } +- uv_mutex_unlock(&proxy->mutex); ++ uv_mutex_unlock(&proxy->write_mutex); + } + + void +@@ -221,7 +221,8 @@ secure_client_write(struct client *clien + struct proxy *proxy = client->proxy; + uv_buf_t *dup; + size_t count, bytes; +- int i, sts, defer = 0, maybe = 0; ++ unsigned int i; ++ int sts, defer = 0, maybe = 0; + + for (i = 0; i < request->nbuffers; i++) { + if (defer == 0) { +diff -Naurp pcp-5.3.5.orig/src/pmproxy/src/server.c pcp-5.3.5/src/pmproxy/src/server.c +--- pcp-5.3.5.orig/src/pmproxy/src/server.c 2021-11-01 13:02:26.000000000 +1100 ++++ pcp-5.3.5/src/pmproxy/src/server.c 2021-12-09 11:22:09.831321384 +1100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2018-2019 Red Hat. ++ * Copyright (c) 2018-2019,2021 Red Hat. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published +@@ -125,7 +125,7 @@ server_init(int portcount, const char *l + pmGetProgname()); + return NULL; + } +- uv_mutex_init(&proxy->mutex); ++ uv_mutex_init(&proxy->write_mutex); + + count = portcount + (*localpath ? 1 : 0); + if (count) { +@@ -229,7 +229,6 @@ void + client_put(struct client *client) + { + unsigned int refcount; +- struct proxy *proxy = client->proxy; + + uv_mutex_lock(&client->mutex); + assert(client->refcount); +@@ -237,22 +236,16 @@ client_put(struct client *client) + uv_mutex_unlock(&client->mutex); + + if (refcount == 0) { +- /* remove client from the doubly-linked list */ +- uv_mutex_lock(&proxy->mutex); +- if (client->next != NULL) +- client->next->prev = client->prev; +- *client->prev = client->next; +- uv_mutex_unlock(&proxy->mutex); +- + if (client->protocol & STREAM_PCP) + on_pcp_client_close(client); + if (client->protocol & STREAM_HTTP) + on_http_client_close(client); + if (client->protocol & STREAM_REDIS) + on_redis_client_close(client); +- if (client->protocol & STREAM_SECURE) ++ if ((client->protocol & STREAM_SECURE) && client->stream.secure) + on_secure_client_close(client); +- ++ if (client->buffer) ++ sdsfree(client->buffer); + memset(client, 0, sizeof(*client)); + free(client); + } +@@ -284,7 +277,7 @@ on_client_write(uv_write_t *writer, int + "on_client_write", status, client); + + if (status == 0) { +- if (client->protocol & STREAM_SECURE) ++ if ((client->protocol & STREAM_SECURE) && client->stream.secure) + on_secure_client_write(client); + if (client->protocol & STREAM_PCP) + on_pcp_client_write(client); +@@ -434,10 +427,16 @@ on_client_read(uv_stream_t *stream, ssiz + if (nread > 0) { + if (client->protocol == STREAM_UNKNOWN) + client->protocol |= client_protocol(*buf->base); +- if (client->protocol & STREAM_SECURE) ++ ++#ifdef HAVE_OPENSSL ++ if ((client->protocol & STREAM_SECURE) && (proxy->ssl != NULL)) + on_secure_client_read(proxy, client, nread, buf); + else + on_protocol_read(stream, nread, buf); ++#else ++ on_protocol_read(stream, nread, buf); ++#endif ++ + } else if (nread < 0) { + if (pmDebugOptions.af) + fprintf(stderr, "%s: read error %ld " +@@ -494,14 +493,6 @@ on_client_connection(uv_stream_t *stream + handle->data = (void *)proxy; + client->proxy = proxy; + +- /* insert client into doubly-linked list at the head */ +- uv_mutex_lock(&proxy->mutex); +- if ((client->next = proxy->first) != NULL) +- proxy->first->prev = &client->next; +- proxy->first = client; +- client->prev = &proxy->first; +- uv_mutex_unlock(&proxy->mutex); +- + status = uv_read_start((uv_stream_t *)&client->stream.u.tcp, + on_buffer_alloc, on_client_read); + if (status != 0) { +@@ -719,7 +710,7 @@ shutdown_ports(void *arg) + struct proxy *proxy = (struct proxy *)arg; + struct server *server; + struct stream *stream; +- int i; ++ unsigned int i; + + for (i = 0; i < proxy->nservers; i++) { + server = &proxy->servers[i]; +@@ -756,7 +747,8 @@ dump_request_ports(FILE *output, void *a + struct proxy *proxy = (struct proxy *)arg; + struct stream *stream; + uv_os_fd_t uv_fd; +- int i, fd; ++ unsigned int i; ++ int fd; + + fprintf(output, "%s request port(s):\n" + " sts fd port family address\n" +diff -Naurp pcp-5.3.5.orig/src/pmproxy/src/server.h pcp-5.3.5/src/pmproxy/src/server.h +--- pcp-5.3.5.orig/src/pmproxy/src/server.h 2021-09-24 09:33:06.000000000 +1000 ++++ pcp-5.3.5/src/pmproxy/src/server.h 2021-12-09 11:22:09.830321401 +1100 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2018-2019 Red Hat. ++ * Copyright (c) 2018-2019,2021 Red Hat. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published +@@ -97,11 +97,11 @@ typedef struct http_client { + + typedef struct pcp_client { + pcp_proxy_state_t state; +- sds hostname; + unsigned int port : 16; + unsigned int certreq : 1; + unsigned int connected : 1; + unsigned int pad : 14; ++ sds hostname; + uv_connect_t pmcd; + uv_tcp_t socket; + } pcp_client_t; +@@ -136,8 +136,6 @@ typedef struct client { + pcp_client_t pcp; + } u; + struct proxy *proxy; +- struct client *next; +- struct client **prev; + sds buffer; + } client_t; + +@@ -161,7 +159,7 @@ typedef struct proxy { + struct dict *config; /* configuration dictionary */ + uv_loop_t *events; /* global, async event loop */ + uv_callback_t write_callbacks; +- uv_mutex_t mutex; /* protects client lists and pending writes */ ++ uv_mutex_t write_mutex; /* protects pending writes */ + } proxy_t; + + extern void proxylog(pmLogLevel, sds, void *); diff --git a/sources b/sources new file mode 100644 index 0000000..71deb6c --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pcp-5.3.5.src.tar.gz) = d5481e2667d881ebc6a70e842958350e400f0a34cf746a29a97e77150af78d50d6eec5108a4e6fb013025bbd1089828c7cc02cc18220925f0198ed02924dc693