Rebase to pcp-6.0.1-1

Resolves: rhbz#1941873
Resolves: rhbz#2117074
Resolves: rhbz#2127037
This commit is contained in:
Nathan Scott 2022-10-27 14:18:47 +11:00
parent 5c636602ae
commit 74ebb45b22
4 changed files with 51 additions and 467 deletions

121
pcp.spec
View File

@ -1,5 +1,5 @@
Name: pcp Name: pcp
Version: 6.0.0 Version: 6.0.1
Release: 1%{?dist} Release: 1%{?dist}
Summary: System-level performance monitoring and performance management Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY License: GPLv2+ and LGPLv2+ and CC-BY
@ -11,9 +11,6 @@ Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
Source1: %{pcp_git_url}/main/debian/pcp-testsuite.sysusers Source1: %{pcp_git_url}/main/debian/pcp-testsuite.sysusers
Source2: %{pcp_git_url}/main/debian/pcp.sysusers Source2: %{pcp_git_url}/main/debian/pcp.sysusers
Patch0: redhat-bugzilla-2117074-pmdastatsd-ragel.patch
Patch1: redhat-bugzilla-2117074-pmdamongodb-build.patch
# The additional linker flags break out-of-tree PMDAs. # The additional linker flags break out-of-tree PMDAs.
# https://bugzilla.redhat.com/show_bug.cgi?id=2043092 # https://bugzilla.redhat.com/show_bug.cgi?id=2043092
%undefine _package_note_flags %undefine _package_note_flags
@ -52,8 +49,6 @@ Patch1: redhat-bugzilla-2117074-pmdamongodb-build.patch
%endif %endif
%endif %endif
%global disable_podman 0
# libchan, libhdr_histogram and pmdastatsd # libchan, libhdr_histogram and pmdastatsd
%if 0%{?fedora} >= 29 || 0%{?rhel} > 7 %if 0%{?fedora} >= 29 || 0%{?rhel} > 7
%global disable_statsd 0 %global disable_statsd 0
@ -287,7 +282,7 @@ BuildRequires: perl(Time::HiRes) perl(Digest::MD5)
BuildRequires: perl(XML::LibXML) perl(File::Slurp) BuildRequires: perl(XML::LibXML) perl(File::Slurp)
BuildRequires: man %{_hostname_executable} BuildRequires: man %{_hostname_executable}
%if !%{disable_systemd} %if !%{disable_systemd}
BuildRequires: systemd-devel systemd-rpm-macros BuildRequires: systemd-devel
%endif %endif
%if !%{disable_qt} %if !%{disable_qt}
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
@ -301,36 +296,27 @@ BuildRequires: qt5-qtsvg-devel
Requires: bash xz gawk sed grep findutils which %{_hostname_executable} Requires: bash xz gawk sed grep findutils which %{_hostname_executable}
Requires: pcp-libs = %{version}-%{release} Requires: pcp-libs = %{version}-%{release}
%if !%{disable_selinux}
%if !%{disable_selinux}
# rpm boolean dependencies are supported since RHEL 8 # rpm boolean dependencies are supported since RHEL 8
%if 0%{?fedora} >= 35 || 0%{?rhel} >= 8 %if 0%{?fedora} >= 35 || 0%{?rhel} >= 8
# This ensures that the pcp-selinux package and all it's dependencies are not pulled # This ensures that the pcp-selinux package and all its dependencies are
# into containers and other systems that do not use SELinux # not pulled into containers and other systems that do not use SELinux
Requires: (pcp-selinux = %{version}-%{release} if selinux-policy-targeted) Requires: (pcp-selinux = %{version}-%{release} if selinux-policy-targeted)
%else %else
Requires: pcp-selinux = %{version}-%{release} Requires: pcp-selinux = %{version}-%{release}
%endif %endif
%endif %endif
%global _confdir %{_sysconfdir}/pcp %global _confdir %{_sysconfdir}/pcp
%global _logsdir %{_localstatedir}/log/pcp %global _logsdir %{_localstatedir}/log/pcp
%global _pmnsdir %{_localstatedir}/lib/pcp/pmns %global _pmnsdir %{_localstatedir}/lib/pcp/pmns
%global _pmnsexecdir %{_libexecdir}/pcp/pmns
%global _tempsdir %{_localstatedir}/lib/pcp/tmp
%global _pmdasdir %{_localstatedir}/lib/pcp/pmdas %global _pmdasdir %{_localstatedir}/lib/pcp/pmdas
%global _pmdasexecdir %{_libexecdir}/pcp/pmdas %global _pmdasexecdir %{_libexecdir}/pcp/pmdas
%global _testsdir %{_localstatedir}/lib/pcp/testsuite %global _testsdir %{_localstatedir}/lib/pcp/testsuite
%global _selinuxdir %{_localstatedir}/lib/pcp/selinux
%global _selinuxexecdir %{_libexecdir}/pcp/selinux
%global _ieconfigdir %{_localstatedir}/lib/pcp/config/pmie %global _ieconfigdir %{_localstatedir}/lib/pcp/config/pmie
%global _ieconfdir %{_localstatedir}/lib/pcp/config/pmieconf %global _ieconfdir %{_localstatedir}/lib/pcp/config/pmieconf
%global _tapsetdir %{_datadir}/systemtap/tapset %global _selinuxdir %{_datadir}/selinux/packages/targeted
%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 %if 0%{?fedora} >= 20 || 0%{?rhel} >= 8
%global _with_doc --with-docdir=%{_docdir}/%{name} %global _with_doc --with-docdir=%{_docdir}/%{name}
@ -373,12 +359,6 @@ Requires: pcp-selinux = %{version}-%{release}
%global _with_perfevent --with-perfevent=yes %global _with_perfevent --with-perfevent=yes
%endif %endif
%if %{disable_podman}
%global _with_podman --with-podman=no
%else
%global _with_podman --with-podman=yes
%endif
%if %{disable_statsd} %if %{disable_statsd}
%global _with_statsd --with-pmdastatsd=no %global _with_statsd --with-pmdastatsd=no
%else %else
@ -466,16 +446,6 @@ else
fi 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 %description
Performance Co-Pilot (PCP) provides a framework and services to support Performance Co-Pilot (PCP) provides a framework and services to support
system-level performance monitoring and performance management. system-level performance monitoring and performance management.
@ -565,10 +535,7 @@ 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-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-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-hacluster pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-denki pcp-pmda-docker pcp-pmda-bind2
Requires: pcp-pmda-sockets Requires: pcp-pmda-sockets pcp-pmda-podman
%if !%{disable_podman}
Requires: pcp-pmda-podman
%endif
%if !%{disable_statsd} %if !%{disable_statsd}
Requires: pcp-pmda-statsd Requires: pcp-pmda-statsd
%endif %endif
@ -932,7 +899,6 @@ Performance Co-Pilot (PCP) front-end tools for exporting metric values
to the Zabbix (https://www.zabbix.org/) monitoring software. to the Zabbix (https://www.zabbix.org/) monitoring software.
%endif %endif
%if !%{disable_podman}
# #
# pcp-pmda-podman # pcp-pmda-podman
# #
@ -945,7 +911,6 @@ Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
%description pmda-podman %description pmda-podman
This package contains the PCP Performance Metrics Domain Agent (PMDA) for This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting podman container and pod statistics via the podman REST API. collecting podman container and pod statistics via the podman REST API.
%endif
%if !%{disable_statsd} %if !%{disable_statsd}
# #
@ -2325,8 +2290,6 @@ updated policy package.
%prep %prep
%setup -q %setup -q
%patch0 -p1
%patch1 -p1
%build %build
# the buildsubdir macro gets defined in %%setup and is apparently only available in the next step (i.e. the %%build step) # the buildsubdir macro gets defined in %%setup and is apparently only available in the next step (i.e. the %%build step)
@ -2339,7 +2302,7 @@ sed -i "/PACKAGE_BUILD/s/=[0-9]*/=$_build/" VERSION.pcp
%if !%{disable_python2} && 0%{?default_python} != 3 %if !%{disable_python2} && 0%{?default_python} != 3
export PYTHON=python%{?default_python} export PYTHON=python%{?default_python}
%endif %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_mongodb} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2} %configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_mongodb} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2}
make %{?_smp_mflags} default_pcp make %{?_smp_mflags} default_pcp
%install %install
@ -2474,13 +2437,13 @@ total_manifest | keep 'tutorials|/html/|pcp-doc|man.*\.[1-9].*' | cull 'out' >pc
total_manifest | keep 'testsuite|pcpqa|etc/systemd/system|libpcp_fault|pcp/fault.h' >pcp-testsuite-files total_manifest | keep 'testsuite|pcpqa|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 "$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 'selinux' | cull 'tmp|testsuite' >pcp-selinux-files
basic_manifest | keep 'zeroconf|daily[-_]report|/sa$' >pcp-zeroconf-files basic_manifest | keep 'zeroconf|daily[-_]report|/sa$' >pcp-zeroconf-files
basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|htop|pcp2csv' \ basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|htop|pcp2csv' \
-e 'pcp-atop|pcp-dmcache|pcp-dstat|pcp-free|pcp-htop' \ -e 'pcp-atop|pcp-dmcache|pcp-dstat|pcp-free|pcp-htop' \
-e 'pcp-ipcs|pcp-iostat|pcp-lvmcache|pcp-mpstat' \ -e 'pcp-ipcs|pcp-iostat|pcp-lvmcache|pcp-mpstat' \
-e 'pcp-numastat|pcp-pidstat|pcp-shping|pcp-tapestat' \ -e 'pcp-numastat|pcp-pidstat|pcp-shping|pcp-tapestat' \
-e 'pcp-uptime|pcp-verify|pcp-ss' | \ -e 'pcp-uptime|pcp-verify|pcp-ss|pcp-ps' | \
cull 'selinux|pmlogconf|pmieconf|pmrepconf' >pcp-system-tools-files cull 'selinux|pmlogconf|pmieconf|pmrepconf' >pcp-system-tools-files
basic_manifest | keep 'sar2pcp' >pcp-import-sar2pcp-files basic_manifest | keep 'sar2pcp' >pcp-import-sar2pcp-files
@ -2718,8 +2681,11 @@ done
%endif %endif
%pre testsuite %pre testsuite
%if !%{disable_selinux}
%selinux_relabel_pre -s targeted
%endif
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 %if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
%sysusers_create_compat %{SOURCE1} systemd-sysusers --replace=/usr/lib/sysusers.d/pcp-testsuite.conf - < %{SOURCE1}
%else %else
getent group pcpqa >/dev/null || groupadd -r pcpqa getent group pcpqa >/dev/null || groupadd -r pcpqa
getent passwd pcpqa >/dev/null || \ getent passwd pcpqa >/dev/null || \
@ -2730,6 +2696,12 @@ chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null
exit 0 exit 0
%post testsuite %post testsuite
%if !%{disable_selinux}
PCP_SELINUX_DIR=%{_selinuxdir}
semodule -r pcpqa >/dev/null 2>&1 || true
%selinux_modules_install -s targeted "$PCP_SELINUX_DIR/pcp-testsuite.pp.bz2"
%selinux_relabel_post -s targeted
%endif
chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null
%if 0%{?rhel} %if 0%{?rhel}
%if !%{disable_systemd} %if !%{disable_systemd}
@ -2745,9 +2717,17 @@ chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null
%endif %endif
exit 0 exit 0
%if !%{disable_selinux}
%postun testsuite
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s targeted pcp-testsuite
%selinux_relabel_post -s targeted
fi
%endif
%pre %pre
%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 %if 0%{?fedora} >= 32 || 0%{?rhel} >= 9
%sysusers_create_compat %{SOURCE2} systemd-sysusers --replace=/usr/lib/sysusers.d/pcp.conf - < %{SOURCE2}
%else %else
getent group pcp >/dev/null || groupadd -r pcp getent group pcp >/dev/null || groupadd -r pcp
getent passwd pcp >/dev/null || \ getent passwd pcp >/dev/null || \
@ -2770,10 +2750,8 @@ exit 0
%{pmda_remove "$1" "perfevent"} %{pmda_remove "$1" "perfevent"}
%endif %endif
%if !%{disable_podman}
%preun pmda-podman %preun pmda-podman
%{pmda_remove "$1" "podman"} %{pmda_remove "$1" "podman"}
%endif
%if !%{disable_statsd} %if !%{disable_statsd}
%preun pmda-statsd %preun pmda-statsd
@ -3046,7 +3024,7 @@ for PMDA in dm nfsclient openmetrics ; do
fi fi
done done
# auto-enable these usually optional pmie rules # auto-enable these usually optional pmie rules
${run_pmieconf "$PCP_PMIECONFIG_DIR" dmthin} %{run_pmieconf "$PCP_PMIECONFIG_DIR" dmthin}
%if 0%{?rhel} %if 0%{?rhel}
%if !%{disable_systemd} %if !%{disable_systemd}
systemctl restart pmcd pmlogger pmie >/dev/null 2>&1 systemctl restart pmcd pmlogger pmie >/dev/null 2>&1
@ -3061,17 +3039,6 @@ ${run_pmieconf "$PCP_PMIECONFIG_DIR" dmthin}
%endif %endif
%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 %post
PCP_PMNS_DIR=%{_pmnsdir} PCP_PMNS_DIR=%{_pmnsdir}
PCP_LOG_DIR=%{_logsdir} PCP_LOG_DIR=%{_logsdir}
@ -3110,14 +3077,22 @@ PCP_LOG_DIR=%{_logsdir}
%endif %endif
%if !%{disable_selinux} %if !%{disable_selinux}
%preun selinux %pre selinux
%{selinux_handle_policy "$1" "pcpupstream"} %selinux_relabel_pre -s targeted
%triggerun selinux -- docker-selinux %post selinux
%{selinux_handle_policy "$1" "pcpupstream-docker"} PCP_SELINUX_DIR=%{_selinuxdir}
semodule -r pcpupstream-container >/dev/null 2>&1 || true
semodule -r pcpupstream-docker >/dev/null 2>&1 || true
semodule -r pcpupstream >/dev/null 2>&1 || true
%selinux_modules_install -s targeted "$PCP_SELINUX_DIR/pcp.pp.bz2"
%selinux_relabel_post -s targeted
%triggerun selinux -- container-selinux %postun selinux
%{selinux_handle_policy "$1" "pcpupstream-container"} if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s targeted pcp
%selinux_relabel_post -s targeted
fi
%endif %endif
%files -f pcp-files.rpm %files -f pcp-files.rpm
@ -3136,6 +3111,7 @@ PCP_LOG_DIR=%{_logsdir}
%if !%{disable_selinux} %if !%{disable_selinux}
%files selinux -f pcp-selinux-files.rpm %files selinux -f pcp-selinux-files.rpm
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/targeted/active/modules/200/pcp
%endif %endif
%if !%{disable_qt} %if !%{disable_qt}
@ -3148,9 +3124,7 @@ PCP_LOG_DIR=%{_logsdir}
%files pmda-infiniband -f pcp-pmda-infiniband-files.rpm %files pmda-infiniband -f pcp-pmda-infiniband-files.rpm
%endif %endif
%if !%{disable_podman}
%files pmda-podman -f pcp-pmda-podman-files.rpm %files pmda-podman -f pcp-pmda-podman-files.rpm
%endif
%if !%{disable_statsd} %if !%{disable_statsd}
%files pmda-statsd -f pcp-pmda-statsd-files.rpm %files pmda-statsd -f pcp-pmda-statsd-files.rpm
@ -3398,6 +3372,11 @@ PCP_LOG_DIR=%{_logsdir}
%files zeroconf -f pcp-zeroconf-files.rpm %files zeroconf -f pcp-zeroconf-files.rpm
%changelog %changelog
* Thu Oct 27 2022 Nathan Scott <nathans@redhat.com> - 6.0.1-1
- Convert to independent selinux policy (BZs 1941873, 2127037)
- Improve pmproxy REST API timeout handling (BZ 2130208)
- Rebase to latest stable version of PCP (BZ 2117074)
* Mon Sep 26 2022 Nathan Scott <nathans@redhat.com> - 6.0.0-1 * Mon Sep 26 2022 Nathan Scott <nathans@redhat.com> - 6.0.0-1
- Support --top* options in the pcp-dstat(1) utility (BZ 2020988) - Support --top* options in the pcp-dstat(1) utility (BZ 2020988)
- Performance improvements, fixes in pmseries --load (BZ 2027430) - Performance improvements, fixes in pmseries --load (BZ 2027430)

