Fix some bugs in pcp-pidstat,include -U option error,-? need an arg,

And del unused -h/--host options
This commit is contained in:
si-gui 2020-09-18 21:26:18 +08:00
parent ab9e16e5e6
commit 253fd7a098
2 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1,67 @@
From a0263117a9383623860cda6d60a6cacfb957f445 Mon Sep 17 00:00:00 2001
From: si-gui <245140120@qq.com>
Date: Fri, 18 Sep 2020 21:10:58 +0800
Subject: [PATCH] fix some pcp-pidstat bugs
Signed-off-by: si-gui <245140120@qq.com>
---
src/pcp/pidstat/pcp-pidstat.1 | 8 +-------
src/pcp/pidstat/pcp-pidstat.py | 5 ++---
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/pcp/pidstat/pcp-pidstat.1 b/src/pcp/pidstat/pcp-pidstat.1
index 2e0dafe..b929085 100644
--- a/src/pcp/pidstat/pcp-pidstat.1
+++ b/src/pcp/pidstat/pcp-pidstat.1
@@ -22,7 +22,7 @@
.SH DESCRIPTION
.B pcp-pidstat
command is used for monitoring individual tasks currently being managed by the Linux kernel. Using various options it helps user to see useful information related with the processes. This information can include percentage CPU, memory and stack usages, scheduling and priority information. By default pcp-pidstat reports live
-data for the local host but can also report for a remote host (--host) or from a previously captured PCP archive (-a).
+data for the local host but can also report from a previously captured PCP archive (-a).
.BR pcp-pidstat
fetches the data to be analysed from PMCD unless provided \-a option. (See below)
@@ -51,12 +51,6 @@ Causes pcp\-pidstat to use the specified archive than connecting to PMCD. The ar
list of names, each of which may be the base name of an archive or the name of a directory containing one or more archives. Archives can be created using
.BR pmlogger (1)\.
-.TP
-.B \--host
-Current performance metric values are retrieved from the nominated
-.I host
-machine.
-
.TP
.BR \-B \fR
Report process states. The argument to -B is one of the following:
diff --git a/src/pcp/pidstat/pcp-pidstat.py b/src/pcp/pidstat/pcp-pidstat.py
index a790793..d126fba 100755
--- a/src/pcp/pidstat/pcp-pidstat.py
+++ b/src/pcp/pidstat/pcp-pidstat.py
@@ -776,12 +776,11 @@ class PidstatOptions(pmapi.pmOptions):
#After reading in the provided command line options
#initalize them by passing them in
def __init__(self):
- pmapi.pmOptions.__init__(self,"a:s:t:G:IU::p:RrkVZ:z?:f:B:l")
+ pmapi.pmOptions.__init__(self,"a:s:t:G:IU:p:RrkVZ:z?f:B:l")
self.pmSetOptionCallback(self.extraOptions)
self.pmSetOverrideCallback(self.override)
self.pmSetLongOptionHeader("General options")
self.pmSetLongOptionArchive()
- self.pmSetLongOptionHost() # --host for remote monitoring
self.pmSetLongOptionSamples()
self.pmSetLongOptionInterval()
self.pmSetLongOption("process-name",1,"G","NAME","Select process names using regular expression.")
@@ -791,7 +790,7 @@ class PidstatOptions(pmapi.pmOptions):
self.pmSetLongOption("",0,"R","","Report realtime priority and scheduling policy information.")
self.pmSetLongOption("",0,"r","","Report page faults and memory utilization.")
self.pmSetLongOption("",0,"k","","Report stack utilization.")
- self.pmSetLongOption("",0,"f","","Format the timestamp output")
+ self.pmSetLongOption("",0,"f","","Format the timestamp output,use -f [FORMAT] specify the timestamp format")
self.pmSetLongOption("",0,"B","state1,state2,..","Report process state information. Use -B [all] or -B [comma separated states]. Use -B detail for showing time spent in every state per process")
self.pmSetLongOptionVersion()
self.pmSetLongOptionTimeZone()
--
2.23.0

View File

@ -21,6 +21,7 @@ Patch0000: 0000-Fix-some-options-and-syntax-errors.patch
Patch0001: 0001-Fix-collectl2pcp-option.patch
Patch6000: CVE-2019-3695-CVE-2019-3696.patch
Patch9000: 9000-fix-new-function-not-found-when-Install.patch
Patch9001: 0002-fix-some-pcp-pidstat-bugs.patch
BuildRequires: gcc gcc-c++ procps autoconf bison flex nss-devel rpm-devel avahi-devel xz-devel zlib-devel
BuildRequires: python2-devel python3-devel ncurses-devel readline-devel cyrus-sasl-devel papi-devel libpfm-devel >= 4
@ -866,6 +867,7 @@ This package installs selinux support files for PCP.
%patch0001 -p1
%patch6000 -p1
%patch9000 -p1
%patch9001 -p1
%build
@ -2221,6 +2223,10 @@ fi
%config(noreplace) /etc/pcp/pmrep/*
%changelog
* Fri Sep 18 2020 Guoshuai Sun <sunguoshuai@huawei.com> -4.1.3-12
- Fix some bugs in pcp-pidstat,include -U option error,-? need an arg,
And del unused -h/--host options
* Thu Sep 17 2020 lingsheng <lingsheng@huawei.com> - 4.1.3-11
- Fix collect2pcp option