Rebase to pcp-6.2.0-1 with latest upstream fixes and features

Resolves: RHEL-2317
This commit is contained in:
Nathan Scott 2024-02-12 04:14:05 +11:00
parent 1e8da71c53
commit 2f0b5967c9
5 changed files with 71 additions and 497 deletions

View File

@ -1,14 +1,13 @@
Name: pcp Name: pcp
Version: 6.1.1 Version: 6.2.0
Release: 4%{?dist} Release: 1%{?dist}
Summary: System-level performance monitoring and performance management Summary: System-level performance monitoring and performance management
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0 License: GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
URL: https://pcp.io URL: https://pcp.io
Source0: https://github.com/performancecopilot/pcp/releases/pcp-%{version}.src.tar.gz Source0: https://github.com/performancecopilot/pcp/releases/pcp-%{version}.src.tar.gz
Patch1: redhat-issues-RHEL-17335-ss-listen.patch Patch1: redhat-issues-RHEL-2317-default-archive-version.patch
Patch2: redhat-issues-RHEL-17649-ss-udp.patch
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 %if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
ExcludeArch: %{ix86} ExcludeArch: %{ix86}
@ -207,6 +206,17 @@ ExcludeArch: %{ix86}
%global disable_noarch 1 %global disable_noarch 1
%endif %endif
# build pcp2arrow whenever possible (no RHEL or 32 bit x86 Fedora python3-arrow)
%if 0%{?fedora} >= 36
%ifarch %{ix86} x86_64
%global disable_arrow 1
%else
%global disable_arrow 0
%endif
%else
%global disable_arrow 1
%endif
%if 0%{?fedora} >= 24 %if 0%{?fedora} >= 24
%global disable_xlsx 0 %global disable_xlsx 0
%else %else
@ -874,6 +884,30 @@ Performance Co-Pilot (PCP) front-end tools for exporting metric values
in JSON format to Apache Spark. See https://spark.apache.org/ for in JSON format to Apache Spark. See https://spark.apache.org/ for
further details on Apache Spark. further details on Apache Spark.
#
# pcp-export-pcp2arrow
#
%if !%{disable_arrow}
%package export-pcp2arrow
License: GPL-2.0-or-later
Summary: Performance Co-Pilot tools for exporting PCP metrics to Apache Arrow
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if !%{disable_python3}
Requires: python3-pcp = %{version}-%{release}
Requires: python3-pyarrow
BuildRequires: python3-pyarrow
%else
Requires: %{__python2}-pcp = %{version}-%{release}
Requires: %{__python2}-pyarrow
BuildRequires: %{__python2}-pyarrow
%endif
%description export-pcp2arrow
Performance Co-Pilot (PCP) front-end tool for exporting metric values
to Apache Arrow, which supports the columnar parquet data format.
%endif
# #
# pcp-export-pcp2xlsx # pcp-export-pcp2xlsx
# #
@ -897,6 +931,7 @@ BuildRequires: %{__python2}-openpyxl
Performance Co-Pilot (PCP) front-end tools for exporting metric values Performance Co-Pilot (PCP) front-end tools for exporting metric values
in Excel spreadsheet format. in Excel spreadsheet format.
%endif %endif
# #
# pcp-export-pcp2xml # pcp-export-pcp2xml
# #
@ -1064,7 +1099,7 @@ Summary: Performance Co-Pilot (PCP) metrics for NutCracker (TwemCache)
URL: https://pcp.io URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
Requires: perl-PCP-PMDA = %{version}-%{release} Requires: perl-PCP-PMDA = %{version}-%{release}
Requires: perl(YAML::XS::LibYAML) Requires: perl(YAML::XS)
Requires: perl(JSON) Requires: perl(JSON)
%description pmda-nutcracker %description pmda-nutcracker
@ -1505,7 +1540,7 @@ Summary: Performance Co-Pilot (PCP) metrics from eBPF ELF modules
URL: https://pcp.io URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release} Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
Requires: libbpf Requires: libbpf
BuildRequires: libbpf-devel clang llvm bpftool BuildRequires: libbpf-devel clang llvm
%description pmda-bpf %description pmda-bpf
This package contains the PCP Performance Metrics Domain Agent (PMDA) for This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from eBPF ELF modules. extracting performance metrics from eBPF ELF modules.
@ -2468,7 +2503,7 @@ sed -i -e 's/usr\/lib\//usr\/lib64\//' pcp-libs-devel-files
# some special cases for devel # some special cases for devel
awk '{print $NF}' $DIST_MANIFEST |\ 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 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). # Patterns for files to be marked %%config(noreplace).
# Note: /etc/pcp.{conf,env,sh} are %%config but not noreplace # Note: /etc/pcp.{conf,env,sh} are %%config but not noreplace
@ -2520,6 +2555,7 @@ basic_manifest | keep 'sheet2pcp' >pcp-import-sheet2pcp-files
basic_manifest | keep 'mrtg2pcp' >pcp-import-mrtg2pcp-files basic_manifest | keep 'mrtg2pcp' >pcp-import-mrtg2pcp-files
basic_manifest | keep 'ganglia2pcp' >pcp-import-ganglia2pcp-files basic_manifest | keep 'ganglia2pcp' >pcp-import-ganglia2pcp-files
basic_manifest | keep 'collectl2pcp' >pcp-import-collectl2pcp-files basic_manifest | keep 'collectl2pcp' >pcp-import-collectl2pcp-files
basic_manifest | keep 'pcp2arrow' >pcp-export-pcp2arrow-files
basic_manifest | keep 'pcp2elasticsearch' >pcp-export-pcp2elasticsearch-files basic_manifest | keep 'pcp2elasticsearch' >pcp-export-pcp2elasticsearch-files
basic_manifest | keep 'pcp2influxdb' >pcp-export-pcp2influxdb-files basic_manifest | keep 'pcp2influxdb' >pcp-export-pcp2influxdb-files
basic_manifest | keep 'pcp2xlsx' >pcp-export-pcp2xlsx-files basic_manifest | keep 'pcp2xlsx' >pcp-export-pcp2xlsx-files
@ -2642,7 +2678,7 @@ do \
done done
for export_package in \ for export_package in \
pcp2elasticsearch pcp2graphite pcp2influxdb pcp2json \ pcp2arrow pcp2elasticsearch pcp2graphite pcp2influxdb pcp2json \
pcp2spark pcp2xlsx pcp2xml pcp2zabbix zabbix-agent ; \ pcp2spark pcp2xlsx pcp2xml pcp2zabbix zabbix-agent ; \
do \ do \
export_packages="$export_packages pcp-export-$export_package"; \ export_packages="$export_packages pcp-export-$export_package"; \
@ -2777,8 +2813,8 @@ semodule -r pcpqa >/dev/null 2>&1 || true
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}
systemctl restart pmcd pmlogger >/dev/null 2>&1 systemctl restart pcp-reboot-init pmcd pmlogger >/dev/null 2>&1
systemctl enable pmcd pmlogger >/dev/null 2>&1 systemctl enable pcp-reboot-init pmcd pmlogger >/dev/null 2>&1
%else %else
/sbin/chkconfig --add pmcd >/dev/null 2>&1 /sbin/chkconfig --add pmcd >/dev/null 2>&1
/sbin/chkconfig --add pmlogger >/dev/null 2>&1 /sbin/chkconfig --add pmlogger >/dev/null 2>&1
@ -3063,9 +3099,9 @@ if [ "$1" -eq 0 ]
then then
# stop daemons before erasing the package # stop daemons before erasing the package
%if !%{disable_systemd} %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 %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 pcp-reboot-init.service
systemctl stop pmlogger.service pmie.service pmproxy.service pmfind.service pmcd.service >/dev/null 2>&1 systemctl stop pmlogger.service pmie.service pmproxy.service pmfind.service pmcd.service pcp-reboot-init.service >/dev/null 2>&1
%else %else
/sbin/service pmlogger stop >/dev/null 2>&1 /sbin/service pmlogger stop >/dev/null 2>&1
/sbin/service pmie stop >/dev/null 2>&1 /sbin/service pmie stop >/dev/null 2>&1
@ -3097,10 +3133,10 @@ for PMDA in dm nfsclient openmetrics ; do
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} <= 9
%if !%{disable_systemd} %if !%{disable_systemd}
systemctl restart pmcd pmlogger pmie >/dev/null 2>&1 systemctl restart pcp-reboot-init pmcd pmlogger pmie >/dev/null 2>&1
systemctl enable pmcd pmlogger pmie >/dev/null 2>&1 systemctl enable pcp-reboot-init pmcd pmlogger pmie >/dev/null 2>&1
%else %else
/sbin/chkconfig --add pmcd >/dev/null 2>&1 /sbin/chkconfig --add pmcd >/dev/null 2>&1
/sbin/chkconfig --add pmlogger >/dev/null 2>&1 /sbin/chkconfig --add pmlogger >/dev/null 2>&1
@ -3350,6 +3386,10 @@ fi
%files export-pcp2influxdb -f pcp-export-pcp2influxdb-files.rpm %files export-pcp2influxdb -f pcp-export-pcp2influxdb-files.rpm
%endif %endif
%if !%{disable_arrow}
%files export-pcp2arrow -f pcp-export-pcp2arrow-files.rpm
%endif
%if !%{disable_xlsx} %if !%{disable_xlsx}
%files export-pcp2xlsx -f pcp-export-pcp2xlsx-files.rpm %files export-pcp2xlsx -f pcp-export-pcp2xlsx-files.rpm
%endif %endif
@ -3452,6 +3492,9 @@ fi
%files zeroconf -f pcp-zeroconf-files.rpm %files zeroconf -f pcp-zeroconf-files.rpm
%changelog %changelog
* Mon Feb 12 2024 Nathan Scott <nathans@redhat.com> - 6.2.0-1
- Rebase to latest stable version of PCP (RHEL-2317)
* Thu Dec 14 2023 Nathan Scott <nathans@redhat.com> - 6.1.1-4 * Thu Dec 14 2023 Nathan Scott <nathans@redhat.com> - 6.1.1-4
- Fix pcp-ss(1) handling of UDP packet states (RHEL-17649) - Fix pcp-ss(1) handling of UDP packet states (RHEL-17649)

