Fix some options and syntax errors
This commit is contained in:
parent
b776b4a685
commit
8e0022a5b7
184
0000-Fix-some-options-and-syntax-errors.patch
Normal file
184
0000-Fix-some-options-and-syntax-errors.patch
Normal file
@ -0,0 +1,184 @@
|
||||
diff --git a/src/pcp/collectl/pcp-collectl.py b/src/pcp/collectl/pcp-collectl.py
|
||||
index 3cff1f9..58b8c64 100755
|
||||
--- a/src/pcp/collectl/pcp-collectl.py
|
||||
+++ b/src/pcp/collectl/pcp-collectl.py
|
||||
@@ -841,7 +841,7 @@ class _Options(object):
|
||||
opts = pmapi.pmOptions()
|
||||
opts.pmSetOptionCallback(self.option_callback)
|
||||
opts.pmSetOverrideCallback(self.override)
|
||||
- opts.pmSetShortOptions("vp:a:c:f:R:i:s:h:?")
|
||||
+ opts.pmSetShortOptions("Vvp:a:c:f:R:i:s:h:?")
|
||||
opts.pmSetLongOptionText("")
|
||||
opts.pmSetLongOptionText("Interactive: pcp collectl [-h HOST] [options]")
|
||||
opts.pmSetLongOptionText("Read PCP archive: pcp collectl -a ARCHIVE [options]")
|
||||
diff --git a/src/pcp/dmcache/pcp-dmcache.py b/src/pcp/dmcache/pcp-dmcache.py
|
||||
index cd88ed4..29eb0ec 100755
|
||||
--- a/src/pcp/dmcache/pcp-dmcache.py
|
||||
+++ b/src/pcp/dmcache/pcp-dmcache.py
|
||||
@@ -155,7 +155,7 @@ class DmCachePrinter(pmcc.MetricGroupPrinter):
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
- options = pmapi.pmOptions('iR:?')
|
||||
+ options = pmapi.pmOptions('ViR:?')
|
||||
options.pmSetShortUsage('[options] [device ...]')
|
||||
options.pmSetOptionCallback(option)
|
||||
options.pmSetLongOptionHeader('Options')
|
||||
diff --git a/src/pcp/dstat/pcp-dstat.py b/src/pcp/dstat/pcp-dstat.py
|
||||
index c178874..cdd7991 100755
|
||||
--- a/src/pcp/dstat/pcp-dstat.py
|
||||
+++ b/src/pcp/dstat/pcp-dstat.py
|
||||
@@ -727,7 +727,7 @@ class DstatTool(object):
|
||||
# opts.pmSetLongOption('zones', 0, None, '', 'enable zoneinfo stats')
|
||||
opts.pmSetLongOptionText('')
|
||||
opts.pmSetLongOption('list', 0, None, '', 'list all available plugins')
|
||||
- opts.pmSetLongOption('plugin', 0, None, '', 'enable external plugin by name, see --list')
|
||||
+ opts.pmSetLongOption('<plugin-name>', 0, None, '', 'enable external plugin by name, see --list')
|
||||
opts.pmSetLongOptionText('')
|
||||
opts.pmSetLongOption('all', 0, 'a', '', 'equals -cdngy (default)')
|
||||
opts.pmSetLongOption('full', 0, 'f', '', 'automatically expand -C, -D, -I, -N and -S lists')
|
||||
@@ -785,7 +785,7 @@ class DstatTool(object):
|
||||
self.disklist = sorted([x for x in insts if x != 'total'])
|
||||
if 'total' in insts:
|
||||
self.disklist.append('total')
|
||||
- elif opt in ['--filesystem']:
|
||||
+ elif opt in ['filesystem']:
|
||||
self.plugins.append('fs')
|
||||
elif opt in ['g']:
|
||||
self.plugins.append('page')
|
||||
diff --git a/src/pcp/iostat/pcp-iostat.py b/src/pcp/iostat/pcp-iostat.py
|
||||
index bc716c2..b3a810c 100755
|
||||
--- a/src/pcp/iostat/pcp-iostat.py
|
||||
+++ b/src/pcp/iostat/pcp-iostat.py
|
||||
@@ -165,11 +165,11 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
if "t" in IostatOptions.xflag:
|
||||
heading = ('# Timestamp', 'Device',rrqmspace, 'rrqm/s',wrqmspace, 'wrqm/s',precision+5, 'r/s',precision+4,\
|
||||
'w/s',precision+6, 'rkB/s',precision+6, 'wkB/s', avgrqszspace,'avgrq-sz',precision+6, 'avgqu-sz',precision+5, \
|
||||
- 'await',precision+5, 'r_await', precision+5,'w_await',utilspace, '%util')
|
||||
+ 'await_t',precision+5, 'r_await', precision+5,'w_await',utilspace, '%util')
|
||||
else:
|
||||
heading = ('# Device',rrqmspace, 'rrqm/s',wrqmspace, 'wrqm/s',precision+5, 'r/s',precision+4, 'w/s'\
|
||||
,precision+6, 'rkB/s',precision+6, 'wkB/s', avgrqszspace,'avgrq-sz',precision+6, 'avgqu-sz',precision+5,\
|
||||
- 'await',awaitspace, 'r_await',awaitspace, 'w_await',utilspace, '%util')
|
||||
+ 'await_t',awaitspace, 'r_await',awaitspace, 'w_await',utilspace, '%util')
|
||||
print(headfmt % heading)
|
||||
|
||||
if p_rrqm == {} or p_wrqm == {} or p_r == {} or p_w == {} or \
|
||||
@@ -205,7 +205,7 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
# total active time in seconds (same units as dt)
|
||||
tot_active = (float)(c_avactive[inst] - p_avactive[inst]) / 1000.0
|
||||
|
||||
- avgrqsz = avgqsz = await = r_await = w_await = util = 0.0
|
||||
+ avgrqsz = avgqsz = await_t = r_await = w_await = util = 0.0
|
||||
|
||||
# average request size units are KB (sysstat reports in units of sectors)
|
||||
if tot_ios:
|
||||
@@ -214,9 +214,9 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
# average queue length
|
||||
avgqsz = (float)((c_ractive[inst] - p_ractive[inst]) + (c_wactive[inst] - p_wactive[inst])) / dt / 1000.0
|
||||
|
||||
- # await, r_await, w_await
|
||||
+ # await_t, r_await, w_await
|
||||
if tot_ios:
|
||||
- await = ((c_ractive[inst] - p_ractive[inst]) + (c_wactive[inst] - p_wactive[inst])) / tot_ios
|
||||
+ await_t = ((c_ractive[inst] - p_ractive[inst]) + (c_wactive[inst] - p_wactive[inst])) / tot_ios
|
||||
|
||||
if tot_rios:
|
||||
r_await = (c_ractive[inst] - p_ractive[inst]) / tot_rios
|
||||
@@ -229,7 +229,7 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
util = 100.0 * tot_active / dt
|
||||
|
||||
device = inst # prepare name for printing
|
||||
- badcounters = rrqm < 0 or wrqm < 0 or r < 0 or w < 0 or await < 0 or avgrqsz < 0 or avgqsz < 0 or util < 0
|
||||
+ badcounters = rrqm < 0 or wrqm < 0 or r < 0 or w < 0 or await_t < 0 or avgrqsz < 0 or avgqsz < 0 or util < 0
|
||||
|
||||
if "t" in IostatOptions.xflag:
|
||||
if badcounters:
|
||||
@@ -250,7 +250,7 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
if not IostatOptions.Gflag:
|
||||
print(valfmt % (timestamp, device,rrqmspace, precision, rrqm,wrqmspace,precision, wrqm,precision+5,precision,\
|
||||
r,precision+4,precision, w,precision+6,precision, rkb,precision+6,precision, wkb, avgrqszspace,precision+1 ,avgrqsz,\
|
||||
- avgrqszspace,precision+1, avgqsz,precision+5,precision, await,awaitspace,precision, r_await,awaitspace,precision,\
|
||||
+ avgrqszspace,precision+1, avgqsz,precision+5,precision, await_t,awaitspace,precision, r_await,awaitspace,precision,\
|
||||
w_await,utilspace,precision, util))
|
||||
else:
|
||||
if badcounters:
|
||||
@@ -270,7 +270,7 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
if not IostatOptions.Gflag:
|
||||
print(valfmt % (device,rrqmspace, precision, rrqm,wrqmspace,precision, wrqm,precision+5,precision, r,precision+4,\
|
||||
precision, w,precision+6,precision, rkb,precision+6,precision, wkb,\
|
||||
- avgrqszspace,precision+1 ,avgrqsz,avgrqszspace,precision+1, avgqsz,precision+5,precision, await,awaitspace,precision,\
|
||||
+ avgrqszspace,precision+1 ,avgrqsz,avgrqszspace,precision+1, avgqsz,precision+5,precision, await_t,awaitspace,precision,\
|
||||
r_await,awaitspace,precision, w_await,utilspace,precision, util))
|
||||
|
||||
if IostatOptions.Gflag and not badcounters:
|
||||
@@ -282,7 +282,7 @@ class IostatReport(pmcc.MetricGroupPrinter):
|
||||
aggr_wkb = aggregate(aggr, aggr_wkb, wkb)
|
||||
aggr_avgrqsz = aggregate(aggr, aggr_avgrqsz, avgrqsz)
|
||||
aggr_avgqsz = aggregate(aggr, aggr_avgqsz, avgqsz)
|
||||
- aggr_await = aggregate(aggr, aggr_await, await)
|
||||
+ aggr_await = aggregate(aggr, aggr_await, await_t)
|
||||
aggr_r_await = aggregate(aggr, aggr_r_await, r_await)
|
||||
aggr_w_await = aggregate(aggr, aggr_w_await, w_await)
|
||||
aggr_util = aggregate(aggr, aggr_util, util)
|
||||
diff --git a/src/pmlogconf/pmlogconf.sh b/src/pmlogconf/pmlogconf.sh
|
||||
index 44f5099..af2bf37 100755
|
||||
--- a/src/pmlogconf/pmlogconf.sh
|
||||
+++ b/src/pmlogconf/pmlogconf.sh
|
||||
@@ -161,7 +161,7 @@ _split()
|
||||
$PCP_AWK_PROG <$tmp/ctl '
|
||||
BEGIN { out = "'"$tmp/head"'" }
|
||||
/DO NOT UPDATE THE FILE ABOVE/ { seen = 1 }
|
||||
-seen == 0 && /^\#\? [^:]*:[ynx]:/ { print >"'"$tmp/tag"'"
|
||||
+seen == 0 && /^#\? [^:]*:[ynx]:/ { print >"'"$tmp/tag"'"
|
||||
out = "'"$tmp/tail"'"
|
||||
seen = 1
|
||||
next
|
||||
@@ -180,8 +180,8 @@ _update()
|
||||
$PCP_AWK_PROG <$tmp/in >$tmp/ctl '
|
||||
/DO NOT UPDATE THE FILE ABOVE/ { tail = 1 }
|
||||
tail == 1 { print; next }
|
||||
-/^\#\+ [^:]*:[ynx]:/ { sub(/\+/, "?", $1); print; skip = 1; next }
|
||||
-skip == 1 && /^\#----/ { skip = 0; next }
|
||||
+/^#\+ [^:]*:[ynx]:/ { sub(/\+/, "?", $1); print; skip = 1; next }
|
||||
+skip == 1 && /^#----/ { skip = 0; next }
|
||||
skip == 1 { next }
|
||||
{ print }'
|
||||
|
||||
diff --git a/src/pmprobe/pmprobe.c b/src/pmprobe/pmprobe.c
|
||||
index dcf1567..d6d7ab5 100644
|
||||
--- a/src/pmprobe/pmprobe.c
|
||||
+++ b/src/pmprobe/pmprobe.c
|
||||
@@ -63,7 +63,7 @@ overrides(int opt, pmOptions *opts)
|
||||
|
||||
static pmOptions opts = {
|
||||
.flags = PM_OPTFLAG_STDOUT_TZ,
|
||||
- .short_options = "a:b:D:efh:IiK:Ln:FO:VvZ:z?",
|
||||
+ .short_options = "a:b:D:defh:IiK:Ln:FO:VvZ:z?",
|
||||
.long_options = longopts,
|
||||
.short_usage = "[options] [metricname ...]",
|
||||
.override = overrides,
|
||||
diff --git a/src/pmstat/pmstat.c b/src/pmstat/pmstat.c
|
||||
index c4f9881..b3986d7 100644
|
||||
--- a/src/pmstat/pmstat.c
|
||||
+++ b/src/pmstat/pmstat.c
|
||||
@@ -371,6 +371,10 @@ main(int argc, char *argv[])
|
||||
case 'x': /* extended CPU reporting */
|
||||
extraCpuStats = 1;
|
||||
break;
|
||||
+ case 'V':
|
||||
+ pmprintf("%s version %s\n", pmGetProgname(), PCP_VERSION);
|
||||
+ opts.flags |= PM_OPTFLAG_EXIT;
|
||||
+ break;
|
||||
default:
|
||||
opts.errors++;
|
||||
break;
|
||||
@@ -387,7 +391,7 @@ main(int argc, char *argv[])
|
||||
opts.errors++;
|
||||
}
|
||||
|
||||
- if (opts.errors) {
|
||||
+ if (opts.errors || (opts.flags & PM_OPTFLAG_EXIT)) {
|
||||
pmUsageMessage(&opts);
|
||||
exit(1);
|
||||
}
|
||||
9
pcp.spec
9
pcp.spec
@ -9,7 +9,7 @@
|
||||
Name: pcp
|
||||
Version: 4.1.3
|
||||
Summary: System-level performance monitoring and performance management
|
||||
Release: 9
|
||||
Release: 10
|
||||
License: GPLv2+ and LGPLv2.1+ and CC-BY
|
||||
URL: https://pcp.io
|
||||
Source0: https://dl.bintray.com/pcp/source/pcp-4.1.3.tar.gz
|
||||
@ -17,6 +17,7 @@ Source1: https://github.com/performancecopilot/pcp-webapp-vector/archiv
|
||||
Source2: https://github.com/performancecopilot/pcp-webapp-grafana/archive/1.9.1-2/pcp-webapp-grafana-1.9.1-2.tar.gz
|
||||
Source3: https://github.com/performancecopilot/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz
|
||||
Source4: https://github.com/performancecopilot/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz
|
||||
Patch0000: 0000-Fix-some-options-and-syntax-errors.patch
|
||||
Patch6000: CVE-2019-3695-CVE-2019-3696.patch
|
||||
Patch9000: 9000-fix-new-function-not-found-when-Install.patch
|
||||
|
||||
@ -860,6 +861,7 @@ This package installs selinux support files for PCP.
|
||||
%setup -q -T -D -a 3 -c -n graphite
|
||||
%setup -q -T -D -a 4 -c -n blinkenlights
|
||||
%setup -q
|
||||
%patch0000 -p1
|
||||
%patch6000 -p1
|
||||
%patch9000 -p1
|
||||
|
||||
@ -1868,6 +1870,8 @@ fi
|
||||
/usr/lib64/libpcp_import.so.1
|
||||
/usr/lib64/libpcp_web.so.1
|
||||
%exclude /var/lib/pcp/pmns/.NeedRebuild
|
||||
%exclude /usr/libexec/pcp/bin/pcp-ipcs
|
||||
%exclude /usr/libexec/pcp/bin/pcp-lvmcache
|
||||
|
||||
%files monitor
|
||||
|
||||
@ -2215,6 +2219,9 @@ fi
|
||||
%config(noreplace) /etc/pcp/pmrep/*
|
||||
|
||||
%changelog
|
||||
* Thu Sep 16 2020 zhangjiapeng <zhangjiapeng9@huawei.com> - 4.1.3-10
|
||||
- Fix some options and syntax errors
|
||||
|
||||
* Fri Aug 28 2020 lingsheng <lingsheng@huawei.com> - 4.1.3-9
|
||||
- Fix .NeedRebuild unfound when removing rpm
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user