From 5778c322149ecb51480b2ddd1e27df68134b2c7a Mon Sep 17 00:00:00 2001 From: caodongxia <315816521@qq.com> Date: Thu, 14 Jul 2022 17:08:08 +0800 Subject: [PATCH] Fix out of range in pcp-mpstat --- fix-out-of-range-mpstat.patch | 26 ++++++++++++++++++++++++++ pcp.spec | 7 ++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 fix-out-of-range-mpstat.patch diff --git a/fix-out-of-range-mpstat.patch b/fix-out-of-range-mpstat.patch new file mode 100644 index 0000000..d2426ad --- /dev/null +++ b/fix-out-of-range-mpstat.patch @@ -0,0 +1,26 @@ +From 9e7d6b2796f669a5e41f5e4fb5ea349a39d8795b Mon Sep 17 00:00:00 2001 +From: caodongxia <315816521@qq.com> +Date: Thu, 14 Jul 2022 15:16:42 +0800 +Subject: [PATCH] fix out of range + +--- + src/pcp/mpstat/pcp-mpstat.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/pcp/mpstat/pcp-mpstat.py b/src/pcp/mpstat/pcp-mpstat.py +index fefb6aa..17da944 100755 +--- a/src/pcp/mpstat/pcp-mpstat.py ++++ b/src/pcp/mpstat/pcp-mpstat.py +@@ -602,6 +602,9 @@ class MpstatReport(pmcc.MetricGroupPrinter): + # need two fetches to report rate converted counter metrics + return + ++ if not group['hinv.ncpu'].netValues or not group['kernel.uname.sysname'].netValues: ++ return ++ + if self.Machine_info_count == 0: + self.print_machine_info(group, manager) + self.Machine_info_count = 1 +-- +2.23.0 + diff --git a/pcp.spec b/pcp.spec index 4ba7021..5e0d7d9 100644 --- a/pcp.spec +++ b/pcp.spec @@ -53,10 +53,12 @@ Name: pcp Version: 5.3.5 Summary: System-level performance monitoring and performance management -Release: 6 +Release: 7 License: GPLv2+ and LGPLv2.1+ and CC-BY URL: https://pcp.io Source0: https://github.com/performancecopilot/pcp/archive/refs/tags/5.3.5.tar.gz +#Refer: https://github.com/performancecopilot/pcp/pull/822 +Patch0: fix-out-of-range-mpstat.patch BuildRequires: make BuildRequires: gcc gcc-c++ BuildRequires: procps autoconf bison flex @@ -1928,6 +1930,9 @@ systemctl condrestart pmproxy.service >/dev/null 2>&1 %changelog +* Thu Jul 14 2022 caodongxia - 5.3.5-7 +- Fix out of range in pcp-mpstat + * Wed Mar 9 2022 baizhonggui - 5.3.5-6 - Revert removing Wants=pmcd.service from pmie and pmlogger -- Gitee