View File

@ -1,186 +0,0 @@
diff -Naurp pcp-6.1.1.orig/qa/1921 pcp-6.1.1/qa/1921
--- pcp-6.1.1.orig/qa/1921 1970-01-01 10:00:00.000000000 +1000
+++ pcp-6.1.1/qa/1921 2023-11-29 14:21:22.969455810 +1100
@@ -0,0 +1,82 @@
+#!/bin/sh
+# PCP QA Test No. 1921
+# Exercise default option handling for pcp-ss(1).
+#
+# Copyright (c) 2023 Red Hat. All Rights Reserved.
+#
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+# get standard environment, filters and checks
+. ./common.product
+. ./common.filter
+. ./common.check
+
+[ $PCP_PLATFORM = linux ] || _notrun "Linux-specific sockets testing"
+[ -f $PCP_BINADM_DIR/pcp-ss ] || _notrun "pcp-ss utility is not installed"
+[ -f $PCP_PMDAS_DIR/sockets/pmdasockets ] || _notrun "sockets PMDA not installed"
+
+_cleanup()
+{
+ cd $here
+ $sudo rm -rf $tmp $tmp.*
+}
+
+status=0 # success is the default!
+$sudo rm -rf $tmp $tmp.* $seq.full
+
+pmdasockets_install()
+{
+ # start from known starting points
+ cd $PCP_PMDAS_DIR/sockets
+ $sudo ./Remove >/dev/null 2>&1
+
+ echo
+ echo "=== sockets agent installation ==="
+ $sudo ./Install </dev/null >$tmp.out 2>&1
+ cat $tmp.out >>$here/$seq.full
+ # Check sockets metrics have appeared ... X metrics and Y values
+ _filter_pmda_install <$tmp.out \
+ | sed \
+ -e 's/[0-9][0-9]* warnings, //' \
+ | $PCP_AWK_PROG '
+/Check network.persocket metrics have appeared/ {
+ if ($7 >= 50 && $7 <= 99) $7 = "X"
+ if ($10 >= 0) $10 = "Y"
+ }
+ { print }'
+}
+
+pmdasockets_remove()
+{
+ echo
+ echo "=== remove sockets agent ==="
+ $sudo ./Remove >$tmp.out 2>&1
+ _filter_pmda_remove <$tmp.out
+}
+
+# real QA test starts here
+_prepare_pmda sockets
+trap "_cleanup_pmda sockets; exit \$status" 0 1 2 3 15
+_stop_auto_restart pmcd
+
+pmdasockets_install
+echo
+
+pcp ss > $tmp.out 2>&1
+if grep -q LISTEN $tmp.out # do not show LISTEN state by default
+then
+ echo Failed LISTEN check
+ cat $tmp.out
+ status=1
+ exit
+else
+ echo Passed LISTEN check
+ cat $tmp.out >> $here/$seq.full
+fi
+
+pmdasockets_remove
+
+# success, all done
+exit
diff -Naurp pcp-6.1.1.orig/qa/1921.out pcp-6.1.1/qa/1921.out
--- pcp-6.1.1.orig/qa/1921.out 1970-01-01 10:00:00.000000000 +1000
+++ pcp-6.1.1/qa/1921.out 2023-11-29 14:21:22.969455810 +1100
@@ -0,0 +1,17 @@
+QA output created by 1921
+
+=== sockets agent installation ===
+Updating the Performance Metrics Name Space (PMNS) ...
+Terminate PMDA if already installed ...
+[...install files, make output...]
+Updating the PMCD control file, and notifying PMCD ...
+Check network.persocket metrics have appeared ... X metrics and Y values
+
+Passed LISTEN check
+
+=== remove sockets agent ===
+Culling the Performance Metrics Name Space ...
+network.persocket ... done
+Updating the PMCD control file, and notifying PMCD ...
+[...removing files...]
+Check network.persocket metrics have gone away ... OK
diff -Naurp pcp-6.1.1.orig/qa/group pcp-6.1.1/qa/group
--- pcp-6.1.1.orig/qa/group 2023-11-29 14:21:04.266425958 +1100
+++ pcp-6.1.1/qa/group 2023-11-29 14:21:22.978455824 +1100
@@ -2090,6 +2090,7 @@ x11
1912 pmie local
1913 pmie local valgrind
1914 atop local
+1921 pmda.sockets local
1927 pmda.sockets local
1931 pmda.bpf local
1936 other local pmclient
diff -Naurp pcp-6.1.1.orig/src/pcp/ss/pcp-ss.1 pcp-6.1.1/src/pcp/ss/pcp-ss.1
--- pcp-6.1.1.orig/src/pcp/ss/pcp-ss.1 2023-11-29 14:21:04.266425958 +1100
+++ pcp-6.1.1/src/pcp/ss/pcp-ss.1 2023-11-29 14:21:22.978455824 +1100
@@ -168,10 +168,10 @@ show help message and exit
output version information
.TP 5
\fB\-n\fP, \fB\-\-numeric\fP
-don't resolve service names
+don't resolve service names (currently always set)
.TP 5
\fB\-r\fP, \fB\-\-resolve\fP
-resolve host names
+resolve host names (not yet implemented)
.TP 5
\fB\-a\fP, \fB\-\-all\fP
display all sockets
diff -Naurp pcp-6.1.1.orig/src/pcp/ss/pcp-ss.py pcp-6.1.1/src/pcp/ss/pcp-ss.py
--- pcp-6.1.1.orig/src/pcp/ss/pcp-ss.py 2023-11-29 14:21:04.267425959 +1100
+++ pcp-6.1.1/src/pcp/ss/pcp-ss.py 2023-11-29 14:21:22.979455826 +1100
@@ -25,9 +25,6 @@ from pcp import pmapi
from cpmapi import PM_CONTEXT_ARCHIVE, PM_CONTEXT_HOST
from cpmapi import PM_ERR_EOL, PM_MODE_INTERP
-if sys.version >= '3':
- long = int
-
# pmns prefix for pmdasockets(1) metrics
pmns = "network.persocket"
@@ -57,8 +54,8 @@ class SS(object):
p.add_argument('-V', '--version', action='store_true', help='output version information')
p.add_argument('-n', '--numeric', action='store_true', help='don\'t resolve service names or port names (currently always set)')
p.add_argument('-r', '--resolve', action='store_true', help='resolve host names (currently never set)')
- p.add_argument('-a', '--all', action='store_true', help='display sockets in any state, not just listening')
- p.add_argument('-l', '--listening', action='store_true', help='display only listening sockets')
+ p.add_argument('-a', '--all', action='store_true', help='display both listening and non-listening states')
+ p.add_argument('-l', '--listening', action='store_true', default=False, help='display only listening sockets')
p.add_argument('-o', '--options', action='store_true', help='show timer information')
p.add_argument('-e', '--extended', action='store_true', help='show detailed socket information')
p.add_argument('-m', '--memory', action='store_true', help='show socket memory usage')
@@ -92,9 +89,6 @@ class SS(object):
# default to both ipv4 and ipv6, subject to the prevailing filter
args.ipv4 = args.ipv6 = True
- if args.all:
- args.listening = True
-
if args.events or args.context or args.contexts or args.net or args.summary or args.processes:
print("Warning: --events, --context --net, --summary and --processes options are not implemented")
@@ -283,13 +277,16 @@ class SS(object):
return ret
def filter_listening(self, inst):
- """ filter on tcp state, return True if socket is listening """
+ """ filter on tcp socket listening state """
if self.args.all:
return True
state = self.valuesD["state"][inst]
if self.args.listening:
if state != "LISTEN":
return False
+ else:
+ if state == "LISTEN":
+ return False
return True
def report(self):

