From 37bc8623f0fd6a87b3180033facf7106b6628772 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Fri, 20 Sep 2024 14:39:57 +0300 Subject: [PATCH] Revert OL changes --- ...libpcp-small-derived-metrics-bug-fix.patch | 108 ------------------ SPECS/pcp.spec | 8 +- 2 files changed, 1 insertion(+), 115 deletions(-) delete mode 100644 SOURCES/1001-libpcp-small-derived-metrics-bug-fix.patch diff --git a/SOURCES/1001-libpcp-small-derived-metrics-bug-fix.patch b/SOURCES/1001-libpcp-small-derived-metrics-bug-fix.patch deleted file mode 100644 index a85d9fd..0000000 --- a/SOURCES/1001-libpcp-small-derived-metrics-bug-fix.patch +++ /dev/null @@ -1,108 +0,0 @@ -From f8dc87ed130a0cfe1077242a4da2d621c4016bfb Mon Sep 17 00:00:00 2001 -From: Ken McDonell -Date: Thu, 4 Apr 2024 11:34:41 +1100 -Subject: [PATCH] libpcp: small derived metrics bug fix - -This is a partial fix for -https://github.com/performancecopilot/pcp/issues/1921 - -If the operand has the semantics of PM_SEM_COUNTER and the -value goes backwards from one fetch to the next, then return -no values for rate(). - -There is QA to come, but this needs a final blessing from Oracle -before the reproducer archive can be included. - -cherry-picked:- f8dc87ed130a0cfe1077242a4da2d621c4016bfb -[Orabug: 36538820] -Signed-off-by: sagar sagar ---- - man/man3/pmregisterderived.3 | 13 +++++++++---- - src/libpcp/src/derive_fetch.c | 23 ++++++++++++++++++++++- - 2 files changed, 31 insertions(+), 5 deletions(-) - -diff --git a/man/man3/pmregisterderived.3 b/man/man3/pmregisterderived.3 -index d8719f373..32963c3b3 100644 ---- a/man/man3/pmregisterderived.3 -+++ b/man/man3/pmregisterderived.3 -@@ -485,15 +485,20 @@ metric x with the dimension in the - .B time - domain decreased by one and scaling if required in the time utilization case - where the operand is in units of time, and the derived metric is unitless. --This mimics the rate conversion applied to counter metrics by tools -+There is one value in the result -+for each instance that appears in both the current and the previous -+sample, except in the case where the metric x has -+the semantics of a counter, i.e. PM_SEM_COUNTER, and -+current value of an instance is smaller than the previous value -+of the same instance then no value is -+returned for this instance (this corresponds to a ``counter wrap'' or a ``counter reset''). -+These rules -+mimic the rate conversion applied to counter metrics by tools - such as - .BR pmval (1), - .BR pmie (1) - and - .BR pmchart (1). --There is one value in the result --for each instance that appears in both the current and the previous --sample. - T} - _ - instant(x) T{ -diff --git a/src/libpcp/src/derive_fetch.c b/src/libpcp/src/derive_fetch.c -index 62921ece4..ed5f6ebcf 100644 ---- a/src/libpcp/src/derive_fetch.c -+++ b/src/libpcp/src/derive_fetch.c -@@ -847,7 +847,13 @@ eval_expr(__pmContext *ctxp, node_t *np, struct timespec *stamp, int numpmid, - } - } - else { -- /* rate() conversion, type will be DOUBLE */ -+ /* -+ * rate() conversion, type will be DOUBLE -+ * -+ * For COUNTER metrics, return "no value" if the counter is -+ * NOT monotonic increasing ... this matches what pmval(1) -+ * and pmie(1) do in the same circumstances. -+ */ - struct timespec stampdiff; - - stampdiff = np->data.info->stamp; -@@ -857,18 +863,33 @@ eval_expr(__pmContext *ctxp, node_t *np, struct timespec *stamp, int numpmid, - np->data.info->ivlist[k].value.d = (double)(np->left->data.info->ivlist[i].value.l - np->left->data.info->last_ivlist[j].value.l); - break; - case PM_TYPE_U32: -+ if (np->left->desc.sem == PM_SEM_COUNTER && -+ np->left->data.info->ivlist[i].value.ul < np->left->data.info->last_ivlist[j].value.ul) -+ continue; - np->data.info->ivlist[k].value.d = (double)(np->left->data.info->ivlist[i].value.ul - np->left->data.info->last_ivlist[j].value.ul); - break; - case PM_TYPE_64: -+ if (np->left->desc.sem == PM_SEM_COUNTER && -+ np->left->data.info->ivlist[i].value.ll < np->left->data.info->last_ivlist[j].value.ll) -+ continue; - np->data.info->ivlist[k].value.d = (double)(np->left->data.info->ivlist[i].value.ll - np->left->data.info->last_ivlist[j].value.ll); - break; - case PM_TYPE_U64: -+ if (np->left->desc.sem == PM_SEM_COUNTER && -+ np->left->data.info->ivlist[i].value.ull < np->left->data.info->last_ivlist[j].value.ull) -+ continue; - np->data.info->ivlist[k].value.d = (double)(np->left->data.info->ivlist[i].value.ull - np->left->data.info->last_ivlist[j].value.ull); - break; - case PM_TYPE_FLOAT: -+ if (np->left->desc.sem == PM_SEM_COUNTER && -+ np->left->data.info->ivlist[i].value.f < np->left->data.info->last_ivlist[j].value.f) -+ continue; - np->data.info->ivlist[k].value.d = (double)(np->left->data.info->ivlist[i].value.f - np->left->data.info->last_ivlist[j].value.f); - break; - case PM_TYPE_DOUBLE: -+ if (np->left->desc.sem == PM_SEM_COUNTER && -+ np->left->data.info->ivlist[i].value.d < np->left->data.info->last_ivlist[j].value.d) -+ continue; - np->data.info->ivlist[k].value.d = np->left->data.info->ivlist[i].value.d - np->left->data.info->last_ivlist[j].value.d; - break; - default: --- -2.39.3 - diff --git a/SPECS/pcp.spec b/SPECS/pcp.spec index 334e16c..11c5a2c 100644 --- a/SPECS/pcp.spec +++ b/SPECS/pcp.spec @@ -1,6 +1,6 @@ Name: pcp Version: 6.2.0 -Release: 5.0.1%{?dist} +Release: 5%{?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 @@ -14,9 +14,6 @@ Patch4: redhat-issues-RHEL-57799-pmpost-symlink-handling.patch Patch5: redhat-issues-RHEL-34586-pmproxy-pmcd-fd-leak.patch Patch6: redhat-issues-RHEL-57788-pmdahacluster-update.patch -#Oracle patches -Patch1001: 1001-libpcp-small-derived-metrics-bug-fix.patch - %if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 ExcludeArch: %{ix86} @@ -3501,9 +3498,6 @@ fi %files zeroconf -f pcp-zeroconf-files.rpm %changelog -* Thu Sep 19 2024 EL Errata - 6.2.0-5.0.1 -- Fixed libpcp derived metric issue for ol9 [Orabug: 36538820] - * Tue Sep 17 2024 Nathan Scott - 6.2.0-5 - Fix buffer sizing checks in pmstore PDU handling (RHEL-57805) - Guard against symlink attacks in pmpost program (RHEL-57810)