import pcp-6.0.5-4.el9

c9-beta imports/c9-beta/pcp-6.0.5-4.el9
MSVSphere Packaging Team 1 year ago
parent dc90d5520a
commit aaa1e2526d

2
.gitignore vendored

@ -1 +1 @@
SOURCES/pcp-6.0.1.src.tar.gz
SOURCES/pcp-6.0.5.src.tar.gz

@ -1 +1 @@
4f405e26a6c651b2f094134e0648cd5fd201d310 SOURCES/pcp-6.0.1.src.tar.gz
b6fccadd38606aa79ef36fdad30947fb3aadee55 SOURCES/pcp-6.0.5.src.tar.gz

@ -1,88 +0,0 @@
diff --git a/vendor/github.com/iovisor/bcc/libbpf-tools/arm64/vmlinux_510.h b/vendor/github.com/iovisor/bcc/libbpf-tools/arm64/vmlinux_510.h
index f84b1347bf..3c032f5230 100644
--- a/vendor/github.com/iovisor/bcc/libbpf-tools/arm64/vmlinux_510.h
+++ b/vendor/github.com/iovisor/bcc/libbpf-tools/arm64/vmlinux_510.h
@@ -1678,6 +1678,7 @@ struct perf_event {
int pending_wakeup;
int pending_kill;
int pending_disable;
+ long unsigned int pending_addr;
struct irq_work pending;
atomic_t event_limit;
struct perf_addr_filters_head addr_filters;
@@ -1693,6 +1694,7 @@ struct perf_event {
void *overflow_handler_context;
perf_overflow_handler_t orig_overflow_handler;
struct bpf_prog *prog;
+ u64 bpf_cookie;
struct trace_event_call *tp_event;
struct event_filter *filter;
struct ftrace_ops ftrace_ops;
@@ -26070,7 +26072,10 @@ enum bpf_link_type {
BPF_LINK_TYPE_ITER = 4,
BPF_LINK_TYPE_NETNS = 5,
BPF_LINK_TYPE_XDP = 6,
- MAX_BPF_LINK_TYPE = 7,
+ BPF_LINK_TYPE_PERF_EVENT = 7,
+ BPF_LINK_TYPE_KPROBE_MULTI = 8,
+ BPF_LINK_TYPE_STRUCT_OPS = 9,
+ MAX_BPF_LINK_TYPE = 10,
};
struct bpf_link_info {
@@ -30363,6 +30368,11 @@ struct bpf_raw_tp_link {
struct bpf_raw_event_map *btp;
};
+struct bpf_perf_link {
+ struct bpf_link link;
+ struct file *perf_file;
+};
+
struct btf_member {
__u32 name_off;
__u32 type;
diff --git a/vendor/github.com/iovisor/bcc/libbpf-tools/powerpc/vmlinux_510.h b/vendor/github.com/iovisor/bcc/libbpf-tools/powerpc/vmlinux_510.h
index 3b1b0127d1..052db391d4 100644
--- a/vendor/github.com/iovisor/bcc/libbpf-tools/powerpc/vmlinux_510.h
+++ b/vendor/github.com/iovisor/bcc/libbpf-tools/powerpc/vmlinux_510.h
@@ -4345,6 +4345,7 @@ struct perf_event {
int pending_wakeup;
int pending_kill;
int pending_disable;
+ long unsigned int pending_addr;
struct irq_work pending;
atomic_t event_limit;
struct perf_addr_filters_head addr_filters;
@@ -4360,6 +4361,7 @@ struct perf_event {
void *overflow_handler_context;
perf_overflow_handler_t orig_overflow_handler;
struct bpf_prog *prog;
+ u64 bpf_cookie;
struct trace_event_call *tp_event;
struct event_filter *filter;
struct ftrace_ops ftrace_ops;
@@ -36449,7 +36451,10 @@ enum bpf_link_type {
BPF_LINK_TYPE_ITER = 4,
BPF_LINK_TYPE_NETNS = 5,
BPF_LINK_TYPE_XDP = 6,
- MAX_BPF_LINK_TYPE = 7,
+ BPF_LINK_TYPE_PERF_EVENT = 7,
+ BPF_LINK_TYPE_KPROBE_MULTI = 8,
+ BPF_LINK_TYPE_STRUCT_OPS = 9,
+ MAX_BPF_LINK_TYPE = 10,
};
struct bpf_link_info {
@@ -40756,6 +40761,11 @@ struct bpf_raw_tp_link {
struct bpf_raw_event_map *btp;
};
+struct bpf_perf_link {
+ struct bpf_link link;
+ struct file *perf_file;
+};
+
struct btf_member {
__u32 name_off;
__u32 type;

@ -1,19 +0,0 @@
commit 23bfdcbac0b0fb7bd33f092c6f2ad56889480335
Author: Andreas Gerstmayr <agerstmayr@redhat.com>
Date: Thu Oct 27 14:22:37 2022 +0200
build: use vendored vmlinux.h when compiling bpftool
diff --git a/vendor/GNUmakefile b/vendor/GNUmakefile
index a0c29d4b45..57151e4671 100644
--- a/vendor/GNUmakefile
+++ b/vendor/GNUmakefile
@@ -3,7 +3,7 @@ include $(TOPDIR)/src/include/builddefs
default_pcp default:
ifeq "$(PMDA_BPF)" "true"
- $(MAKE) -C github.com/libbpf/bpftool/src
+ $(MAKE) -C github.com/libbpf/bpftool/src VMLINUX_H=$(PMDABPF_VMLINUXH)
endif
install_pcp install:

@ -0,0 +1,69 @@
commit e97d64cfab956e3542a0f25442086ee2fd74d9a5
Author: Nathan Scott <nathans@redhat.com>
Date: Tue Jul 18 16:22:30 2023 +1000
pmieconf: move test_action from primary into a separate group
Problem with using primary is that it is automatically enabled
as part of the primary pmie startup and thats not whats needed
for this diagnostic rule.
Resolves Red Hat BZ #2223348
diff --git a/src/pmieconf/.gitignore b/src/pmieconf/.gitignore
index 3c0b7b51ef..0670d80057 100644
--- a/src/pmieconf/.gitignore
+++ b/src/pmieconf/.gitignore
@@ -9,6 +9,7 @@ perdisk/GNUmakefile
pernetif/GNUmakefile
power/GNUmakefile
primary/GNUmakefile
+testing/GNUmakefile
zeroconf/GNUmakefile
pmieconf
pmieconf.static
diff --git a/src/pmieconf/GNUmakefile b/src/pmieconf/GNUmakefile
index 567d94dce1..7a82e45a28 100644
--- a/src/pmieconf/GNUmakefile
+++ b/src/pmieconf/GNUmakefile
@@ -18,7 +18,7 @@ include $(TOPDIR)/src/include/builddefs
include $(TOPDIR)/src/libpcp/src/GNUlibrarydefs
MKFILE_SUBDIRS = cpu entropy filesys memory network percpu perdisk pernetif \
- power global primary zeroconf
+ power global primary testing zeroconf
SUBDIRS = $(MKFILE_SUBDIRS)
CMDTARGET = pmieconf$(EXECSUFFIX)
diff --git a/src/pmieconf/primary/localdefs b/src/pmieconf/primary/localdefs
index 3d51dd69d9..ca21fca8b5 100644
--- a/src/pmieconf/primary/localdefs
+++ b/src/pmieconf/primary/localdefs
@@ -1,2 +1,2 @@
-ALL_RULES = pmda_status test_actions
+ALL_RULES = pmda_status
LOCAL_RULES = $(ALL_RULES)
diff --git a/src/pmieconf/testing/localdefs b/src/pmieconf/testing/localdefs
new file mode 100644
index 0000000000..a2af94f1c0
--- /dev/null
+++ b/src/pmieconf/testing/localdefs
@@ -0,0 +1,2 @@
+ALL_RULES = test_actions
+LOCAL_RULES = $(ALL_RULES)
diff --git a/src/pmieconf/primary/test_actions b/src/pmieconf/testing/test_actions
similarity index 97%
rename from src/pmieconf/primary/test_actions
rename to src/pmieconf/testing/test_actions
index cc0ee1f7cb..56c89787a0 100644
--- a/src/pmieconf/primary/test_actions
+++ b/src/pmieconf/testing/test_actions
@@ -2,7 +2,7 @@
# --- DO NOT MODIFY THIS FILE --- see pmieconf(5)
#
-rule primary.test_actions
+rule testing.test_actions
default = "$rule$"
predicate = "hinv.ncpu > 0"
enabled = no

@ -0,0 +1,94 @@
commit b4869520fd98f8b2ad09d39fb4466100d508b926
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Aug 7 13:04:38 2023 +1000
pmieconf: update webhook action for better EDA integration
The pmieconf webhook action was initially created for Event
Driven Ansible (EDA); two issues have been resolved related
- using the JSON key "values" conflicts with something deep
down in EDA that also interprets this JSON. Use "message",
which is more descriptive of the content anyway.
- there is no easily accessible hostname JSON key - add one
via the usual %h pmie action string expansion.
Related to Red Hat BZ #2185803
diff --git a/qa/1567 b/qa/1567
index ba90aa9cc8..10c1756ca4 100755
--- a/qa/1567
+++ b/qa/1567
@@ -53,7 +53,7 @@ sleep 2 # let nc start up
( sleep 2; $signal $pid1 ) >>$seq.full 2>&1 &
echo "pmie webhook invocation" | tee -a $here/$seq.full
-pmie_webhook "http://localhost:$port/webhook|Busy CPU|100%hosta|100%@hostb" 2> $tmp.webhook.err
+pmie_webhook "http://localhost:$port/webhook|Busy CPU|www.abc.com|100%@www.abc.com" 2> $tmp.webhook.err
cat $tmp.webhook.err >> $here/$seq.full
echo
diff --git a/qa/1567.out b/qa/1567.out
index e3fce64bb3..153aec9581 100644
--- a/qa/1567.out
+++ b/qa/1567.out
@@ -9,5 +9,5 @@ Content-Type: application/json
Host: localhost:PORT
POST /webhook HTTP/1.1
User-Agent: curl VERSION
-{"pcp":{"pmie":{"rule":"Busy CPU","values":"100%hosta 100%@hostb"}}}
+{"pcp":{"pmie":{"rule":"Busy CPU","hostname":"www.abc.com","message":"100%@www.abc.com"}}}
diff --git a/src/pmieconf/global/pcp_actions b/src/pmieconf/global/pcp_actions
index 476bef0553..61e787f21e 100644
--- a/src/pmieconf/global/pcp_actions
+++ b/src/pmieconf/global/pcp_actions
@@ -95,7 +95,7 @@ the rule condition is true.";
shell global.webhook_action
enabled = no
- default = "pmie_webhook '$webhook_endpoint$|$rule$^|$action_expand$^'"
+ default = "pmie_webhook '$webhook_endpoint$|$rule$^|%h|$action_expand$^'"
help =
"HTTP POST message will be sent to \"webhook_endpoint\" when a
rule condition is true. The message will be in JSON format.";
diff --git a/src/pmieconf/pmie_webhook b/src/pmieconf/pmie_webhook
index 87193fca60..8d386f1ae6 100755
--- a/src/pmieconf/pmie_webhook
+++ b/src/pmieconf/pmie_webhook
@@ -19,7 +19,8 @@
#
# "line" 1 - HTTP/HTTPS endpoint, as passed to a http client
# "line" 2 - pmie rule name
-# "line" 3,4,.. - values from predicate evaluation [optional]
+# "line" 3 - rule evaluated for hostname
+# "line" 4,5,.. - values from predicate evaluation [optional]
# source the PCP configuration environment variables
. /etc/pcp.env
@@ -28,7 +29,7 @@ prog=`basename $0`
if [ $# -ne 1 ]
then
- echo "Usage: $prog url|rule|message"
+ echo "Usage: $prog url|rule|hostname|message"
exit 1
fi
@@ -46,14 +47,14 @@ if [ -z "$CURL" ] ; then
fi
cat <<End-of-File | ${PCP_AWK_PROG} -F\| '
-NF < 2 { print "echo '"'$prog"': needs \"endpoint|rule|values\" argument'"'"'"
+NF < 3 { print "echo '"'$prog"': needs \"endpoint|rule|hostname|message\" argument'"'"'"
exit 1
}
{ printf "%s ", "'$CURL'"
printf "-s -X POST -H \"Content-Type: application/json\" -d@- "
printf "%s <<End-of-File\n", $1
- printf "{\"pcp\":{\"pmie\":{\"rule\":\"%s\",\"values\":\"%s", $2, $3
- for (i = 4; i <= NF; i++)
+ printf "{\"pcp\":{\"pmie\":{\"rule\":\"%s\",\"hostname\":\"%s\",\"message\":\"%s", $2, $3, $4
+ for (i = 5; i <= NF; i++)
printf " %s", $i
printf "\"}}}\nEnd-of-File\n"
}' | /bin/sh

@ -1,15 +1,14 @@
Name: pcp
Version: 6.0.1
Version: 6.0.5
Release: 4%{?dist}
Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
URL: https://pcp.io
%global artifactory https://performancecopilot.jfrog.io/artifactory
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
Patch0: redhat-bugzilla-2117074-vendored_vmlinux.h.patch
Patch1: redhat-bugzilla-2117074-ppc_arm_vmlinux.h.patch
Patch0: redhat-bugzilla-2175602.patch
Patch1: redhat-bugzilla-2185803.patch
# The additional linker flags break out-of-tree PMDAs.
# https://bugzilla.redhat.com/show_bug.cgi?id=2043092
@ -96,8 +95,8 @@ Patch1: redhat-bugzilla-2117074-ppc_arm_vmlinux.h.patch
%endif
# support for pmdabpf, check bcc.spec for supported architectures of libbpf-tools
%if 0%{?fedora} >= 33 || 0%{?rhel} > 8
%ifarch x86_64 ppc64 ppc64le aarch64
%if 0%{?fedora} >= 37 || 0%{?rhel} > 8
%ifarch x86_64 %{power64} aarch64
%global disable_bpf 0
%else
%global disable_bpf 1
@ -280,7 +279,7 @@ BuildRequires: perl-devel perl(strict)
BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent) perl(JSON)
BuildRequires: perl(Time::HiRes) perl(Digest::MD5)
BuildRequires: perl(XML::LibXML) perl(File::Slurp)
BuildRequires: man %{_hostname_executable}
BuildRequires: %{_hostname_executable}
%if !%{disable_systemd}
BuildRequires: systemd-devel
%endif
@ -2289,9 +2288,7 @@ updated policy package.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%autosetup -p1
%build
# the buildsubdir macro gets defined in %%setup and is apparently only available in the next step (i.e. the %%build step)
@ -3367,6 +3364,26 @@ fi
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Mon Aug 07 2023 Nathan Scott <nathans@redhat.com> - 6.0.5-4
- Improve Event Driven Ansible integration (BZ 2185803)
* Fri Jul 28 2023 Stan Cox <scox@redhat.com> - 6.0.5-3
- Pickup the new gating configuration
* Mon Jun 26 2023 Nathan Scott <nathans@redhat.com> - 6.0.5-2
- Resolve regression in pmieconf from rebase (BZ 2175602)
* Mon Jun 26 2023 Nathan Scott <nathans@redhat.com> - 6.0.5-1
- Rebase to latest stable version of PCP (BZ 2175602)
* Thu Jun 15 2023 Nathan Scott <nathans@redhat.com> - 6.0.4-2
- Resolve an selinux issue with pmlogger_daily (BZ 2208154)
* Mon May 15 2023 Nathan Scott <nathans@redhat.com> - 6.0.4-1
- Ensure pmcd.conf not rewritten needlessly (BZ 2166819)
- Add support for pmieconf webhook action (BZ 2185803)
- Rebase to latest stable version of PCP (BZ 2175602)
* Tue Jan 17 2023 Nathan Scott <nathans@redhat.com> - 6.0.1-4
- Rebuild for dependency on new version of libbpf (BZ 2159276)

Loading…
Cancel
Save