View File

@ -1,295 +0,0 @@
commit 885ce6abd66040cb78e985013242b43e7dd5ca14
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Dec 8 11:29:25 2023 +1100
pcp-ss: fix the UDP UNCONN vs LISTEN state handling
Resolves Red Hat issue RHEL-17649
diff --git a/qa/1921 b/qa/1921
index e65dc369d..94c7a7383 100755
--- a/qa/1921
+++ b/qa/1921
@@ -76,6 +76,18 @@ else
cat $tmp.out >> $here/$seq.full
fi
+pcp ss -u > $tmp.out 2>&1
+if grep -q UNCONN $tmp.out # do not show UNCONN state by default in UDP mode
+then
+ echo Failed UDP UNCONN check
+ cat $tmp.out
+ status=1
+ exit
+else
+ echo Passed UDP UNCONN check
+ cat $tmp.out >> $here/$seq.full
+fi
+
pmdasockets_remove
# success, all done
diff --git a/qa/1921.out b/qa/1921.out
index 2331de828..0f4f815fc 100644
--- a/qa/1921.out
+++ b/qa/1921.out
@@ -8,6 +8,7 @@ Updating the PMCD control file, and notifying PMCD ...
Check network.persocket metrics have appeared ... X metrics and Y values
Passed LISTEN check
+Passed UDP UNCONN check
=== remove sockets agent ===
Culling the Performance Metrics Name Space ...
diff --git a/src/pcp/ss/pcp-ss.py b/src/pcp/ss/pcp-ss.py
index 91bb81a97..72e0607c1 100755
--- a/src/pcp/ss/pcp-ss.py
+++ b/src/pcp/ss/pcp-ss.py
@@ -254,7 +254,8 @@ class SS(object):
if self.args.tcp and netid == "tcp":
ret = True
elif self.args.udp and netid == "udp":
- ret = True
+ state = self.valuesD["state"][inst]
+ ret = bool(state != "UNCONN" or self.args.listening)
elif self.args.unix and netid == "unix":
ret = True
elif self.args.raw and netid == "raw":
@@ -282,6 +283,9 @@ class SS(object):
return True
state = self.valuesD["state"][inst]
if self.args.listening:
+ netid = self.valuesD["netid"][inst]
+ if state == "UNCONN" and netid == 'udp':
+ return True
if state != "LISTEN":
return False
else:
commit 2b184367378a1a69a48da09e284256ed874ffac2
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Dec 8 11:43:24 2023 +1100
docs: do not document (nor accept) unimplemented pcp-ss options
Related to Red Hat issue RHEL-17334
diff --git a/src/pcp/ss/pcp-ss.1 b/src/pcp/ss/pcp-ss.1
index 9598fa8d8..69caf35ea 100644
--- a/src/pcp/ss/pcp-ss.1
+++ b/src/pcp/ss/pcp-ss.1
@@ -1,6 +1,6 @@
'\"macro stdmacro
.\"
-.\" Copyright (c) 2021 Red Hat.
+.\" Copyright (c) 2021,2023 Red Hat.
.\"
.\" 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
@@ -169,9 +169,9 @@ output version information
.TP 5
\fB\-n\fP, \fB\-\-numeric\fP
don't resolve service names (currently always set)
-.TP 5
-\fB\-r\fP, \fB\-\-resolve\fP
-resolve host names (not yet implemented)
+'\" .TP 5
+'\" \fB\-r\fP, \fB\-\-resolve\fP
+'\" resolve host names (not yet implemented)
.TP 5
\fB\-a\fP, \fB\-\-all\fP
display all sockets
@@ -187,60 +187,60 @@ show detailed socket information
.TP 5
\fB\-m\fP, \fB\-\-memory\fP
show socket memory usage
-.TP 5
-\fB\-p\fP, \fB\-\-processes\fP
-show process using socket
+'\" .TP 5
+'\" \fB\-p\fP, \fB\-\-processes\fP
+'\" show process using socket
.TP 5
\fB\-i\fP, \fB\-\-info\fP
show internal TCP information
-.TP 5
-\fB\-s\fP, \fB\-\-summary\fP
-show socket usage summary
-.TP 5
-\fB\-b\fP, \fB\-\-bpf\fP
-show bpf filter socket information
-.TP 5
-\fB\-E\fP, \fB\-\-events\fP
-continually display sockets as they are destroyed
-.TP 5
-\fB\-Z\fP, \fB\-\-context\fP
-display process SELinux security contexts
-.TP 5
-\fB\-z\fP, \fB\-\-contexts\fP
-display process and socket SELinux security contexts
-.TP 5
-\fB\-N\fP, \fB\-\-net\fP
-switch to the specified network namespace name
+'\" .TP 5
+'\" \fB\-s\fP, \fB\-\-summary\fP
+'\" show socket usage summary
+'\" .TP 5
+'\" \fB\-b\fP, \fB\-\-bpf\fP
+'\" show bpf filter socket information
+'\" .TP 5
+'\" \fB\-E\fP, \fB\-\-events\fP
+'\" continually display sockets as they are destroyed
+'\" .TP 5
+'\" \fB\-Z\fP, \fB\-\-context\fP
+'\" display process SELinux security contexts
+'\" .TP 5
+'\" \fB\-z\fP, \fB\-\-contexts\fP
+'\" display process and socket SELinux security contexts
+'\" .TP 5
+'\" \fB\-N\fP, \fB\-\-net\fP
+'\" switch to the specified network namespace name
.TP 5
\fB\-4\fP, \fB\-\-ipv4\fP
display only IP version 4 sockets
.TP 5
\fB\-6\fP, \fB\-\-ipv6\fP
display only IP version 6 sockets
-.TP 5
-\fB\-0\fP, \fB\-\-packet\fP
-display PACKET sockets
+'\" .TP 5
+'\" \fB\-0\fP, \fB\-\-packet\fP
+'\" display PACKET sockets
.TP 5
\fB\-t\fP, \fB\-\-tcp\fP
display only TCP sockets
-.TP 5
-\fB\-M\fP, \fB\-\-mptcp\fP
-display only MPTCP sockets
-.TP 5
-\fB\-S\fP, \fB\-\-sctp\fP
-display only SCTP sockets
+'\" .TP 5
+'\" \fB\-M\fP, \fB\-\-mptcp\fP
+'\" display only MPTCP sockets
+'\" .TP 5
+'\" \fB\-S\fP, \fB\-\-sctp\fP
+'\" display only SCTP sockets
.TP 5
\fB\-u\fP, \fB\-\-udp\fP
display only UDP sockets
-.TP 5
-\fB\-d\fP, \fB\-\-dccp\fP
-display only DCCP sockets
-.TP 5
-\fB\-w\fP, \fB\-\-raw\fP
-display only RAW sockets
-.TP 5
-\fB\-x\fP, \fB\-\-unix\fP
-display only Unix domain sockets
+'\" .TP 5
+'\" \fB\-d\fP, \fB\-\-dccp\fP
+'\" display only DCCP sockets
+'\" .TP 5
+'\" \fB\-w\fP, \fB\-\-raw\fP
+'\" display only RAW sockets
+'\" .TP 5
+'\" \fB\-x\fP, \fB\-\-unix\fP
+'\" display only Unix domain sockets
.TP 5
\fB\-H\fP, \fB\-\-noheader\fP
Suppress header line
diff --git a/src/pcp/ss/pcp-ss.py b/src/pcp/ss/pcp-ss.py
index 72e0607c1..74952911a 100755
--- a/src/pcp/ss/pcp-ss.py
+++ b/src/pcp/ss/pcp-ss.py
@@ -53,45 +53,42 @@ class SS(object):
p = argparse.ArgumentParser()
p.add_argument('-V', '--version', action='store_true', help='output version information')
p.add_argument('-n', '--numeric', action='store_true', help='don\'t resolve service names or port names (currently always set)')
- p.add_argument('-r', '--resolve', action='store_true', help='resolve host names (currently never set)')
+ #p.add_argument('-r', '--resolve', action='store_true', help='resolve host names (currently never set)')
p.add_argument('-a', '--all', action='store_true', help='display both listening and non-listening states')
p.add_argument('-l', '--listening', action='store_true', default=False, help='display only listening sockets')
p.add_argument('-o', '--options', action='store_true', help='show timer information')
p.add_argument('-e', '--extended', action='store_true', help='show detailed socket information')
p.add_argument('-m', '--memory', action='store_true', help='show socket memory usage')
- p.add_argument('-p', '--processes', action='store_true', help='show process using socket (not yet implemented)')
+ #p.add_argument('-p', '--processes', action='store_true', help='show process using socket (not yet implemented)')
p.add_argument('-i', '--info', action='store_true', help='show internal TCP information')
- p.add_argument('-s', '--summary', action='store_true', help='show socket usage summary (not yet implemented)')
- p.add_argument('-b', '--bpf', action='store_true', help='show bpf filter socket information (not yet implemented)')
- p.add_argument('-E', '--events', action='store_true', help='continually display sockets as they are destroyed (not implemented)')
- p.add_argument('-Z', '--context', action='store_true', help='display process SELinux security contexts (not implemented)')
- p.add_argument('-z', '--contexts', action='store_true', help='display process and socket SELinux security contexts (not implemented)')
- p.add_argument('-N', '--net', action='store_true', help='switch to the specified network namespace name (not implemented)')
+ #p.add_argument('-s', '--summary', action='store_true', help='show socket usage summary (not yet implemented)')
+ #p.add_argument('-b', '--bpf', action='store_true', help='show bpf filter socket information (not yet implemented)')
+ #p.add_argument('-E', '--events', action='store_true', help='continually display sockets as they are destroyed (not implemented)')
+ #p.add_argument('-Z', '--context', action='store_true', help='display process SELinux security contexts (not implemented)')
+ #p.add_argument('-z', '--contexts', action='store_true', help='display process and socket SELinux security contexts (not implemented)')
+ #p.add_argument('-N', '--net', action='store_true', help='switch to the specified network namespace name (not implemented)')
p.add_argument('-4', '--ipv4', action='store_true', help='display only IP version 4 sockets')
p.add_argument('-6', '--ipv6', action='store_true', help='display only IP version 6 sockets')
- p.add_argument('-0', '--packet', action='store_true', help='display PACKET sockets (not implemented)')
+ #p.add_argument('-0', '--packet', action='store_true', help='display PACKET sockets (not implemented)')
p.add_argument('-t', '--tcp', action='store_true', help='display only TCP sockets')
- p.add_argument('-M', '--mptcp', action='store_true', help='display only MPTCP sockets (not implemented)')
- p.add_argument('-S', '--sctp', action='store_true', help='display only SCTP sockets (not implemented)')
+ #p.add_argument('-M', '--mptcp', action='store_true', help='display only MPTCP sockets (not implemented)')
+ #p.add_argument('-S', '--sctp', action='store_true', help='display only SCTP sockets (not implemented)')
p.add_argument('-u', '--udp', action='store_true', help='display only UDP sockets')
- p.add_argument('-d', '--dccp', action='store_true', help='display only DCCP sockets (not implemented)')
- p.add_argument('-w', '--raw', action='store_true', help='display only RAW sockets (not implemented)')
- p.add_argument('-x', '--unix', action='store_true', help='display only Unix domain sockets (not implemented)')
+ #p.add_argument('-d', '--dccp', action='store_true', help='display only DCCP sockets (not implemented)')
+ #p.add_argument('-w', '--raw', action='store_true', help='display only RAW sockets (not implemented)')
+ #p.add_argument('-x', '--unix', action='store_true', help='display only Unix domain sockets (not implemented)')
p.add_argument('-H', '--noheader', action='store_true', help='Suppress header line')
p.add_argument('-O', '--oneline', action='store_true', help='print each socket\'s data on a single line')
args = p.parse_args()
# special cases
- if not (args.tcp or args.udp or args.mptcp or args.sctp or args.packet or args.dccp or args.raw or args.unix):
- args.tcp = args.udp = args.mptcp = args.sctp = args.packet = args.dccp = args.raw = args.unix = True
+ if not (args.tcp or args.udp): # or args.mptcp or args.sctp or args.packet or args.dccp or args.raw or args.unix):
+ args.tcp = args.udp = True # args.mptcp = args.sctp = args.packet = args.dccp = args.raw = args.unix = True
if not (args.ipv4 or args.ipv6):
# default to both ipv4 and ipv6, subject to the prevailing filter
args.ipv4 = args.ipv6 = True
- if args.events or args.context or args.contexts or args.net or args.summary or args.processes:
- print("Warning: --events, --context --net, --summary and --processes options are not implemented")
-
return args
def connect(self):
commit 79fdfd6d01f3e1d2d8449af3a7d9e56f9bfc65b2
Author: Jan Kurik <jkurik@redhat.com>
Date: Wed Dec 13 18:03:08 2023 +0100
Fixed crash of interpreter when using -t/-u option
Cleanup of remained code for unix and raw sockets causing python
interpreter to crash, generating a traceback.
diff --git a/src/pcp/ss/pcp-ss.py b/src/pcp/ss/pcp-ss.py
index 74952911a..5cf8ef939 100755
--- a/src/pcp/ss/pcp-ss.py
+++ b/src/pcp/ss/pcp-ss.py
@@ -253,10 +253,10 @@ class SS(object):
elif self.args.udp and netid == "udp":
state = self.valuesD["state"][inst]
ret = bool(state != "UNCONN" or self.args.listening)
- elif self.args.unix and netid == "unix":
- ret = True
- elif self.args.raw and netid == "raw":
- ret = True
+ #elif self.args.unix and netid == "unix":
+ # ret = True
+ #elif self.args.raw and netid == "raw":
+ # ret = True
return ret
def filter_ipv46(self, inst):