View File

@ -1,102 +0,0 @@
diff -Naurp pcp-6.0.0.orig/configure pcp-6.0.0/configure
--- pcp-6.0.0.orig/configure 2022-08-25 10:52:14.000000000 +1000
+++ pcp-6.0.0/configure 2022-09-27 13:05:59.960815679 +1000
@@ -1099,6 +1099,7 @@ with_pmdabpf_bpftool
with_pmdabpf_btf
with_pmdabpftrace
with_pmdajson
+with_pmdamongodb
with_pmdanutcracker
with_pmdasnmp
with_selinux
@@ -1849,6 +1850,7 @@ Optional Packages:
vendored kernel type information)
--with-pmdabpftrace enable bpftrace pmda (default is on)
--with-pmdajson enable JSON pmda (default is on)
+ --with-pmdamongodb enable MongoDB pmda (default is on)
--with-pmdanutcracker enable nutcracker pmda (default is on)
--with-pmdasnmp enable SNMP pmda (default is on)
--with-selinux enable building of selinux package (default is on)
@@ -3679,6 +3681,16 @@ fi
+# Check whether --with-pmdamongodb was given.
+if test ${with_pmdamongodb+y}
+then :
+ withval=$with_pmdamongodb; do_pmdamongodb=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdamongodb=$withval"
+else $as_nop
+ do_pmdamongodb=check
+fi
+
+
+
# Check whether --with-pmdanutcracker was given.
if test ${with_pmdanutcracker+y}
then :
@@ -9533,12 +9545,21 @@ printf "%s\n" "no" >&6; }; fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the mongodb PMDA should be included" >&5
printf %s "checking if the mongodb PMDA should be included... " >&6; }
pmda_mongodb=false
-if test "$have_python" = true
-then
- if $pcp_python_prog -c "import pymongo" >/dev/null 2>&1
+if test "x$do_pmdamongodb" = "xyes"
+then :
+ pmda_mongodb=true
+fi
+if test "x$do_pmdamongodb" = "xcheck"
+then :
+
+ if test "$have_python" = true
then
- pmda_mongodb=true
+ if $pcp_python_prog -c "import pymongo" >/dev/null 2>&1
+ then
+ pmda_mongodb=true
+ fi
fi
+
fi
PMDA_MONGODB=$pmda_mongodb
diff -Naurp pcp-6.0.0.orig/configure.ac pcp-6.0.0/configure.ac
--- pcp-6.0.0.orig/configure.ac 2022-08-25 10:52:14.000000000 +1000
+++ pcp-6.0.0/configure.ac 2022-09-27 13:05:59.961815662 +1000
@@ -195,6 +195,12 @@ AC_ARG_WITH([pmdajson],
[do_pmdajson=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdajson=$withval"],
[do_pmdajson=check])
+AC_ARG_WITH([pmdamongodb],
+ [AC_HELP_STRING([--with-pmdamongodb],
+ [enable MongoDB pmda (default is on)])],
+ [do_pmdamongodb=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-pmdamongodb=$withval"],
+ [do_pmdamongodb=check])
+
AC_ARG_WITH([pmdanutcracker],
[AC_HELP_STRING([--with-pmdanutcracker],
[enable nutcracker pmda (default is on)])],
@@ -1375,14 +1381,17 @@ if $pmda_mysql; then AC_MSG_RESULT(yes);
AC_MSG_CHECKING([if the mongodb PMDA should be included])
pmda_mongodb=false
-if test "$have_python" = true
-then
- dnl rpm build for mongodb PMDA needs python pymongo module
- if $pcp_python_prog -c "import pymongo" >/dev/null 2>&1
+AS_IF([test "x$do_pmdamongodb" = "xyes"], [pmda_mongodb=true])
+AS_IF([test "x$do_pmdamongodb" = "xcheck"], [
+ if test "$have_python" = true
then
- pmda_mongodb=true
+ dnl rpm build for mongodb PMDA needs python pymongo module
+ if $pcp_python_prog -c "import pymongo" >/dev/null 2>&1
+ then
+ pmda_mongodb=true
+ fi
fi
-fi
+])
AC_SUBST(PMDA_MONGODB, $pmda_mongodb)
if $pmda_mongodb; then AC_MSG_RESULT(yes); else AC_MSG_RESULT(no); fi

View File

@ -1,293 +0,0 @@
commit c8ddf5260225d66d15a56d63a192d717bdc247ae
Author: Nathan Scott <nathans@redhat.com>
Date: Tue Sep 27 11:23:10 2022 +1000
pmdastatsd: update canned output for platforms without ragel
Fixes a build failure on RHEL where ragel(1) is unavailable.
diff --git a/src/pmdas/statsd/src/GNUmakefile b/src/pmdas/statsd/src/GNUmakefile
index 1567fe273d..e22b70508a 100644
--- a/src/pmdas/statsd/src/GNUmakefile
+++ b/src/pmdas/statsd/src/GNUmakefile
@@ -77,7 +77,7 @@ $(RAGELTARGET).o: $(RFILES)
$(RFILES): $(RAGELTARGET).rl
ifeq "$(RAGEL)" ""
- @# for systems without ragel (RHEL/Centos)
+ @# for systems without ragel (RHEL)
@rm -f $@
$(LN_S) $@.in $@
else
diff --git a/src/pmdas/statsd/src/parser-ragel.c.in b/src/pmdas/statsd/src/parser-ragel.c.in
index 68a6e40f4b..9e75881ccb 100644
--- a/src/pmdas/statsd/src/parser-ragel.c.in
+++ b/src/pmdas/statsd/src/parser-ragel.c.in
@@ -23,7 +23,7 @@
#include "utils.h"
-#line 27 "parser-ragel.c"
+#line 25 "parser-ragel.c"
static const signed char _statsd_actions[] = {
0, 1, 0, 1, 2, 1, 3, 1,
4, 1, 6, 1, 7, 1, 8, 2,
@@ -169,9 +169,8 @@ static const int statsd_en_main = 1;
*/
int
ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
- *datagram = (struct statsd_datagram*) malloc(sizeof(struct statsd_datagram));
- *(*datagram) = (struct statsd_datagram) {0};
- ALLOC_CHECK("Not enough memory to save datagram");
+ *datagram = (struct statsd_datagram*) calloc(1, sizeof(struct statsd_datagram));
+ ALLOC_CHECK(*datagram, "Not enough memory to save datagram");
size_t length = strlen(str);
char *p = str, *pe = (str + length + 1);
char *eof = pe;
@@ -185,13 +184,13 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
int tag_value_allocated = 0;
int any_tags = 0;
-
-#line 190 "parser-ragel.c"
+
+#line 184 "parser-ragel.c"
{
cs = (int)statsd_start;
}
-
-#line 195 "parser-ragel.c"
+
+#line 187 "parser-ragel.c"
{
int _klen;
unsigned int _trans = 0;
@@ -270,45 +269,45 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
switch ( (*( _acts)) )
{
case 0: {
- {
-#line 57 "parser-ragel.rl"
+ {
+#line 56 "parser-ragel.rl"
goto error_clean_up;
}
-#line 280 "parser-ragel.c"
-
+#line 271 "parser-ragel.c"
+
break;
}
case 1: {
- {
-#line 61 "parser-ragel.rl"
+ {
+#line 60 "parser-ragel.rl"
goto error_clean_up;
}
-#line 291 "parser-ragel.c"
-
+#line 281 "parser-ragel.c"
+
break;
}
case 3: {
- {
-#line 69 "parser-ragel.rl"
+ {
+#line 68 "parser-ragel.rl"
current_segment_start_index = current_index;
}
-#line 302 "parser-ragel.c"
-
+#line 291 "parser-ragel.c"
+
break;
}
case 4: {
- {
-#line 73 "parser-ragel.rl"
+ {
+#line 72 "parser-ragel.rl"
size_t current_segment_length = current_index - current_segment_start_index;
(*datagram)->name = (char*) malloc(current_segment_length + 1);
- ALLOC_CHECK("Not enough memory to save metric name");
+ ALLOC_CHECK((*datagram)->name, "Not enough memory to save metric name");
memcpy(
(*datagram)->name,
&str[current_segment_start_index],
@@ -318,27 +317,27 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
current_segment_start_index = current_index + 1;
}
-#line 322 "parser-ragel.c"
-
+#line 310 "parser-ragel.c"
+
break;
}
case 5: {
- {
-#line 86 "parser-ragel.rl"
+ {
+#line 85 "parser-ragel.rl"
size_t key_len = strlen(tag_key) + 1;
size_t value_len = strlen(tag_value) + 1;
struct tag* t = (struct tag*) malloc(sizeof(struct tag));
- ALLOC_CHECK("Unable to allocate memory for tag.");
+ ALLOC_CHECK(t, "Unable to allocate memory for tag.");
t->key = (char*) malloc(key_len);
- ALLOC_CHECK("Unable to allocate memory for tag key.");
+ ALLOC_CHECK(t->key, "Unable to allocate memory for tag key.");
memcpy(t->key, tag_key, key_len);
t->value = (char*) malloc(value_len);
- ALLOC_CHECK("Unable to allocate memory for tag value.");
+ ALLOC_CHECK(t->value, "Unable to allocate memory for tag value.");
memcpy(t->value, tag_value, value_len);
if (!any_tags) {
tags = (struct tag_collection*) malloc(sizeof(struct tag_collection));
- ALLOC_CHECK("Unable to allocate memory for tag collection.");
+ ALLOC_CHECK(tags, "Unable to allocate memory for tag collection.");
tags->values = (struct tag**) malloc(sizeof(struct tag*));
tags->values[0] = t;
tags->length = 1;
@@ -346,7 +345,7 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
} else {
struct tag** new_tags =
(struct tag**) realloc(tags->values, sizeof(struct tag*) * (tags->length + 1));
- ALLOC_CHECK("Unable to allocate memory for tags");
+ ALLOC_CHECK(new_tags, "Unable to allocate memory for tags");
if (tags != NULL) {
tags->values = new_tags;
tags->values[tags->length] = t;
@@ -361,13 +360,13 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
tag_value_allocated = 0;
}
-#line 365 "parser-ragel.c"
-
+#line 352 "parser-ragel.c"
+
break;
}
case 6: {
- {
-#line 122 "parser-ragel.rl"
+ {
+#line 121 "parser-ragel.rl"
char* startptr;
char* endptr;
@@ -389,13 +388,13 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
current_segment_start_index = current_index + 1;
}
-#line 393 "parser-ragel.c"
-
+#line 379 "parser-ragel.c"
+
break;
}
case 7: {
- {
-#line 143 "parser-ragel.rl"
+ {
+#line 142 "parser-ragel.rl"
if (str[current_segment_start_index] == 'c') {
(*datagram)->type = METRIC_TYPE_COUNTER;
@@ -407,17 +406,17 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
current_segment_start_index = current_index + 1;
}
-#line 411 "parser-ragel.c"
-
+#line 396 "parser-ragel.c"
+
break;
}
case 8: {
- {
-#line 154 "parser-ragel.rl"
+ {
+#line 153 "parser-ragel.rl"
size_t current_segment_length = current_index - current_segment_start_index;
tag_key = (char *) realloc(tag_key, current_segment_length + 1);
- ALLOC_CHECK("Not enough memory for tag key buffer.");
+ ALLOC_CHECK(tag_key, "Not enough memory for tag key buffer.");
tag_key_allocated = 1;
memcpy(
tag_key,
@@ -428,17 +427,17 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
current_segment_start_index = current_index + 1;
}
-#line 432 "parser-ragel.c"
-
+#line 416 "parser-ragel.c"
+
break;
}
case 9: {
- {
-#line 168 "parser-ragel.rl"
+ {
+#line 167 "parser-ragel.rl"
size_t current_segment_length = current_index - current_segment_start_index;
tag_value = (char *) realloc(tag_value, current_segment_length + 1);
- ALLOC_CHECK("Not enough memory for tag key buffer.");
+ ALLOC_CHECK(tag_value, "Not enough memory for tag key buffer.");
tag_value_allocated = 1;
memcpy(
tag_value,
@@ -449,8 +448,8 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
current_segment_start_index = current_index + 1;
}
-#line 453 "parser-ragel.c"
-
+#line 436 "parser-ragel.c"
+
break;
}
}
@@ -471,14 +470,14 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
while ( _nacts > 0 ) {
switch ( (*( _acts)) ) {
case 2: {
- {
-#line 65 "parser-ragel.rl"
+ {
+#line 64 "parser-ragel.rl"
current_index++;
}
-#line 481 "parser-ragel.c"
-
+#line 463 "parser-ragel.c"
+
break;
}
}
@@ -494,8 +493,8 @@ ragel_parser_parse(char* str, struct statsd_datagram** datagram) {
_out: {}
}
-#line 196 "parser-ragel.rl"
-
+#line 195 "parser-ragel.rl"
+
(void)statsd_en_main;
(void)statsd_error;
(void)statsd_first_final;

View File

@ -1,3 +1,3 @@
SHA512 (pcp-6.0.0.src.tar.gz) = 339eb0d3244aa170934ce208c978abd723faf4076848bcf0ed7c5fda99a353d7b8f11a326a1a8c6429bd8460541d0a2a6e2fac9c4bc7ebbce632aeeab0f6deee SHA512 (pcp-6.0.1.src.tar.gz) = 922b787a2f28aab6355cb701500890ae83ee93b55047b65f142f9767619b2fbf91abe555106f9aa3f52f851fdb0413a92582dcf8f4dbb49894c2a557e80da5fd
SHA512 (pcp-testsuite.sysusers) = ee1eec784356eb5e3b6c49645fcf4f49d4d73cabbe6d4fb6745af2979809c25762248daf4d82bb3b11a9442e87bf50afa277116a90cfd50ea83c5bb4f29a25ab SHA512 (pcp-testsuite.sysusers) = ee1eec784356eb5e3b6c49645fcf4f49d4d73cabbe6d4fb6745af2979809c25762248daf4d82bb3b11a9442e87bf50afa277116a90cfd50ea83c5bb4f29a25ab
SHA512 (pcp.sysusers) = c944a80d7ec00635a1e582cce0eeb20f38641179c6539e481f4822fae30caefa4d9462fd61f517364ea1cd37d36bf1828b6540a8a2a948e70151be022321c10d SHA512 (pcp.sysusers) = c944a80d7ec00635a1e582cce0eeb20f38641179c6539e481f4822fae30caefa4d9462fd61f517364ea1cd37d36bf1828b6540a8a2a948e70151be022321c10d