import CS pcp-6.3.2-3.el9
This commit is contained in:
parent
923154a0a0
commit
62128d912a
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1 @@
|
||||
SOURCES/pcp-6.2.2.src.tar.gz
|
||||
SOURCES/redhat-issues-RHEL-40718-java-bytecode-update.patch
|
||||
SOURCES/redhat-issues-RHEL-50693-hacluster-metrics-update.patch
|
||||
SOURCES/pcp-6.3.2.src.tar.gz
|
||||
|
@ -1,3 +1 @@
|
||||
65095a4cddfad3ec6e119ea127050ea68ff8676d SOURCES/pcp-6.2.2.src.tar.gz
|
||||
bf187559a4c2960a692c385b38cab9fd62c81b94 SOURCES/redhat-issues-RHEL-40718-java-bytecode-update.patch
|
||||
e9a7873944492e28e2f9c5fd0c9bfac12ef7596e SOURCES/redhat-issues-RHEL-50693-hacluster-metrics-update.patch
|
||||
90248a6ea840586b2ffa04f89aadea2fa7a3860e SOURCES/pcp-6.3.2.src.tar.gz
|
||||
|
269
SOURCES/pcp-xsos-fixes.patch
Normal file
269
SOURCES/pcp-xsos-fixes.patch
Normal file
@ -0,0 +1,269 @@
|
||||
commit d2852e19e77e25d628399d51fcf199233547f8c4
|
||||
Author: Nathan Scott <nathans@redhat.com>
|
||||
Date: Wed Nov 13 17:17:28 2024 +1100
|
||||
|
||||
libpcp, pcp-xsos: finer grained string output control in pmPrintValue
|
||||
|
||||
Implement a mechanism in pmPrintValue for producing single-line value
|
||||
output, giving shell scripts a chance to operate sensibly with whacky
|
||||
command lines.
|
||||
|
||||
Resolves Red Hat bugs RHEL-67164 and RHEL-67148.
|
||||
|
||||
diff --git a/man/man3/pmprintvalue.3 b/man/man3/pmprintvalue.3
|
||||
index 067b2aee2b..656c05849d 100644
|
||||
--- a/man/man3/pmprintvalue.3
|
||||
+++ b/man/man3/pmprintvalue.3
|
||||
@@ -80,6 +80,15 @@ and
|
||||
pairs for each requested metric), based upon the
|
||||
metrics type as returned from
|
||||
.BR pmLookupDesc (3).
|
||||
+.SH ENVIRONMENT
|
||||
+Output of string metric values can be further controlled using
|
||||
+.BR PCP_SQUASH_NEWLINES .
|
||||
+When set in the environment of the calling process, and the
|
||||
+.I type
|
||||
+is set to PM_TYPE_STRING or PM_TYPE_AGGREGATE, then the output
|
||||
+value is guaranteed to be free of embedded newline characters.
|
||||
+If the given value contained such characters, they will have been
|
||||
+replaced by a space before being printed.
|
||||
.SH SEE ALSO
|
||||
.BR PMAPI (3),
|
||||
.BR pmAtomStr (3),
|
||||
diff --git a/qa/1564 b/qa/1564
|
||||
index cbb976cfe4..714955223e 100755
|
||||
--- a/qa/1564
|
||||
+++ b/qa/1564
|
||||
@@ -117,5 +117,33 @@ pcp -a $archive xsos -x -n | _filter_net
|
||||
echo === Archive pcp xsos -N
|
||||
pcp -a $archive xsos -x -N | _filter_netstat
|
||||
|
||||
+echo === Special case: eval command issues | tee -a $seq.full
|
||||
+test -f /eperm && $sudo rm -f /eperm
|
||||
+(./src/args \$\(touch /eperm\) )&
|
||||
+argspid=$!
|
||||
+$PCP_BINADM_DIR/pmsleep 0.25 # start args
|
||||
+$sudo pcp xsos -x --ps >> $seq.full
|
||||
+echo $? exit status
|
||||
+test -f /eperm && echo file exists && $sudo rm -f /eperm
|
||||
+$PCP_BINADM_DIR/pmsignal $argspid
|
||||
+wait $argspid
|
||||
+
|
||||
+echo === Special case: multiline ps issues | tee -a $seq.full
|
||||
+(./src/args '
|
||||
+multi
|
||||
+line
|
||||
+args
|
||||
+')&
|
||||
+argspid=$!
|
||||
+$PCP_BINADM_DIR/pmsleep 0.25 # start args
|
||||
+pcp xsos -x --ps >> $seq.full
|
||||
+echo $? exit status
|
||||
+$PCP_BINADM_DIR/pmsignal $argspid
|
||||
+wait $argspid
|
||||
+
|
||||
+echo === Special case: command line errors | tee -a $seq.full
|
||||
+pcp xsos unknown_arg >> $seq.full 2>&1
|
||||
+echo $? exit status
|
||||
+
|
||||
# success, all done
|
||||
exit
|
||||
diff --git a/qa/1564.out b/qa/1564.out
|
||||
index 57de00c30a..11321e342a 100644
|
||||
--- a/qa/1564.out
|
||||
+++ b/qa/1564.out
|
||||
@@ -111,3 +111,9 @@ NET STATS
|
||||
Ip.InAddrErrors: XXX
|
||||
Ip6.InAddrErrors: XXX
|
||||
|
||||
+=== Special case: eval command issues
|
||||
+0 exit status
|
||||
+=== Special case: multiline ps issues
|
||||
+0 exit status
|
||||
+=== Special case: command line errors
|
||||
+1 exit status
|
||||
diff --git a/qa/src/.gitignore b/qa/src/.gitignore
|
||||
index 7e9b0fe08a..3399d24a4e 100644
|
||||
--- a/qa/src/.gitignore
|
||||
+++ b/qa/src/.gitignore
|
||||
@@ -13,6 +13,7 @@ archend
|
||||
archfetch
|
||||
archinst
|
||||
arch_maxfd
|
||||
+args
|
||||
atomstr
|
||||
badUnitsStr_r
|
||||
badloglabel
|
||||
diff --git a/qa/src/GNUlocaldefs b/qa/src/GNUlocaldefs
|
||||
index ae647278f2..ac0920d136 100644
|
||||
--- a/qa/src/GNUlocaldefs
|
||||
+++ b/qa/src/GNUlocaldefs
|
||||
@@ -48,7 +48,7 @@ CFILES = disk_test.c exercise.c context_test.c chkoptfetch.c \
|
||||
archctl_segfault.c debug.c int2pmid.c int2indom.c exectest.c \
|
||||
unpickargs.c hanoi.c progname.c countmark.c check_attribute.c \
|
||||
indom2int.c pmid2int.c scanmeta.c traverse_return_codes.c \
|
||||
- timeshift.c checkstructs.c bcc_profile.c sha1int2ext.c \
|
||||
+ timeshift.c checkstructs.c bcc_profile.c args.c sha1int2ext.c \
|
||||
getdomainname.c profilecrash.c store_and_fetch.c test_service_notify.c \
|
||||
ctx_derive.c pmstrn.c pmfstring.c pmfg-derived.c mmv_help.c sizeof.c \
|
||||
stampconv.c time_stamp.c archend.c scandata.c wait_for_values.c \
|
||||
diff --git a/qa/src/args.c b/qa/src/args.c
|
||||
new file mode 100644
|
||||
index 0000000000..06d9b9b6cc
|
||||
--- /dev/null
|
||||
+++ b/qa/src/args.c
|
||||
@@ -0,0 +1,18 @@
|
||||
+/*
|
||||
+ * Copyright (c) 2024 Red Hat.
|
||||
+ *
|
||||
+ * QA helper that waits for stdin input then exits, useful for
|
||||
+ * shell escape testing as it allows arbitrary args (ignored).
|
||||
+ */
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <unistd.h>
|
||||
+
|
||||
+int
|
||||
+main(int argc, char **argv)
|
||||
+{
|
||||
+ while (1)
|
||||
+ sleep(1);
|
||||
+ exit(EXIT_SUCCESS);
|
||||
+}
|
||||
diff --git a/src/libpcp/src/check-statics b/src/libpcp/src/check-statics
|
||||
index 29dcb868ad..b9f21edc32 100755
|
||||
--- a/src/libpcp/src/check-statics
|
||||
+++ b/src/libpcp/src/check-statics
|
||||
@@ -581,6 +581,8 @@ util.o
|
||||
msgbuf # guarded by util_lock mutex
|
||||
msgbuflen # guarded by util_lock mutex
|
||||
msgsize # guarded by util_lock mutex
|
||||
+ squashed # guarded by __pmLock_extcall mutex when set
|
||||
+ # in a one-trip initialization
|
||||
filename # guarded by __pmLock_extcall mutex when set
|
||||
# in a one-trip initialization
|
||||
?base # no unsafe side-effects, see notes in util.c
|
||||
diff --git a/src/libpcp/src/util.c b/src/libpcp/src/util.c
|
||||
index d4f79ca40d..84a7df6329 100644
|
||||
--- a/src/libpcp/src/util.c
|
||||
+++ b/src/libpcp/src/util.c
|
||||
@@ -984,6 +984,18 @@ print_event_summary(FILE *f, const pmValue *val, int highres)
|
||||
fputc(']', f);
|
||||
}
|
||||
|
||||
+static void
|
||||
+squash_string(char *s, unsigned int len)
|
||||
+{
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ /* replace end-of-line characters */
|
||||
+ for (i = 0; i < len; i++) {
|
||||
+ if (isspace(s[i]))
|
||||
+ s[i] = ' ';
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* Print single pmValue. */
|
||||
void
|
||||
pmPrintValue(FILE *f, /* output stream */
|
||||
@@ -997,6 +1009,16 @@ pmPrintValue(FILE *f, /* output stream */
|
||||
int n;
|
||||
char *p;
|
||||
int sts;
|
||||
+ static int squashed = -1;
|
||||
+
|
||||
+ if (squashed == -1) {
|
||||
+ /* one-trip initialization */
|
||||
+ PM_LOCK(__pmLock_extcall);
|
||||
+ squashed = 0;
|
||||
+ if (getenv("PCP_SQUASH_NEWLINES") != NULL) /* THREADSAFE */
|
||||
+ squashed = 1;
|
||||
+ PM_UNLOCK(__pmLock_extcall);
|
||||
+ }
|
||||
|
||||
if (type != PM_TYPE_UNKNOWN &&
|
||||
type != PM_TYPE_EVENT &&
|
||||
@@ -1032,7 +1054,10 @@ pmPrintValue(FILE *f, /* output stream */
|
||||
break;
|
||||
|
||||
case PM_TYPE_STRING:
|
||||
- n = (int)strlen(a.cp) + 2;
|
||||
+ n = (int)strlen(a.cp);
|
||||
+ if (squashed)
|
||||
+ squash_string(a.cp, n);
|
||||
+ n += 2;
|
||||
while (n < minwidth) {
|
||||
fputc(' ', f);
|
||||
n++;
|
||||
@@ -1123,6 +1148,8 @@ pmPrintValue(FILE *f, /* output stream */
|
||||
n++;
|
||||
}
|
||||
n = (int)val->value.pval->vlen - PM_VAL_HDR_SIZE;
|
||||
+ if (squashed)
|
||||
+ squash_string(val->value.pval->vbuf, n);
|
||||
fprintf(f, "\"%*.*s\"", n, n, val->value.pval->vbuf);
|
||||
done = 1;
|
||||
}
|
||||
|
||||
commit a55c5de05836ca0e71b052a4579b34f8e6577c23
|
||||
Merge: 3bcaee943a b147af9c8e
|
||||
Author: Nathan Scott <nathans@redhat.com>
|
||||
Date: Wed Nov 13 16:49:57 2024 +1100
|
||||
|
||||
Merge commit 'b147af9c8e71423be9bb62699534d3fea4d86b8a' into xsos
|
||||
|
||||
|
||||
commit b147af9c8e71423be9bb62699534d3fea4d86b8a
|
||||
Author: Nathan Scott <nathans@redhat.com>
|
||||
Date: Wed Nov 13 16:49:57 2024 +1100
|
||||
|
||||
Squashed 'vendor/github.com/performancecopilot/xsos-pcp/' changes from deb8740f2f..de2b314859
|
||||
|
||||
de2b314859 pcp-xsos: fine-tune error handling on bad command line options
|
||||
35f2cefa3a pcp-xsos: single-line pmPrintValue/pminfo values, escape shell chars
|
||||
|
||||
git-subtree-dir: vendor/github.com/performancecopilot/xsos-pcp
|
||||
git-subtree-split: de2b314859d01dec9387e06da39af6920018d219
|
||||
|
||||
diff --git a/pcp-xsos b/pcp-xsos
|
||||
index e8c60f1e0c..388712752d 100755
|
||||
--- a/vendor/github.com/performancecopilot/xsos-pcp/pcp-xsos
|
||||
+++ b/vendor/github.com/performancecopilot/xsos-pcp/pcp-xsos
|
||||
@@ -112,7 +112,6 @@ _usage()
|
||||
{
|
||||
[ ! -z "$@" ] && echo $@ 1>&2
|
||||
pmgetopt --progname=$progname --usage --config=$tmp/usage
|
||||
- sts=0
|
||||
exit
|
||||
}
|
||||
|
||||
@@ -206,9 +205,11 @@ do
|
||||
color=false
|
||||
;;
|
||||
-\?)
|
||||
+ sts=0
|
||||
_usage ""
|
||||
;;
|
||||
--) # end of options, start of arguments
|
||||
+ sts=1
|
||||
_usage "Unknown argument: $2"
|
||||
;;
|
||||
esac
|
||||
@@ -304,6 +305,7 @@ fi
|
||||
# kernel_all_load_value[15]=0.06
|
||||
# kernel_cpu_util_user_error="No value(s) available!"
|
||||
|
||||
+export PCP_SQUASH_NEWLINES=1
|
||||
if ! pminfo $batch --fetch ${metrics[*]} > $tmp/metrics 2>$tmp/error
|
||||
then
|
||||
if grep "^pminfo:" $tmp/error > /dev/null 2>&1
|
||||
@@ -320,6 +322,8 @@ gawk < $tmp/metrics > $tmp/variables '
|
||||
function filter(string) {
|
||||
gsub(/"/, "\\\"", string) # escape double quotes
|
||||
gsub(/\\u/, "\\\\u", string) # escape backslash-u
|
||||
+ # replace any characters with special shell meaning
|
||||
+ gsub("/\\(|\\$|\\*|)|\\{|\\}\\?|`|;|!/", "-", string)
|
||||
gsub(/%/, "%%", string) # percent sign in printf
|
||||
gsub(/^\\"|\\"$/, "\"", string) # except on ends
|
||||
return string
|
@ -1,372 +0,0 @@
|
||||
commit 6cefac3c6560487abad80498240545e6835e503f
|
||||
Author: lmchilton <lauren.chilton26@gmail.com>
|
||||
Date: Wed Jun 19 10:19:04 2024 +0200
|
||||
|
||||
Updated pcp2openmetrics tool to fix issues: RHEL-39159, RHEL-39132, RHEL-32983, RHEL-39293.
|
||||
Added command line option to exclude # PCP 5 comment line
|
||||
Updated output to follow openmetrics format to include _total metric name ending
|
||||
Omitted blank line after each metric output to adhere to prometheus openmetrics parser
|
||||
Added # EOF line to end of text dump to adhere to prometheus openmetrics
|
||||
parser
|
||||
Updated relevent qa for pcp2openmetric changes (1131 & 1827)
|
||||
Updated pcp2openmetrics man page and fixed style errors(2)
|
||||
|
||||
diff --git a/qa/1131 b/qa/1131
|
||||
index 413da6fe3..aa1e554fe 100755
|
||||
--- a/qa/1131
|
||||
+++ b/qa/1131
|
||||
@@ -62,9 +62,10 @@ pcp2json -a $A -H -I -Z UTC+0 -x "" | _archive_filter
|
||||
echo "---"
|
||||
pcp2json -a $A -H -I -z -X -b GB -P 2 -F $tmp.outfile ""
|
||||
echo "---"
|
||||
-pcp2openmetrics -s1 -H -z hinv.ncpu | _filter_pcp2openmetrics
|
||||
+pcp2openmetrics -s1 -z hinv.ncpu | _filter_pcp2openmetrics
|
||||
+echo "---"
|
||||
+pcp2openmetrics -s2 -x hinv.ncpu | _filter_pcp2openmetrics
|
||||
echo "---"
|
||||
-
|
||||
|
||||
cat $tmp.outfile | _archive_filter
|
||||
which json_verify > /dev/null 2>&1
|
||||
diff --git a/qa/1131.out b/qa/1131.out
|
||||
index 098d698a6..90cb9eaa2 100644
|
||||
--- a/qa/1131.out
|
||||
+++ b/qa/1131.out
|
||||
@@ -2267,13 +2267,18 @@ QA output created by 1131
|
||||
}
|
||||
---
|
||||
---
|
||||
-
|
||||
-
|
||||
+# EOF
|
||||
# HELP hinv_ncpu number of CPUs in the system
|
||||
# PCP5 hinv_ncpu 60.0.32 u32 PM_INDOM_NULL discrete
|
||||
# TYPE hinv_ncpu gauge
|
||||
hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} NCPU
|
||||
---
|
||||
+# EOF
|
||||
+# HELP hinv_ncpu number of CPUs in the system
|
||||
+# TYPE hinv_ncpu gauge
|
||||
+hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} NCPU
|
||||
+hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} NCPU
|
||||
+---
|
||||
{
|
||||
"@pcp": {
|
||||
"@hosts": [
|
||||
diff --git a/qa/1827 b/qa/1827
|
||||
index 47ee66d54..ebeaad460 100755
|
||||
--- a/qa/1827
|
||||
+++ b/qa/1827
|
||||
@@ -63,12 +63,20 @@ $PCP_PYTHON_PROG $here/src/pythonserver.py $port >$tmp.python.out 2>&1 &
|
||||
pid=$!
|
||||
sleep 2 # let server start up
|
||||
|
||||
+echo "---"
|
||||
echo "pcp2openmetrics invocation" | tee -a $here/$seq.full
|
||||
pcp2openmetrics -s1 -u http://localhost:$port hinv.ncpu >$tmp.openmetrics.out 2>$tmp.openmetrics.err
|
||||
|
||||
echo "pcp2openmetrics HTTP POST (sorted):"
|
||||
_filter_pcp2openmetrics_http <$tmp.python.out
|
||||
|
||||
+cat /dev/null > $tmp.python.out
|
||||
+
|
||||
+echo "---"
|
||||
+echo "testing -x option" | tee -a $here/$seq.full
|
||||
+pcp2openmetrics -s1 -x -u http://localhost:$port hinv.ncpu >$tmp.openmetrics2.out 2>$tmp.openmetrics2.err
|
||||
+_filter_pcp2openmetrics_http <$tmp.python.out
|
||||
+
|
||||
# terminate pythonserver.py now
|
||||
pmsignal $pid >/dev/null 2>&1
|
||||
|
||||
diff --git a/qa/1827.out b/qa/1827.out
|
||||
index e786d8607..191ebcfa8 100644
|
||||
--- a/qa/1827.out
|
||||
+++ b/qa/1827.out
|
||||
@@ -1,4 +1,5 @@
|
||||
QA output created by 1827
|
||||
+---
|
||||
pcp2openmetrics invocation
|
||||
pcp2openmetrics HTTP POST (sorted):
|
||||
|
||||
@@ -21,3 +22,22 @@ INFO:root:Starting httpd...
|
||||
Path: /
|
||||
User-Agent: python-requests VERSION
|
||||
hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} N (cpus)
|
||||
+---
|
||||
+testing -x option
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+# HELP hinv_ncpu number of CPUs in the system
|
||||
+# TYPE hinv_ncpu gauge
|
||||
+Accept: */*
|
||||
+Body:
|
||||
+Content-Length: SIZE
|
||||
+Content-Type: application/openmetrics-text
|
||||
+Headers:
|
||||
+Host: localhost:PORT
|
||||
+INFO:root:POST request,
|
||||
+Path: /
|
||||
+User-Agent: python-requests VERSION
|
||||
+hinv_ncpu{domainname="DOMAINID",groupid="GROUPID",hostname="HOST",machineid="MACHINEID",userid="USERID",agent="linux"} N (cpus)
|
||||
diff --git a/src/pcp2openmetrics/pcp2openmetrics.1 b/src/pcp2openmetrics/pcp2openmetrics.1
|
||||
index 84e81e7af..41e4e2f9c 100644
|
||||
--- a/src/pcp2openmetrics/pcp2openmetrics.1
|
||||
+++ b/src/pcp2openmetrics/pcp2openmetrics.1
|
||||
@@ -181,6 +181,13 @@ Maximum time (in seconds) when sending a HTTP POST.
|
||||
Corresponding command line option is \fB\-o\fP.
|
||||
Defaults to \fB2.5\fP seconds.
|
||||
.RE
|
||||
+.PP
|
||||
+no-comment (boolean)
|
||||
+.RS 4
|
||||
+Omit # PCP5 comment line. Omits header for some metric
|
||||
+data such as type, instance domain, and semantics.
|
||||
+Corresponding command line option is \fB\-x\fP.
|
||||
+Defaults to \fBno\fP.
|
||||
.SH OPTIONS
|
||||
The available command line options are:
|
||||
.TP 5
|
||||
@@ -343,9 +350,6 @@ on
|
||||
.IR host ,
|
||||
rather than from the default localhost.
|
||||
.TP
|
||||
-\fB\-H\fR, \fB\-\-no\-header\fR
|
||||
-Do not print any headers.
|
||||
-.TP
|
||||
\fB\-i\fR \fIinstances\fR, \fB\-\-instances\fR=\fIinstances\fR
|
||||
Retrieve and report only the specified metric
|
||||
.IR instances .
|
||||
@@ -605,8 +609,8 @@ and
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
Display version number and exit.
|
||||
.TP
|
||||
-\fB\-x\fR, \fB\-\-with\-extended\fR
|
||||
-Write extended information.
|
||||
+\fB\-x\fR, \fB\-no\-comment\fR
|
||||
+Omit # PCP5 comment line
|
||||
.TP
|
||||
\fB\-X\fR, \fB\-\-with\-everything\fR
|
||||
Write everything known about metrics, including PCP internal IDs.
|
||||
diff --git a/src/pcp2openmetrics/pcp2openmetrics.py b/src/pcp2openmetrics/pcp2openmetrics.py
|
||||
index 51b3326d7..d5a3346fe 100755
|
||||
--- a/src/pcp2openmetrics/pcp2openmetrics.py
|
||||
+++ b/src/pcp2openmetrics/pcp2openmetrics.py
|
||||
@@ -50,24 +50,24 @@ class PCP2OPENMETRICS(object):
|
||||
self.opts = self.options()
|
||||
|
||||
# Configuration directives
|
||||
- self.keys = ('source', 'output', 'derived', 'header', 'globals',
|
||||
- 'samples', 'interval', 'type', 'precision', 'daemonize',
|
||||
+ self.keys = ('source', 'output', 'derived', 'globals',
|
||||
+ 'samples', 'interval', 'precision', 'daemonize',
|
||||
'timefmt', 'everything',
|
||||
'count_scale', 'space_scale', 'time_scale', 'version',
|
||||
'count_scale_force', 'space_scale_force', 'time_scale_force',
|
||||
- 'type_prefer', 'precision_force', 'limit_filter', 'limit_filter_force',
|
||||
+ 'precision_force', 'limit_filter', 'limit_filter_force',
|
||||
'live_filter', 'rank', 'invert_filter', 'predicate', 'names_change',
|
||||
'speclocal', 'instances', 'ignore_incompat', 'ignore_unknown',
|
||||
'omit_flat', 'include_labels', 'url', 'http_user', 'http_pass',
|
||||
- 'http_timeout')
|
||||
+ 'http_timeout', 'no_comment')
|
||||
|
||||
# Ignored for pmrep(1) compatibility
|
||||
self.keys_ignore = (
|
||||
- 'timestamp', 'unitinfo', 'colxrow', 'separate_header', 'fixed_header',
|
||||
+ 'timestamp','header', 'unitinfo', 'colxrow', 'separate_header', 'fixed_header',
|
||||
'delay', 'width', 'delimiter', 'extcsv', 'width_force',
|
||||
'extheader', 'repeat_header', 'interpol',
|
||||
'dynamic_header', 'overall_rank', 'overall_rank_alt', 'sort_metric',
|
||||
- 'instinfo', 'include_texts')
|
||||
+ 'instinfo', 'include_texts', 'type', 'type_prefer')
|
||||
|
||||
# The order of preference for options (as present):
|
||||
# 1 - command line options
|
||||
@@ -79,13 +79,12 @@ class PCP2OPENMETRICS(object):
|
||||
self.output = None # For pmrep conf file compat only
|
||||
self.speclocal = None
|
||||
self.derived = None
|
||||
- self.header = 1
|
||||
self.globals = 1
|
||||
self.samples = None # forever
|
||||
self.interval = pmapi.timeval(10) # 10 sec
|
||||
self.opts.pmSetOptionInterval(str(10)) # 10 sec
|
||||
self.delay = 0
|
||||
- self.type = 0
|
||||
+ self.type = 1
|
||||
self.type_prefer = self.type
|
||||
self.ignore_incompat = 0
|
||||
self.ignore_unknown = 0
|
||||
@@ -118,6 +117,8 @@ class PCP2OPENMETRICS(object):
|
||||
self.http_user = None
|
||||
self.http_pass = None
|
||||
self.http_timeout = TIMEOUT
|
||||
+ self.no_comment = False
|
||||
+ self.header_flag = True
|
||||
|
||||
# Internal
|
||||
self.runtime = -1
|
||||
@@ -146,7 +147,7 @@ class PCP2OPENMETRICS(object):
|
||||
opts = pmapi.pmOptions()
|
||||
opts.pmSetOptionCallback(self.option)
|
||||
opts.pmSetOverrideCallback(self.option_override)
|
||||
- opts.pmSetShortOptions("a:h:LK:c:Ce:D:V?HGA:S:T:O:s:t:rRIi:jJ:4:58:9:nN:vmP:0:q:b:y:Q:B:Y:F:f:Z:zXo:p:U:u:")
|
||||
+ opts.pmSetShortOptions("a:h:LK:c:Ce:D:V?GA:S:T:O:s:t:Ii:jJ:4:58:9:nN:vmP:0:q:b:y:Q:B:Y:F:f:Z:zXo:p:U:u:x")
|
||||
opts.pmSetShortUsage("[option...] metricspec [...]")
|
||||
|
||||
opts.pmSetLongOptionHeader("General options")
|
||||
@@ -166,7 +167,6 @@ class PCP2OPENMETRICS(object):
|
||||
opts.pmSetLongOptionHelp() # -?/--help
|
||||
|
||||
opts.pmSetLongOptionHeader("Reporting options")
|
||||
- opts.pmSetLongOption("no-header", 0, "H", "", "omit headers")
|
||||
opts.pmSetLongOption("no-globals", 0, "G", "", "omit global metrics")
|
||||
opts.pmSetLongOptionAlign() # -A/--align
|
||||
opts.pmSetLongOptionStart() # -S/--start
|
||||
@@ -176,8 +176,6 @@ class PCP2OPENMETRICS(object):
|
||||
opts.pmSetLongOptionInterval() # -t/--interval
|
||||
opts.pmSetLongOptionTimeZone() # -Z/--timezone
|
||||
opts.pmSetLongOptionHostZone() # -z/--hostzone
|
||||
- opts.pmSetLongOption("raw", 0, "r", "", "output raw counter values (no rate conversion)")
|
||||
- opts.pmSetLongOption("raw-prefer", 0, "R", "", "prefer output raw counter values (no rate conversion)")
|
||||
opts.pmSetLongOption("ignore-incompat", 0, "I", "", "ignore incompatible instances (default: abort)")
|
||||
opts.pmSetLongOption("ignore-unknown", 0, "5", "", "ignore unknown metrics (default: abort)")
|
||||
opts.pmSetLongOption("names-change", 1, "4", "ACTION", "update/ignore/abort on PMNS change (default: ignore)")
|
||||
@@ -201,6 +199,7 @@ class PCP2OPENMETRICS(object):
|
||||
opts.pmSetLongOption("time-scale-force", 1, "Y", "SCALE", "forced time unit")
|
||||
|
||||
opts.pmSetLongOption("with-everything", 0, "X", "", "write everything, incl. internal IDs")
|
||||
+ opts.pmSetLongOption("no-comment", 0, "x", "", "omit comment lines")
|
||||
|
||||
opts.pmSetLongOption("url", 1, "u", "URL", "URL of endpoint to receive HTTP POST")
|
||||
opts.pmSetLongOption("http-timeout", 1, "o", "SECONDS", "timeout when sending HTTP POST")
|
||||
@@ -238,14 +237,8 @@ class PCP2OPENMETRICS(object):
|
||||
self.derived = ";" + optarg
|
||||
else:
|
||||
self.derived = self.derived + ";" + optarg
|
||||
- elif opt == 'H':
|
||||
- self.header = 0
|
||||
elif opt == 'G':
|
||||
self.globals = 0
|
||||
- elif opt == 'r':
|
||||
- self.type = 1
|
||||
- elif opt == 'R':
|
||||
- self.type_prefer = 1
|
||||
elif opt == 'I':
|
||||
self.ignore_incompat = 1
|
||||
elif opt == '5':
|
||||
@@ -298,6 +291,8 @@ class PCP2OPENMETRICS(object):
|
||||
self.time_scale_force = optarg
|
||||
elif opt == 'X':
|
||||
self.everything = 1
|
||||
+ elif opt == 'x':
|
||||
+ self.no_comment = True
|
||||
elif opt == 'u':
|
||||
self.url = optarg
|
||||
elif opt == 'o':
|
||||
@@ -319,6 +314,7 @@ class PCP2OPENMETRICS(object):
|
||||
|
||||
if pmapi.c_api.pmSetContextOptions(self.context.ctx, self.opts.mode, self.opts.delta):
|
||||
raise pmapi.pmUsageErr()
|
||||
+ self.context.pmNewZone("UTC")
|
||||
|
||||
def validate_config(self):
|
||||
""" Validate configuration options """
|
||||
@@ -346,11 +342,6 @@ class PCP2OPENMETRICS(object):
|
||||
# Common preparations
|
||||
self.context.prepare_execute(self.opts, False, self.interpol, self.interval)
|
||||
|
||||
- # Headers
|
||||
- if self.header == 1:
|
||||
- self.header = 0
|
||||
- self.write_header()
|
||||
-
|
||||
# Just checking
|
||||
if self.check == 1:
|
||||
return
|
||||
@@ -394,29 +385,12 @@ class PCP2OPENMETRICS(object):
|
||||
|
||||
self.write_openmetrics(tstamp)
|
||||
|
||||
- def write_header(self):
|
||||
- """ Write info header """
|
||||
- output = self.outfile if self.outfile else "stdout"
|
||||
- if self.context.type == PM_CONTEXT_ARCHIVE:
|
||||
- sys.stdout.write('"# Writing %d archived metrics to %s..." }\n{ "//": "(Ctrl-C to stop)" }\n' % (len(self.metrics), output))
|
||||
- return
|
||||
-
|
||||
- sys.stdout.write('# "Waiting for %d metrics to be written to %s' % (len(self.metrics), output))
|
||||
- if self.runtime != -1:
|
||||
- sys.stdout.write('\n # "%s samples(s) with %.1f sec interval ~ %d sec runtime." }\n' % (self.samples, float(self.interval), self.runtime))
|
||||
- elif self.samples:
|
||||
- duration = (self.samples - 1) * float(self.interval)
|
||||
- sys.stdout.write('\n # "%s samples(s) with %.1f sec interval ~ %d sec runtime." }\n' % (self.samples, float(self.interval), duration))
|
||||
- else:
|
||||
- sys.stdout.write('...\n# "(Ctrl-C to stop)" }\n')
|
||||
-
|
||||
def write_openmetrics(self, timestamp):
|
||||
""" Write results in openmetrics format """
|
||||
if timestamp is None:
|
||||
# Silent goodbye, close in finalize()
|
||||
return
|
||||
|
||||
- self.context.pmNewZone("UTC")
|
||||
ts = self.context.datetime_to_secs(self.pmfg_ts(), PM_TIME_SEC)
|
||||
|
||||
if self.prev_ts is None:
|
||||
@@ -500,11 +474,12 @@ class PCP2OPENMETRICS(object):
|
||||
help_dict = {}
|
||||
help_dict[metric] = context.pmLookupText(pmid[0])
|
||||
|
||||
- if self.context.type == PM_CONTEXT_ARCHIVE:
|
||||
- body += "\nMetric %s details (last fetch: %d)\n:" % (metric, ts)
|
||||
- body += '# PCP5 %s %s %s %s %s %s\n' % (openmetrics_name(metric), pmIDStr, get_type_string(desc), pmIndomStr, semantics, units)
|
||||
- body += '# HELP %s %s\n' % (openmetrics_name(metric), help_dict[metric])
|
||||
- body += '# TYPE %s %s\n' % (openmetrics_name(metric), openmetrics_type(desc))
|
||||
+ if self.header_flag is True:
|
||||
+ if self.no_comment is False:
|
||||
+ body += '# PCP5 %s %s %s %s %s %s\n' % (openmetrics_name(metric), pmIDStr, get_type_string(desc), pmIndomStr, semantics, units)
|
||||
+ body += '# TYPE %s %s\n' % (openmetrics_name(metric), openmetrics_type(desc))
|
||||
+ body += '# HELP %s %s\n' % (openmetrics_name(metric), help_dict[metric])
|
||||
+ self.header_flag = False
|
||||
|
||||
for inst, name, value in results[metric]:
|
||||
if isinstance(value, float):
|
||||
@@ -515,10 +490,16 @@ class PCP2OPENMETRICS(object):
|
||||
value = format(value, fmt)
|
||||
else:
|
||||
str(value)
|
||||
+
|
||||
+ if openmetrics_type(desc) == "counter":
|
||||
+ openmetrics_name_end = openmetrics_name(metric) + "_total"
|
||||
+ else:
|
||||
+ openmetrics_name_end = openmetrics_name(metric)
|
||||
+
|
||||
if self.context.type == PM_CONTEXT_ARCHIVE:
|
||||
- body += '%s%s %s %s\n' % (openmetrics_name(metric), openmetrics_labels(inst, name, desc, labels), value, ts)
|
||||
+ body += '%s%s %s %s\n' % (openmetrics_name_end, openmetrics_labels(inst, name, desc, labels), value, ts)
|
||||
else:
|
||||
- body += '%s%s %s\n' % (openmetrics_name(metric), openmetrics_labels(inst, name, desc, labels), value)
|
||||
+ body += '%s%s %s\n' % (openmetrics_name_end, openmetrics_labels(inst, name, desc, labels), value)
|
||||
|
||||
if self.url:
|
||||
auth = None
|
||||
@@ -537,13 +518,13 @@ class PCP2OPENMETRICS(object):
|
||||
elif self.outfile:
|
||||
self.writer.write(body)
|
||||
else:
|
||||
- print(body)
|
||||
+ sys.stdout.write(body)
|
||||
|
||||
def finalize(self):
|
||||
""" Finalize and clean up """
|
||||
if self.writer:
|
||||
try:
|
||||
- self.writer.write("\n")
|
||||
+ self.writer.write("# EOF\n")
|
||||
self.writer.flush()
|
||||
except IOError as write_error:
|
||||
if write_error.errno != errno.EPIPE:
|
@ -1,12 +0,0 @@
|
||||
diff -Naurp pcp-6.2.2.orig/tmpfiles.init.setup.in pcp-6.2.2/tmpfiles.init.setup.in
|
||||
--- pcp-6.2.2.orig/tmpfiles.init.setup.in 2024-05-07 10:37:04.000000000 +1000
|
||||
+++ pcp-6.2.2/tmpfiles.init.setup.in 2024-05-16 09:18:49.200282601 +1000
|
||||
@@ -3,7 +3,7 @@
|
||||
# Type Path Mode User Group Age Argument
|
||||
D PCP_RUN_DIR 0775 PCP_USER PCP_GROUP - -
|
||||
d PCP_LOG_DIR 0775 PCP_USER PCP_GROUP - -
|
||||
-d PCP_LOG_DIR/pmcd 0775 root root - -
|
||||
+d PCP_LOG_DIR/pmcd 0755 root root - -
|
||||
d PCP_LOG_DIR/pmfind 0775 PCP_USER PCP_GROUP - -
|
||||
d PCP_LOG_DIR/pmie 0775 PCP_USER PCP_GROUP - -
|
||||
d PCP_LOG_DIR/pmlogger 0775 PCP_USER PCP_GROUP - -
|
@ -0,0 +1,52 @@
|
||||
diff -Naurp pcp-6.3.1.orig/configure pcp-6.3.1/configure
|
||||
--- pcp-6.3.1.orig/configure 2024-09-11 11:45:29.000000000 +1000
|
||||
+++ pcp-6.3.1/configure 2024-10-02 11:50:38.938538019 +1000
|
||||
@@ -5442,11 +5442,11 @@ if test x$ac_prog_cxx_stdcxx = xno
|
||||
then :
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
|
||||
printf %s "checking for $CXX option to enable C++11 features... " >&6; }
|
||||
-if test ${ac_cv_prog_cxx_11+y}
|
||||
+if test ${ac_cv_prog_cxx_cxx11+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
- ac_cv_prog_cxx_11=no
|
||||
+ ac_cv_prog_cxx_cxx11=no
|
||||
ac_save_CXX=$CXX
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
@@ -5488,11 +5488,11 @@ if test x$ac_prog_cxx_stdcxx = xno
|
||||
then :
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
|
||||
printf %s "checking for $CXX option to enable C++98 features... " >&6; }
|
||||
-if test ${ac_cv_prog_cxx_98+y}
|
||||
+if test ${ac_cv_prog_cxx_cxx98+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else $as_nop
|
||||
- ac_cv_prog_cxx_98=no
|
||||
+ ac_cv_prog_cxx_cxx98=no
|
||||
ac_save_CXX=$CXX
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
@@ -9457,7 +9457,7 @@ printf %s "checking if Perl is Y2038-saf
|
||||
#
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
printf "%s\n" "no" >&6; }
|
||||
- have_perl=false
|
||||
+ #have_perl=false -- el9 pre-existing-breakage
|
||||
;;
|
||||
67768036191676799)
|
||||
# all good
|
||||
diff -Naurp pcp-6.3.1.orig/configure.ac pcp-6.3.1/configure.ac
|
||||
--- pcp-6.3.1.orig/configure.ac 2024-09-11 11:45:29.000000000 +1000
|
||||
+++ pcp-6.3.1/configure.ac 2024-10-02 11:50:35.841529740 +1000
|
||||
@@ -1401,7 +1401,7 @@ AS_IF([test "x$do_perl" != "xno"], [
|
||||
# can't play in this sandpit
|
||||
#
|
||||
AC_MSG_RESULT([no])
|
||||
- have_perl=false
|
||||
+ #have_perl=false -- el9 pre-existing-breakage
|
||||
;;
|
||||
67768036191676799)
|
||||
# all good
|
@ -1,186 +0,0 @@
|
||||
diff -Naurp pcp-6.2.2.orig/configure pcp-6.2.2/configure
|
||||
--- pcp-6.2.2.orig/configure 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/configure 2024-06-10 13:07:44.487533040 +1000
|
||||
@@ -4885,12 +4885,12 @@ then :
|
||||
PCFLAGS="$PCFLAGS -Wno-array-bounds"
|
||||
fi
|
||||
fi
|
||||
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking sizeof time_t" >&5
|
||||
-printf %s "checking sizeof time_t... " >&6; }
|
||||
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking sizeof off_t" >&5
|
||||
+printf %s "checking sizeof off_t... " >&6; }
|
||||
cat <<End-of-File >conftest.c
|
||||
#include <stdio.h>
|
||||
-#include <sys/time.h>
|
||||
-int main() { printf("%d", (int)sizeof(time_t)); return 0; }
|
||||
+#include <sys/types.h>
|
||||
+int main() { printf("%d", (int)sizeof(off_t)); return 0; }
|
||||
End-of-File
|
||||
(eval $ac_compile) 2>&5
|
||||
(eval $ac_link) 2>&5
|
||||
@@ -4900,25 +4900,7 @@ rm -rf conftest conftest.*
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
|
||||
printf "%s\n" "$ans" >&6; }
|
||||
if test "$ans" = 4; then
|
||||
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64"
|
||||
-else
|
||||
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking sizeof off_t" >&5
|
||||
-printf %s "checking sizeof off_t... " >&6; }
|
||||
- cat <<End-of-File >conftest.c
|
||||
-#include <stdio.h>
|
||||
-#include <sys/types.h>
|
||||
-int main() { printf("%d", (int)sizeof(off_t)); return 0; }
|
||||
-End-of-File
|
||||
- (eval $ac_compile) 2>&5
|
||||
- (eval $ac_link) 2>&5
|
||||
- ans=`./conftest`
|
||||
- echo "./conftest -> \"$ans\"" >&5
|
||||
- rm -rf conftest conftest.*
|
||||
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ans" >&5
|
||||
-printf "%s\n" "$ans" >&6; }
|
||||
- if test "$ans" = 4; then
|
||||
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
|
||||
- fi
|
||||
+ PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
|
||||
fi
|
||||
|
||||
|
||||
diff -Naurp pcp-6.2.2.orig/configure.ac pcp-6.2.2/configure.ac
|
||||
--- pcp-6.2.2.orig/configure.ac 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/configure.ac 2024-06-10 13:07:42.552530243 +1000
|
||||
@@ -438,13 +438,12 @@ if ! echo "$CFLAGS" | grep -- -Wno-array
|
||||
then
|
||||
AS_IF([test "x$cc_is_gcc" = xyes ],[PCFLAGS="$PCFLAGS -Wno-array-bounds"])
|
||||
fi
|
||||
-dnl we also need to worry about time_t ... we need it to be 64-bits for Y2038;
|
||||
-dnl _FILE_OFFSET_BITS and _TIME_BITS must be set together for the 32-bit case.
|
||||
-AC_MSG_CHECKING([sizeof time_t])
|
||||
+dnl and we need to worry about off_t ... we need it to be 64-bits for V3 archives
|
||||
+AC_MSG_CHECKING([sizeof off_t])
|
||||
cat <<End-of-File >conftest.c
|
||||
#include <stdio.h>
|
||||
-#include <sys/time.h>
|
||||
-int main() { printf("%d", (int)sizeof(time_t)); return 0; }
|
||||
+#include <sys/types.h>
|
||||
+int main() { printf("%d", (int)sizeof(off_t)); return 0; }
|
||||
End-of-File
|
||||
(eval $ac_compile) 2>&5
|
||||
(eval $ac_link) 2>&5
|
||||
@@ -453,25 +452,7 @@ echo "./conftest -> \"$ans\"" >&5
|
||||
rm -rf conftest conftest.*
|
||||
AC_MSG_RESULT($ans)
|
||||
if test "$ans" = 4; then
|
||||
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64"
|
||||
-else
|
||||
- dnl we may need to check off_t ... we need it to be 64-bits for V3 archives
|
||||
- dnl this check is optional only because it may be set already (just prior).
|
||||
- AC_MSG_CHECKING([sizeof off_t])
|
||||
- cat <<End-of-File >conftest.c
|
||||
-#include <stdio.h>
|
||||
-#include <sys/types.h>
|
||||
-int main() { printf("%d", (int)sizeof(off_t)); return 0; }
|
||||
-End-of-File
|
||||
- (eval $ac_compile) 2>&5
|
||||
- (eval $ac_link) 2>&5
|
||||
- ans=`./conftest`
|
||||
- echo "./conftest -> \"$ans\"" >&5
|
||||
- rm -rf conftest conftest.*
|
||||
- AC_MSG_RESULT($ans)
|
||||
- if test "$ans" = 4; then
|
||||
- PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
|
||||
- fi
|
||||
+ PCFLAGS="$PCFLAGS -D_FILE_OFFSET_BITS=64"
|
||||
fi
|
||||
AC_SUBST(PCFLAGS)
|
||||
AC_SUBST(PLDFLAGS)
|
||||
diff -Naurp pcp-6.2.2.orig/src/perl/LogImport/Makefile.PL pcp-6.2.2/src/perl/LogImport/Makefile.PL
|
||||
--- pcp-6.2.2.orig/src/perl/LogImport/Makefile.PL 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/perl/LogImport/Makefile.PL 2024-06-10 13:07:42.553530244 +1000
|
||||
@@ -37,7 +37,7 @@ WriteMakefile(
|
||||
OPTIMIZE => '-g',
|
||||
XSPROTOARG => '-noprototypes',
|
||||
OBJECT => 'LogImport.o',
|
||||
- DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64',
|
||||
+ DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION',
|
||||
LDFROM => $ldfrom,
|
||||
LDDLFLAGS => $lddlflags,
|
||||
CCCDLFLAGS => $cccdlflags,
|
||||
diff -Naurp pcp-6.2.2.orig/src/perl/MMV/Makefile.PL pcp-6.2.2/src/perl/MMV/Makefile.PL
|
||||
--- pcp-6.2.2.orig/src/perl/MMV/Makefile.PL 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/perl/MMV/Makefile.PL 2024-06-10 13:07:42.553530244 +1000
|
||||
@@ -37,7 +37,7 @@ WriteMakefile(
|
||||
OPTIMIZE => '-g',
|
||||
XSPROTOARG => '-noprototypes',
|
||||
OBJECT => 'MMV.o',
|
||||
- DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64',
|
||||
+ DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION',
|
||||
LDFROM => $ldfrom,
|
||||
LDDLFLAGS => $lddlflags,
|
||||
CCCDLFLAGS => $cccdlflags,
|
||||
diff -Naurp pcp-6.2.2.orig/src/perl/PMDA/Makefile.PL pcp-6.2.2/src/perl/PMDA/Makefile.PL
|
||||
--- pcp-6.2.2.orig/src/perl/PMDA/Makefile.PL 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/perl/PMDA/Makefile.PL 2024-06-10 13:07:42.553530244 +1000
|
||||
@@ -54,7 +54,7 @@ WriteMakefile(
|
||||
OPTIMIZE => '-g',
|
||||
XSPROTOARG => '-noprototypes',
|
||||
OBJECT => 'local.o PMDA.o',
|
||||
- DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64',
|
||||
+ DEFINE => '-DPERLIO_NOT_STDIO=0 -DPCP_VERSION',
|
||||
LDFROM => $ldfrom,
|
||||
LDDLFLAGS => $lddlflags,
|
||||
CCCDLFLAGS => $cccdlflags,
|
||||
diff -Naurp pcp-6.2.2.orig/src/python/pmapi.c pcp-6.2.2/src/python/pmapi.c
|
||||
--- pcp-6.2.2.orig/src/python/pmapi.c 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/python/pmapi.c 2024-06-10 13:07:42.554530246 +1000
|
||||
@@ -24,8 +24,6 @@
|
||||
** **
|
||||
\**************************************************************************/
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
-#define _FILE_OFFSET_BITS 64
|
||||
-#define _TIME_BITS 64
|
||||
#include <Python.h>
|
||||
#define PMAPI_VERSION 3
|
||||
#include <pcp/pmapi.h>
|
||||
diff -Naurp pcp-6.2.2.orig/src/python/pmda.c pcp-6.2.2/src/python/pmda.c
|
||||
--- pcp-6.2.2.orig/src/python/pmda.c 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/python/pmda.c 2024-06-10 13:07:42.554530246 +1000
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (C) 2013-2015,2017-2021,2024 Red Hat.
|
||||
+ * Copyright (C) 2013-2015,2017-2021 Red Hat.
|
||||
*
|
||||
* This file is part of the "pcp" module, the python interfaces for the
|
||||
* Performance Co-Pilot toolkit.
|
||||
@@ -21,8 +21,6 @@
|
||||
* python PMDAs via the pmda.py module, using ctypes.
|
||||
*/
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
-#define _FILE_OFFSET_BITS 64
|
||||
-#define _TIME_BITS 64
|
||||
#include <Python.h>
|
||||
#include <pcp/pmapi.h>
|
||||
#include <pcp/pmda.h>
|
||||
diff -Naurp pcp-6.2.2.orig/src/python/pmgui.c pcp-6.2.2/src/python/pmgui.c
|
||||
--- pcp-6.2.2.orig/src/python/pmgui.c 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/python/pmgui.c 2024-06-10 13:07:42.554530246 +1000
|
||||
@@ -23,8 +23,6 @@
|
||||
** **
|
||||
\**************************************************************************/
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
-#define _FILE_OFFSET_BITS 64
|
||||
-#define _TIME_BITS 64
|
||||
#include <Python.h>
|
||||
#include <pcp/pmafm.h>
|
||||
#include <pcp/pmtime.h>
|
||||
diff -Naurp pcp-6.2.2.orig/src/python/pmi.c pcp-6.2.2/src/python/pmi.c
|
||||
--- pcp-6.2.2.orig/src/python/pmi.c 2024-05-08 09:18:25.000000000 +1000
|
||||
+++ pcp-6.2.2/src/python/pmi.c 2024-06-10 13:07:42.554530246 +1000
|
||||
@@ -23,8 +23,6 @@
|
||||
** **
|
||||
\**************************************************************************/
|
||||
#define PY_SSIZE_T_CLEAN
|
||||
-#define _FILE_OFFSET_BITS 64
|
||||
-#define _TIME_BITS 64
|
||||
#include <Python.h>
|
||||
#include <pcp/pmapi.h>
|
||||
#include <pcp/import.h>
|
24
SOURCES/selinux-pmie-and-pmlogger.patch
Normal file
24
SOURCES/selinux-pmie-and-pmlogger.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff --git a/src/selinux/pcp.te b/src/selinux/pcp.te
|
||||
index 46d921b5c..c03d03674 100644
|
||||
--- a/src/selinux/pcp.te
|
||||
+++ b/src/selinux/pcp.te
|
||||
@@ -906,6 +906,9 @@ allow pcp_pmlogger_t etc_t:dir { add_name read remove_name write };
|
||||
allow pcp_pmlogger_t etc_t:file { create unlink write };
|
||||
allow pcp_pmlogger_t cgroup_t:file { getattr read open append write };
|
||||
|
||||
+allow pcp_pmlogger_t fixed_disk_device_t:blk_file getattr;
|
||||
+allow pcp_pmlogger_t sysfs_t:lnk_file read;
|
||||
+
|
||||
#============= pcp_pmie_t ==============
|
||||
# type=AVC msg=audit(N): avc: denied { execute execute_no_trans getattr open read } for pid=PID comm="pmdaX" name="/" dev="tracefs" ino=INO scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=0
|
||||
allow pcp_pmie_t hostname_exec_t:file { execute execute_no_trans getattr open read };
|
||||
@@ -940,6 +943,9 @@ allow pcp_pmie_t etc_t:dir { add_name read remove_name write };
|
||||
allow pcp_pmie_t etc_t:file { create unlink write };
|
||||
allow pcp_pmie_t cgroup_t:file { getattr read open append write };
|
||||
|
||||
+allow pcp_pmie_t fixed_disk_device_t:blk_file getattr;
|
||||
+allow pcp_pmie_t sysfs_t:lnk_file read;
|
||||
+
|
||||
#============= pmda-lio ==============
|
||||
# type=AVC msg=audit(N): avc: denied { open read search write } for pid=PID comm="pmdaX" name="/" dev="tracefs" ino=INO scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:configfs_t:s0 tclass=dir permissive=0
|
||||
allow pcp_pmcd_t configfs_t:dir { open read search write };
|
120
SPECS/pcp.spec
120
SPECS/pcp.spec
@ -1,19 +1,17 @@
|
||||
Name: pcp
|
||||
Version: 6.2.2
|
||||
Release: 6%{?dist}
|
||||
Version: 6.3.2
|
||||
Release: 3%{?dist}
|
||||
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
|
||||
URL: https://pcp.io
|
||||
|
||||
Source0: https://github.com/performancecopilot/pcp/releases/pcp-%{version}.src.tar.gz
|
||||
|
||||
Patch0: pcp-xsos-fixes.patch
|
||||
# Keep xx-default-archive-version.patch for the life of RHEL9
|
||||
Patch1: redhat-issues-RHEL-2317-default-archive-version.patch
|
||||
Patch2: redhat-issues-RHEL-30198-pmcd-logdir-tmpfiles.patch
|
||||
Patch3: revert-time64_t-i386.patch
|
||||
Patch4: redhat-issues-39159-39132-32983-39293.patch
|
||||
Patch5: redhat-issues-RHEL-40718-java-bytecode-update.patch
|
||||
Patch6: redhat-issues-RHEL-50693-hacluster-metrics-update.patch
|
||||
Patch2: redhat-issues-RHEL-58953-perl-drop-Y2038-checks.patch
|
||||
Patch3: selinux-pmie-and-pmlogger.patch
|
||||
|
||||
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
|
||||
ExcludeArch: %{ix86}
|
||||
@ -73,6 +71,13 @@ ExcludeArch: %{ix86}
|
||||
%global disable_statsd 1
|
||||
%endif
|
||||
|
||||
# GFS2 filesystem no longer supported here
|
||||
%if 0%{?rhel} >= 10
|
||||
%global disable_gfs2 1
|
||||
%else
|
||||
%global disable_gfs2 0
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
|
||||
%global _with_python2 --with-python=no
|
||||
%global disable_python2 1
|
||||
@ -227,6 +232,12 @@ ExcludeArch: %{ix86}
|
||||
%global disable_xlsx 1
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
|
||||
%global disable_amdgpu 0
|
||||
%else
|
||||
%global disable_amdgpu 1
|
||||
%endif
|
||||
|
||||
# prevent conflicting binary and man page install for pcp(1)
|
||||
Conflicts: librapi < 0.16
|
||||
|
||||
@ -387,6 +398,12 @@ Requires: pcp-selinux = %{version}-%{release}
|
||||
%global _with_perfevent --with-perfevent=yes
|
||||
%endif
|
||||
|
||||
%if %{disable_gfs2}
|
||||
%global _with_gfs2 --with-pmdagfs2=no
|
||||
%else
|
||||
%global _with_gfs2 --with-pmdagfs2=yes
|
||||
%endif
|
||||
|
||||
%if %{disable_statsd}
|
||||
%global _with_statsd --with-pmdastatsd=no
|
||||
%else
|
||||
@ -466,11 +483,12 @@ fi
|
||||
}
|
||||
|
||||
%global run_pmieconf() %{expand:
|
||||
if [ -w "%1" ]
|
||||
if [ -d "%1" -a -w "%1" -a -w "%1/%2" ]
|
||||
then
|
||||
pmieconf -c enable "%2"
|
||||
pmieconf -f "%1/%2" -c enable "%3"
|
||||
chown pcp:pcp "%1/%2" 2>/dev/null
|
||||
else
|
||||
echo "WARNING: Cannot write to %1, skipping pmieconf enable of %2." >&2
|
||||
echo "WARNING: Cannot write to %1/%2, skipping pmieconf enable of %3." >&2
|
||||
fi
|
||||
}
|
||||
|
||||
@ -560,10 +578,13 @@ Requires: pcp-pmda-memcache pcp-pmda-mysql pcp-pmda-named pcp-pmda-netfilter pcp
|
||||
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-bash pcp-pmda-cisco pcp-pmda-mailq pcp-pmda-mounts
|
||||
Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping pcp-pmda-smart pcp-pmda-farm
|
||||
Requires: pcp-pmda-hacluster pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-denki pcp-pmda-docker pcp-pmda-bind2
|
||||
Requires: pcp-pmda-sockets pcp-pmda-podman
|
||||
%if !%{disable_gfs2}
|
||||
Requires: pcp-pmda-gfs2
|
||||
%endif
|
||||
%if !%{disable_statsd}
|
||||
Requires: pcp-pmda-statsd
|
||||
%endif
|
||||
@ -603,6 +624,9 @@ Requires: pcp-pmda-json
|
||||
Requires: pcp-pmda-resctrl
|
||||
%endif
|
||||
Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog
|
||||
%if !%{disable_amdgpu}
|
||||
Requires: pcp-pmda-amdgpu
|
||||
%endif
|
||||
Requires: pcp-system-tools
|
||||
%if !%{disable_qt}
|
||||
Requires: pcp-gui
|
||||
@ -2063,6 +2087,7 @@ Reliability Metrics (FARM) Log making use of data from the smartmontools
|
||||
package.
|
||||
#end pcp-pmda-farm
|
||||
|
||||
%if !%{disable_gfs2}
|
||||
#
|
||||
# pcp-pmda-gfs2
|
||||
#
|
||||
@ -2075,6 +2100,7 @@ Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
|
||||
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
|
||||
collecting metrics about the Global Filesystem v2.
|
||||
# end pcp-pmda-gfs2
|
||||
%endif
|
||||
|
||||
#
|
||||
# pcp-pmda-hacluster
|
||||
@ -2281,6 +2307,23 @@ collecting metrics about web server logs.
|
||||
# end pcp-pmda-weblog
|
||||
# end C pmdas
|
||||
|
||||
%if !%{disable_amdgpu}
|
||||
#
|
||||
# pcp-pmda-amdgpu
|
||||
#
|
||||
%package pmda-amdgpu
|
||||
License: GPL-2.0-or-later
|
||||
Summary: Performance Co-Pilot (PCP) metrics from AMD GPU devices
|
||||
URL: https://pcp.io
|
||||
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
|
||||
Requires: libdrm
|
||||
BuildRequires: libdrm-devel
|
||||
%description pmda-amdgpu
|
||||
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
|
||||
extracting performance metrics from AMDGPU devices.
|
||||
# end pcp-pmda-amdgpu
|
||||
%endif
|
||||
|
||||
%package zeroconf
|
||||
License: GPL-2.0-or-later
|
||||
Summary: Performance Co-Pilot (PCP) Zeroconf Package
|
||||
@ -2448,7 +2491,7 @@ 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_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_gfs2} %{?_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
|
||||
|
||||
%install
|
||||
@ -2589,7 +2632,7 @@ basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|htop|pcp2csv' \
|
||||
-e 'pcp-atop|pcp-dmcache|pcp-dstat|pcp-free' \
|
||||
-e 'pcp-htop|pcp-ipcs|pcp-iostat|pcp-lvmcache|pcp-mpstat' \
|
||||
-e 'pcp-numastat|pcp-pidstat|pcp-shping|pcp-ss' \
|
||||
-e 'pcp-tapestat|pcp-uptime|pcp-verify' | \
|
||||
-e 'pcp-tapestat|pcp-uptime|pcp-verify|pcp-xsos' | \
|
||||
cull 'selinux|pmlogconf|pmieconf|pmrepconf' >pcp-system-tools-files
|
||||
basic_manifest | keep 'geolocate' >pcp-geolocate-files
|
||||
basic_manifest | keep 'sar2pcp' >pcp-import-sar2pcp-files
|
||||
@ -2610,6 +2653,7 @@ 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)/amdgpu(/|$)' >pcp-pmda-amdgpu-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
|
||||
@ -2689,7 +2733,7 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files
|
||||
|
||||
rm -f packages.list
|
||||
for pmda_package in \
|
||||
activemq apache \
|
||||
activemq amdgpu apache \
|
||||
bash bcc bind2 bonding bpf bpftrace \
|
||||
cifs cisco \
|
||||
dbping denki docker dm ds389 ds389log \
|
||||
@ -3095,8 +3139,10 @@ exit 0
|
||||
%preun pmda-farm
|
||||
%{pmda_remove "$1" "farm"}
|
||||
|
||||
%if !%{disable_gfs2}
|
||||
%preun pmda-gfs2
|
||||
%{pmda_remove "$1" "gfs2"}
|
||||
%endif
|
||||
|
||||
%preun pmda-hacluster
|
||||
%{pmda_remove "$1" "hacluster"}
|
||||
@ -3142,6 +3188,11 @@ exit 0
|
||||
%preun pmda-weblog
|
||||
%{pmda_remove "$1" "weblog"}
|
||||
|
||||
%if !%{disable_amdgpu}
|
||||
%preun pmda-amdgpu
|
||||
%{pmda_remove "$1" "amdgpu"}
|
||||
%endif
|
||||
|
||||
%preun
|
||||
if [ "$1" -eq 0 ]
|
||||
then
|
||||
@ -3180,11 +3231,12 @@ for PMDA in dm nfsclient openmetrics ; do
|
||||
fi
|
||||
done
|
||||
# auto-enable these usually optional pmie rules
|
||||
%{run_pmieconf "$PCP_PMIECONFIG_DIR" dmthin}
|
||||
%if 0%{?rhel} <= 9
|
||||
%{run_pmieconf "$PCP_PMIECONFIG_DIR" config.default dmthin}
|
||||
# managed via /usr/lib/systemd/system-preset/90-default.preset nowadays:
|
||||
%if 0%{?rhel} > 0 && 0%{?rhel} < 10
|
||||
%if !%{disable_systemd}
|
||||
systemctl restart pcp-reboot-init pmcd pmlogger pmie >/dev/null 2>&1
|
||||
systemctl enable pcp-reboot-init pmcd pmlogger pmie >/dev/null 2>&1
|
||||
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
|
||||
@ -3203,6 +3255,8 @@ PCP_LOG_DIR=%{_logsdir}
|
||||
%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
|
||||
systemctl restart pcp-reboot-init >/dev/null 2>&1
|
||||
systemctl enable pcp-reboot-init >/dev/null 2>&1
|
||||
|
||||
%systemd_postun_with_restart pmcd.service
|
||||
%systemd_post pmcd.service
|
||||
@ -3460,6 +3514,10 @@ fi
|
||||
%files pmda-openmetrics -f pcp-pmda-openmetrics-files.rpm
|
||||
%endif
|
||||
|
||||
%if !%{disable_amdgpu}
|
||||
%files pmda-amdgpu -f pcp-pmda-amdgpu-files.rpm
|
||||
%endif
|
||||
|
||||
%files pmda-apache -f pcp-pmda-apache-files.rpm
|
||||
|
||||
%files pmda-bash -f pcp-pmda-bash-files.rpm
|
||||
@ -3470,7 +3528,9 @@ fi
|
||||
|
||||
%files pmda-farm -f pcp-pmda-farm-files.rpm
|
||||
|
||||
%if !%{disable_gfs2}
|
||||
%files pmda-gfs2 -f pcp-pmda-gfs2-files.rpm
|
||||
%endif
|
||||
|
||||
%files pmda-hacluster -f pcp-pmda-hacluster-files.rpm
|
||||
|
||||
@ -3544,6 +3604,30 @@ fi
|
||||
%files zeroconf -f pcp-zeroconf-files.rpm
|
||||
|
||||
%changelog
|
||||
* Fri Jan 3 2025 Sam Feifer <sfeifer@redhat.com> - 6.3.2-3
|
||||
- Fix selinux denials caused by pmie and pmlogger trying to access /dev/dm-*
|
||||
|
||||
* Thu Nov 14 2024 Nathan Scott <nathans@redhat.com> - 6.3.2-2
|
||||
- Back-port upstream bug fixes for pcp-xsos(1).
|
||||
|
||||
* Wed Nov 06 2024 Nathan Scott <nathans@redhat.com> - 6.3.2-1
|
||||
- Add proc PMDA access control for IO metrics (RHEL-60891)
|
||||
- Fix pmdastatsd segfaults within pmdaRehash (RHEL-57717)
|
||||
- Multiple hugepage size NUMA metric support (RHEL-45876)
|
||||
- Improve pcp-xsos command line diagnostics (RHEL-61597, RHEL-61598)
|
||||
- Add pmlogger_farm_check service selinux policy (RHEL-61885)
|
||||
- Fix v3 archive replay on big endian machines (RHEL-61501)
|
||||
- Rebase to latest stable version of PCP (RHEL-58953)
|
||||
|
||||
* Wed Oct 2 2024 Nathan Scott <nathans@redhat.com> - 6.3.1-1
|
||||
- New pcp-xsos utility for rapid system summaries (RHEL-30590)
|
||||
- Fix Upgrade scripts to not rewrite pmcd.conf (RHEL-40631)
|
||||
- Add new Hyper-V balloon usage metrics (RHEL-45715)
|
||||
- Auto-load pmdaproc in local context (RHEL-50941)
|
||||
- Fix a benign potential libpcp buffer overflow (RHEL-58914)
|
||||
- Fix pcp-zeroconf pmie.config write permission (RHEL-59366)
|
||||
- Rebase to latest stable version of PCP (RHEL-58953)
|
||||
|
||||
* Wed Aug 7 2024 Nathan Scott <nathans@redhat.com> - 6.2.2-6
|
||||
- Update hacluster PMDA for pacemaker 2.1.6 crm_mon (RHEL-50693)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user