View File

@ -0,0 +1,12 @@
diff -Naurp pcp-6.2.0.orig/src/include/pcp.conf.in pcp-6.2.0/src/include/pcp.conf.in
--- pcp-6.2.0.orig/src/include/pcp.conf.in 2023-12-08 10:24:17.000000000 +1100
+++ pcp-6.2.0/src/include/pcp.conf.in 2024-02-12 04:10:10.649953498 +1100
@@ -140,7 +140,7 @@ PCP_ARCHIVE_DIR=@pcp_archive_dir@
# default version for generating PCP archives
# Possible versions: 2, 3 (3 requires PCP 6+)
-PCP_ARCHIVE_VERSION=3
+PCP_ARCHIVE_VERSION=2
# directory for daily PCP activity reports
# Standard path: /var/log/pcp/sa

View File

@ -1 +1 @@
SHA512 (pcp-6.1.1.src.tar.gz) = 04ab4a6e24f2f4b69e750bf21ff5c717717fb7d2a60dc9317a9721b808e42939e6dd113cf8ea1f40d98edcd176dbb24c584cc41b80249a57c9db3c256230aa19 SHA512 (pcp-6.2.0.src.tar.gz) = 249ceebf9b87d03fd024d2c75c1f32362cad3d315b68bf3bc305705cbec564d0c162d695988332183f1a595bc88f80929e7d111435ae09ce3c240e0df9b47a1b