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

