diff --git a/SOURCES/redhat-bugzilla-1730107.patch b/SOURCES/redhat-bugzilla-1730107.patch
new file mode 100644
index 0000000..582a2ec
--- /dev/null
+++ b/SOURCES/redhat-bugzilla-1730107.patch
@@ -0,0 +1,518 @@
+commit 29092aa58df23fcc43f813d54b16a733d19f770c
+Author: Nathan Scott <nathans@redhat.com>
+Date:   Tue Jul 16 12:28:26 2019 +1000
+
+    pmdalinux: fix hugepage metric value calculations
+    
+    The values for some of the Linux kernel hugepage metrics were
+    being incorrectly multiplied by 1024.  This was due to a code
+    assumption in proc_meminfo.c::refresh_proc_meminfo around line
+    115, which was assuming all meminfo values needed conversion
+    from kbytes to bytes - not so for these metrics.
+    
+    The fix involves removing this assumption (for all values from
+    /proc/meminfo) and individually applying unit conversion where
+    needed only.  Updated calculations are now reflected in qa/821.
+    
+    Resolves Red Hat BZ #1730107.
+
+diff --git a/qa/821.out b/qa/821.out
+index b519775e9..8ab0d47b3 100644
+--- a/qa/821.out
++++ b/qa/821.out
+@@ -5360,28 +5360,28 @@ mem.util.highTotal
+ No value(s) available!
+ 
+ mem.util.hugepagesFree
+-    value 185344
++    value 181
+ 
+ mem.util.hugepagesFreeBytes
+-    value 388694540288
++    value 379584512
+ 
+ mem.util.hugepagesRsvd
+-    value 11264
++    value 11
+ 
+ mem.util.hugepagesRsvdBytes
+-    value 23622320128
++    value 23068672
+ 
+ mem.util.hugepagesSurp
+-    value 8192
++    value 8
+ 
+ mem.util.hugepagesSurpBytes
+-    value 17179869184
++    value 16777216
+ 
+ mem.util.hugepagesTotal
+-    value 204800
++    value 200
+ 
+ mem.util.hugepagesTotalBytes
+-    value 429496729600
++    value 419430400
+ 
+ mem.util.inactive
+     value 17315560
+diff --git a/src/pmdas/linux/pmda.c b/src/pmdas/linux/pmda.c
+index f8460902b..115731a6e 100644
+--- a/src/pmdas/linux/pmda.c
++++ b/src/pmdas/linux/pmda.c
+@@ -6483,18 +6483,18 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
+ 	case 0: /* mem.physmem (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.MemTotal))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.MemTotal >> 10;
++	    atom->ull = proc_meminfo.MemTotal;
+ 	    break;
+ 	case 1: /* mem.util.used (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.MemTotal) ||
+ 	        !MEMINFO_VALID_VALUE(proc_meminfo.MemFree))
+ 		return 0; /* no values available */
+-	    atom->ull = (proc_meminfo.MemTotal - proc_meminfo.MemFree) >> 10;
++	    atom->ull = proc_meminfo.MemTotal - proc_meminfo.MemFree;
+ 	    break;
+ 	case 2: /* mem.util.free (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.MemFree))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.MemFree >> 10;
++	    atom->ull = proc_meminfo.MemFree;
+ 	    break;
+ 	case 3: /* mem.util.shared (in kbytes) */
+ 	    /*
+@@ -6504,43 +6504,43 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
+ 	     */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.MemShared))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.MemShared >> 10;
++	    atom->ull = proc_meminfo.MemShared;
+ 	    break;
+ 	case 4: /* mem.util.bufmem (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Buffers))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Buffers >> 10;
++	    atom->ull = proc_meminfo.Buffers;
+ 	    break;
+ 	case 5: /* mem.util.cached (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Cached))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Cached >> 10;
++	    atom->ull = proc_meminfo.Cached;
+ 	    break;
+ 	case 6: /* swap.length (in bytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapTotal))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.SwapTotal;
++	    atom->ull = proc_meminfo.SwapTotal << 10;
+ 	    break;
+ 	case 7: /* swap.used (in bytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapTotal) ||
+ 	        !MEMINFO_VALID_VALUE(proc_meminfo.SwapFree))
+ 		return 0; /* no values available */
+-	    atom->ull = proc_meminfo.SwapTotal - proc_meminfo.SwapFree;
++	    atom->ull = (proc_meminfo.SwapTotal - proc_meminfo.SwapFree) << 10;
+ 	    break;
+ 	case 8: /* swap.free (in bytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapFree))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.SwapFree;
++	    atom->ull = proc_meminfo.SwapFree << 10;
+ 	    break;
+ 	case 9: /* hinv.physmem (in mbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.MemTotal))
+ 	    	return 0; /* no values available */
+-	    atom->ul = proc_meminfo.MemTotal >> 20;
++	    atom->ul = proc_meminfo.MemTotal >> 10;
+ 	    break;
+ 	case 10: /* mem.freemem (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.MemFree))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.MemFree >> 10;
++	    atom->ull = proc_meminfo.MemFree;
+ 	    break;
+ 	case 11: /* hinv.pagesize (in bytes) */
+ 	    atom->ul = 1 << _pm_pageshift;
+@@ -6552,91 +6552,91 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
+ 	        !MEMINFO_VALID_VALUE(proc_meminfo.Cached) ||
+ 	        !MEMINFO_VALID_VALUE(proc_meminfo.Buffers))
+ 		return 0; /* no values available */
+-	    sl = (proc_meminfo.MemTotal -
++	    sl = proc_meminfo.MemTotal -
+ 		 proc_meminfo.MemFree -
+ 		 proc_meminfo.Cached -
+-		 proc_meminfo.Buffers) >> 10;
++		 proc_meminfo.Buffers;
+ 	    atom->ull = sl >= 0 ? sl : 0;
+ 	    break;
+ 	case 13: /* mem.util.swapCached (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapCached))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.SwapCached >> 10;
++	    atom->ull = proc_meminfo.SwapCached;
+ 	    break;
+ 	case 14: /* mem.util.active (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Active))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Active >> 10;
++	    atom->ull = proc_meminfo.Active;
+ 	    break;
+ 	case 15: /* mem.util.inactive (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Inactive))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Inactive >> 10;
++	    atom->ull = proc_meminfo.Inactive;
+ 	    break;
+ 	case 16: /* mem.util.highTotal (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.HighTotal))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.HighTotal >> 10;
++	    atom->ull = proc_meminfo.HighTotal;
+ 	    break;
+ 	case 17: /* mem.util.highFree (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.HighFree))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.HighFree >> 10;
++	    atom->ull = proc_meminfo.HighFree;
+ 	    break;
+ 	case 18: /* mem.util.lowTotal (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.LowTotal))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.LowTotal >> 10;
++	    atom->ull = proc_meminfo.LowTotal;
+ 	    break;
+ 	case 19: /* mem.util.lowFree (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.LowFree))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.LowFree >> 10;
++	    atom->ull = proc_meminfo.LowFree;
+ 	    break;
+ 	case 20: /* mem.util.swapTotal (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapTotal))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.SwapTotal >> 10;
++	    atom->ull = proc_meminfo.SwapTotal;
+ 	    break;
+ 	case 21: /* mem.util.swapFree (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapFree))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.SwapFree >> 10;
++	    atom->ull = proc_meminfo.SwapFree;
+ 	    break;
+ 	case 22: /* mem.util.dirty (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Dirty))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Dirty >> 10;
++	    atom->ull = proc_meminfo.Dirty;
+ 	    break;
+ 	case 23: /* mem.util.writeback (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Writeback))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Writeback >> 10;
++	    atom->ull = proc_meminfo.Writeback;
+ 	    break;
+ 	case 24: /* mem.util.mapped (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Mapped))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Mapped >> 10;
++	    atom->ull = proc_meminfo.Mapped;
+ 	    break;
+ 	case 25: /* mem.util.slab (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Slab))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Slab >> 10;
++	    atom->ull = proc_meminfo.Slab;
+ 	    break;
+ 	case 26: /* mem.util.committed_AS (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Committed_AS))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.Committed_AS >> 10;
++	    atom->ull = proc_meminfo.Committed_AS;
+ 	    break;
+ 	case 27: /* mem.util.pageTables (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.PageTables))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.PageTables >> 10;
++	    atom->ull = proc_meminfo.PageTables;
+ 	    break;
+ 	case 28: /* mem.util.reverseMaps (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.ReverseMaps))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.ReverseMaps >> 10;
++	    atom->ull = proc_meminfo.ReverseMaps;
+ 	    break;
+ 	case 29: /* mem.util.cache_clean (in kbytes) */
+ 	    /* clean=cached-(dirty+writeback) */
+@@ -6644,180 +6644,184 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
+ 	        !MEMINFO_VALID_VALUE(proc_meminfo.Dirty) ||
+ 	        !MEMINFO_VALID_VALUE(proc_meminfo.Writeback))
+ 	    	return 0; /* no values available */
+-	    sl = (proc_meminfo.Cached -
++	    sl = proc_meminfo.Cached -
+ 	    	 proc_meminfo.Dirty -
+-	    	 proc_meminfo.Writeback) >> 10;
++	    	 proc_meminfo.Writeback;
+ 	    atom->ull = sl >= 0 ? sl : 0;
+ 	    break;
+ 	case 30: /* mem.util.anonpages */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.AnonPages))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.AnonPages >> 10;
++	   atom->ull = proc_meminfo.AnonPages;
+ 	   break;
+ 	case 31: /* mem.util.commitLimit (in kbytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.CommitLimit))
+ 	    	return 0; /* no values available */
+-	    atom->ull = proc_meminfo.CommitLimit >> 10;
++	    atom->ull = proc_meminfo.CommitLimit;
+ 	    break;
+ 	case 32: /* mem.util.bounce */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Bounce))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Bounce >> 10;
++	   atom->ull = proc_meminfo.Bounce;
+ 	   break;
+ 	case 33: /* mem.util.NFS_Unstable */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.NFS_Unstable))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.NFS_Unstable >> 10;
++	   atom->ull = proc_meminfo.NFS_Unstable;
+ 	   break;
+ 	case 34: /* mem.util.slabReclaimable */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.SlabReclaimable))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.SlabReclaimable >> 10;
++	   atom->ull = proc_meminfo.SlabReclaimable;
+ 	   break;
+ 	case 35: /* mem.util.slabUnreclaimable */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.SlabUnreclaimable))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.SlabUnreclaimable >> 10;
++	   atom->ull = proc_meminfo.SlabUnreclaimable;
+ 	   break;
+ 	case 36: /* mem.util.active_anon */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Active_anon))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Active_anon >> 10;
++	   atom->ull = proc_meminfo.Active_anon;
+ 	   break;
+ 	case 37: /* mem.util.inactive_anon */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Inactive_anon))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Inactive_anon >> 10;
++	   atom->ull = proc_meminfo.Inactive_anon;
+ 	   break;
+ 	case 38: /* mem.util.active_file */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Active_file))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Active_file >> 10;
++	   atom->ull = proc_meminfo.Active_file;
+ 	   break;
+ 	case 39: /* mem.util.inactive_file */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Inactive_file))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Inactive_file >> 10;
++	   atom->ull = proc_meminfo.Inactive_file;
+ 	   break;
+ 	case 40: /* mem.util.unevictable */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Unevictable))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Unevictable >> 10;
++	   atom->ull = proc_meminfo.Unevictable;
+ 	   break;
+ 	case 41: /* mem.util.mlocked */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Mlocked))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Mlocked >> 10;
++	   atom->ull = proc_meminfo.Mlocked;
+ 	   break;
+ 	case 42: /* mem.util.shmem */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Shmem))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Shmem >> 10;
++	   atom->ull = proc_meminfo.Shmem;
+ 	   break;
+ 	case 43: /* mem.util.kernelStack */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.KernelStack))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.KernelStack >> 10;
++	   atom->ull = proc_meminfo.KernelStack;
+ 	   break;
+-	case 44: /* mem.util.hugepagesTotal */
++	case 44: /* mem.util.hugepagesTotal (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesTotal))
+ 		return 0; /* no values available */
+ 	   atom->ull = proc_meminfo.HugepagesTotal;
+ 	   break;
+-	case 45: /* mem.util.hugepagesFree */
++	case 45: /* mem.util.hugepagesFree (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesFree))
+ 		return 0; /* no values available */
+ 	   atom->ull = proc_meminfo.HugepagesFree;
+ 	   break;
+-	case 46: /* mem.util.hugepagesRsvd */
++	case 46: /* mem.util.hugepagesRsvd (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesRsvd))
+ 		return 0; /* no values available */
+ 	   atom->ull = proc_meminfo.HugepagesRsvd;
+ 	   break;
+-	case 47: /* mem.util.hugepagesSurp */
++	case 47: /* mem.util.hugepagesSurp (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesSurp))
+ 		return 0; /* no values available */
+ 	   atom->ull = proc_meminfo.HugepagesSurp;
+ 	   break;
+-	case 48: /* mem.util.directMap4k */
++	case 48: /* mem.util.directMap4k (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.directMap4k))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.directMap4k >> 10;
++	   atom->ull = proc_meminfo.directMap4k;
+ 	   break;
+-	case 49: /* mem.util.directMap2M */
++	case 49: /* mem.util.directMap2M (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.directMap2M))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.directMap2M >> 10;
++	   atom->ull = proc_meminfo.directMap2M;
+ 	   break;
+-	case 50: /* mem.util.vmallocTotal */
++	case 50: /* mem.util.vmallocTotal (in kbytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.VmallocTotal))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.VmallocTotal >> 10;
++	   atom->ull = proc_meminfo.VmallocTotal;
+ 	   break;
+-	case 51: /* mem.util.vmallocUsed */
++	case 51: /* mem.util.vmallocUsed (in kbytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.VmallocUsed))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.VmallocUsed >> 10;
++	   atom->ull = proc_meminfo.VmallocUsed;
+ 	   break;
+-	case 52: /* mem.util.vmallocChunk */
++	case 52: /* mem.util.vmallocChunk (in kbytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.VmallocChunk))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.VmallocChunk >> 10;
++	   atom->ull = proc_meminfo.VmallocChunk;
+ 	   break;
+-	case 53: /* mem.util.mmap_copy */
++	case 53: /* mem.util.mmap_copy (in kbytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.MmapCopy))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.MmapCopy >> 10;
++	   atom->ull = proc_meminfo.MmapCopy;
+ 	   break;
+-	case 54: /* mem.util.quicklists */
++	case 54: /* mem.util.quicklists (in kbytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.Quicklists))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.Quicklists >> 10;
++	   atom->ull = proc_meminfo.Quicklists;
+ 	   break;
+-	case 55: /* mem.util.corrupthardware */
++	case 55: /* mem.util.corrupthardware (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HardwareCorrupted))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.HardwareCorrupted >> 10;
++	   atom->ull = proc_meminfo.HardwareCorrupted;
+ 	   break;
+-	case 56: /* mem.util.anonhugepages */
++	case 56: /* mem.util.anonhugepages (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.AnonHugePages))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.AnonHugePages >> 10;
++	   atom->ull = proc_meminfo.AnonHugePages;
+ 	   break;
+-	case 57: /* mem.util.directMap1G */
++	case 57: /* mem.util.directMap1G (in pages) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.directMap1G))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.directMap1G >> 10;
++	   atom->ull = proc_meminfo.directMap1G;
+ 	   break;
+-	case 58: /* mem.util.available */
++	case 58: /* mem.util.available (in kbytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.MemAvailable))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.MemAvailable >> 10;
++	   atom->ull = proc_meminfo.MemAvailable;
+ 	   break;
+ 	case 59: /* hinv.hugepagesize (in bytes) */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
+ 	    	return 0; /* no values available */
+-	    atom->ul = proc_meminfo.Hugepagesize;
++	    atom->ul = (proc_meminfo.Hugepagesize << 10);
+ 	    break;
+-	case 60: /* mem.util.hugepagesTotalBytes */
++	case 60: /* mem.util.hugepagesTotalBytes (in bytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesTotal))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.HugepagesTotal * proc_meminfo.Hugepagesize;
++	   atom->ull = proc_meminfo.HugepagesTotal *
++			(proc_meminfo.Hugepagesize << 10);
+ 	   break;
+-	case 61: /* mem.util.hugepagesFreeBytes */
++	case 61: /* mem.util.hugepagesFreeBytes (in bytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesFree))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.HugepagesFree * proc_meminfo.Hugepagesize;
++	   atom->ull = proc_meminfo.HugepagesFree *
++			(proc_meminfo.Hugepagesize << 10);
+ 	   break;
+-	case 62: /* mem.util.hugepagesRsvdBytes */
++	case 62: /* mem.util.hugepagesRsvdBytes (in bytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesRsvd))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.HugepagesRsvd * proc_meminfo.Hugepagesize;
++	   atom->ull = proc_meminfo.HugepagesRsvd *
++			(proc_meminfo.Hugepagesize << 10);
+ 	   break;
+-	case 63: /* mem.util.hugepagesSurpBytes */
++	case 63: /* mem.util.hugepagesSurpBytes (in bytes) */
+ 	   if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesSurp))
+ 		return 0; /* no values available */
+-	   atom->ull = proc_meminfo.HugepagesSurp * proc_meminfo.Hugepagesize;
++	   atom->ull = proc_meminfo.HugepagesSurp *
++			(proc_meminfo.Hugepagesize << 10);
+ 	   break;
+ 	default:
+ 	    return PM_ERR_PMID;
+@@ -7825,19 +7829,19 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
+ 	    	return 0; /* no values available */
+ 	    sts = linux_table_lookup("HugePages_Total:", np->meminfo, &atom->ull);
+-	    atom->ull *= proc_meminfo.Hugepagesize;
++	    atom->ull *= (proc_meminfo.Hugepagesize << 10);
+ 	    break;
+ 	case 40: /* mem.numa.util.hugepagesFreeBytes */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
+ 	    	return 0; /* no values available */
+ 	    sts = linux_table_lookup("HugePages_Free:", np->meminfo, &atom->ull);
+-	    atom->ull *= proc_meminfo.Hugepagesize;
++	    atom->ull *= (proc_meminfo.Hugepagesize << 10);
+ 	    break;
+ 	case 41: /* mem.numa.util.hugepagesSurpBytes */
+ 	    if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
+ 	    	return 0; /* no values available */
+ 	    sts = linux_table_lookup("HugePages_Surp:", np->meminfo, &atom->ull);
+-	    atom->ull *= proc_meminfo.Hugepagesize;
++	    atom->ull *= (proc_meminfo.Hugepagesize << 10);
+ 	    break;
+ 
+ 	default:
+diff --git a/src/pmdas/linux/proc_meminfo.c b/src/pmdas/linux/proc_meminfo.c
+index a3270e3ed..c5011ceb8 100644
+--- a/src/pmdas/linux/proc_meminfo.c
++++ b/src/pmdas/linux/proc_meminfo.c
+@@ -113,7 +113,6 @@ refresh_proc_meminfo(proc_meminfo_t *proc_meminfo)
+ 	    for (bufp++; *bufp; bufp++) {
+ 	    	if (isdigit((int)*bufp)) {
+ 		    sscanf(bufp, "%llu", (unsigned long long *)p);
+-		    *p *= 1024; /* kbytes -> bytes */
+ 		    break;
+ 		}
+ 	    }
diff --git a/SOURCES/redhat-bugzilla-1730492.patch b/SOURCES/redhat-bugzilla-1730492.patch
new file mode 100644
index 0000000..32a691d
--- /dev/null
+++ b/SOURCES/redhat-bugzilla-1730492.patch
@@ -0,0 +1,985 @@
+diff -Naurp pcp-4.3.2.wip/qa/1393 pcp-4.3.2/qa/1393
+--- pcp-4.3.2.wip/qa/1393	1970-01-01 10:00:00.000000000 +1000
++++ pcp-4.3.2/qa/1393	2020-02-17 17:29:39.572489770 +1100
+@@ -0,0 +1,64 @@
++#!/bin/sh
++# PCP QA Test No. 1393
++# Test sparse and non-contiguous numa-nodes and CPUs
++# RHBZ#1730492 - Some numa nodes have no instances.
++#
++# Copyright (c) 2019 Red Hat.  All Rights Reserved.
++#
++
++seq=`basename $0`
++echo "QA output created by $seq"
++
++# get standard environment, filters and checks
++. ./common.product
++. ./common.filter
++. ./common.check
++
++[ $PCP_PLATFORM = linux ] || _notrun "Linux-specific PMDA testing"
++
++_cleanup()
++{
++    cd $here
++    $sudo rm -rf $tmp $tmp.*
++}
++
++status=1	# failure is the default!
++$sudo rm -rf $tmp $tmp.* $seq.full
++trap "_cleanup; exit \$status" 0 1 2 3 15
++
++_sort_instname()
++{
++    tee $tmp.sort | sed -n 2p
++    awk '/inst / {print "  ", $4, $6}' $tmp.sort | sed -e 's/\]//' | LC_COLLATE=POSIX sort
++}
++
++# real QA test starts here
++mkdir -p $tmp
++tar -C $tmp -xf linux/sysfs-numa-001.tgz
++pmda=$PCP_PMDAS_DIR/linux/pmda_linux.$DSO_SUFFIX,linux_init
++export LINUX_STATSPATH="$tmp"
++
++metrics="hinv.map.cpu_node hinv.node.online \
++  kernel.percpu.cpu.idle kernel.percpu.cpu.user kernel.pernode.cpu.idle \
++  kernel.pernode.cpu.user mem.numa.alloc.local_node mem.numa.util.total \
++  mem.numa.util.free mem.numa.util.used"
++
++echo == check basic numa metrics 4 nodes, 8 CPUs
++pminfo -L -K clear -K add,60,$pmda -f hinv.nnode hinv.ncpu
++for m in $metrics; do pminfo -L -K clear -K add,60,$pmda -f $m| _sort_instname; done
++
++echo;echo ==;echo == delete node2, leaving node0, node1 and node3;echo ==
++rm -rf $LINUX_STATSPATH/sys/devices/system/node/node2
++rm -rf $LINUX_STATSPATH/sys/devices/system/memory/memory*/node2
++echo '0,1,3' >$LINUX_STATSPATH/sys/devices/system/node/online
++echo '0,1,3' >$LINUX_STATSPATH/sys/devices/system/node/possible
++rm -rf $LINUX_STATSPATH/sys/devices/system/cpu/cpu{4,5}
++sed -i '/^cpu[45]$/d' $LINUX_STATSPATH/proc/stat
++echo '0,1,2,3,6,7' >$LINUX_STATSPATH/sys/devices/system/cpu/online
++echo '0,1,2,3,6,7' >$LINUX_STATSPATH/sys/devices/system/cpu/present
++pminfo -L -K clear -K add,60,$pmda -f hinv.nnode hinv.ncpu
++for m in $metrics; do pminfo -L -K clear -K add,60,$pmda -f $m| _sort_instname; done
++
++# success, all done
++status=0
++exit
+diff -Naurp pcp-4.3.2.wip/qa/1393.out pcp-4.3.2/qa/1393.out
+--- pcp-4.3.2.wip/qa/1393.out	1970-01-01 10:00:00.000000000 +1000
++++ pcp-4.3.2/qa/1393.out	2020-02-17 17:28:43.162140076 +1100
+@@ -0,0 +1,129 @@
++QA output created by 1393
++== check basic numa metrics 4 nodes, 8 CPUs
++
++hinv.nnode
++    value 4
++
++hinv.ncpu
++    value 8
++hinv.map.cpu_node
++   "cpu0" 0
++   "cpu1" 0
++   "cpu2" 1
++   "cpu3" 1
++   "cpu4" 2
++   "cpu5" 2
++   "cpu6" 3
++   "cpu7" 3
++hinv.node.online
++   "node0" 1
++   "node1" 1
++   "node2" 1
++   "node3" 1
++kernel.percpu.cpu.idle
++   "cpu0" 82176250
++   "cpu1" 82246600
++   "cpu2" 82152810
++   "cpu3" 82283820
++   "cpu4" 82098120
++   "cpu5" 82009220
++   "cpu6" 82276330
++   "cpu7" 82191150
++kernel.percpu.cpu.user
++   "cpu0" 373300
++   "cpu1" 349760
++   "cpu2" 363240
++   "cpu3" 369770
++   "cpu4" 412040
++   "cpu5" 419270
++   "cpu6" 344030
++   "cpu7" 433650
++kernel.pernode.cpu.idle
++   "node0" 164422850
++   "node1" 164436630
++   "node2" 164107340
++   "node3" 164467480
++kernel.pernode.cpu.user
++   "node0" 723060
++   "node1" 733010
++   "node2" 831310
++   "node3" 777680
++mem.numa.alloc.local_node
++   "node0" 32241822
++   "node1" 32048777
++   "node2" 35574473
++   "node3" 32921660
++mem.numa.util.total
++   "node0" 1030924
++   "node1" 1031416
++   "node2" 965616
++   "node3" 1006408
++mem.numa.util.free
++   "node0" 354088
++   "node1" 557252
++   "node2" 229456
++   "node3" 271916
++mem.numa.util.used
++   "node0" 676836
++   "node1" 474164
++   "node2" 736160
++   "node3" 734492
++
++==
++== delete node2, leaving node0, node1 and node3
++==
++
++hinv.nnode
++    value 3
++
++hinv.ncpu
++    value 6
++hinv.map.cpu_node
++   "cpu0" 0
++   "cpu1" 0
++   "cpu2" 1
++   "cpu3" 1
++   "cpu6" 3
++   "cpu7" 3
++hinv.node.online
++   "node0" 1
++   "node1" 1
++   "node3" 1
++kernel.percpu.cpu.idle
++   "cpu0" 82176250
++   "cpu1" 82246600
++   "cpu2" 82152810
++   "cpu3" 82283820
++   "cpu6" 82276330
++   "cpu7" 82191150
++kernel.percpu.cpu.user
++   "cpu0" 373300
++   "cpu1" 349760
++   "cpu2" 363240
++   "cpu3" 369770
++   "cpu6" 344030
++   "cpu7" 433650
++kernel.pernode.cpu.idle
++   "node0" 164422850
++   "node1" 164436630
++   "node3" 164467480
++kernel.pernode.cpu.user
++   "node0" 723060
++   "node1" 733010
++   "node3" 777680
++mem.numa.alloc.local_node
++   "node0" 32241822
++   "node1" 32048777
++   "node3" 32921660
++mem.numa.util.total
++   "node0" 1030924
++   "node1" 1031416
++   "node3" 1006408
++mem.numa.util.free
++   "node0" 354088
++   "node1" 557252
++   "node3" 271916
++mem.numa.util.used
++   "node0" 676836
++   "node1" 474164
++   "node3" 734492
+diff -Naurp pcp-4.3.2.wip/qa/747 pcp-4.3.2/qa/747
+--- pcp-4.3.2.wip/qa/747	2017-11-30 12:48:48.000000000 +1100
++++ pcp-4.3.2/qa/747	2020-02-17 17:28:43.161140088 +1100
+@@ -19,27 +19,10 @@ status=1	# failure is the default!
+ $sudo rm -rf $tmp.* $seq.full
+ trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
+ 
+-# deal with non-determinism in the order in which the per cpu indom
+-# is populated
+-# input is assumed to be in the format ...
+-# 	head ...
+-# 	stuff to fix ...
+-# 	tail ...
+-#
+-_fix_percpu_indom()
++_sort_instname()
+ {
+-    rm -f $tmp.head $tmp.percpu $tmp.tail
+-    $PCP_AWK_PROG '
+-/^hinv\.cpu\.online/		{ state = 1 }
+-/^kernel\.percpu\./		{ state = 1 }
+-state == 0			{ print >"'"$tmp.head"'"; next }
+-state == 1			{ print >"'"$tmp.percpu"'" }
+-state == 2			{ print >"'"$tmp.tail"'"; next }
+-state == 1 && NF == 0		{ state = 2 }'
+-    [ -f $tmp.head ] && cat $tmp.head
+-    [ -f $tmp.percpu ] && $here/src/sortinst -i <$tmp.percpu \
+-			  | sed -e 's/cpu[0-9][0-9]*/cpuN/'
+-    [ -f $tmp.tail ] && cat $tmp.tail
++    tee $tmp.sort | sed -n 2p
++    awk '/inst / {print "  ", $4, $6}' $tmp.sort | sed -e 's/\]//' | LC_COLLATE=POSIX sort
+ }
+ 
+ # real QA test starts here
+@@ -54,7 +37,7 @@ allcpu_metrics=`pminfo $local kernel.all
+ percpu_metrics=`pminfo $local kernel.percpu.cpu | LC_COLLATE=POSIX sort`
+ pernode_metrics=`pminfo $local kernel.pernode.cpu | LC_COLLATE=POSIX sort`
+ 
+-for tgz in $here/linux/sysdev-*.tgz
++for tgz in $here/linux/sysdev-*.tgz $here/linux/sysfs-numa-001.tgz
+ do
+     rm -fr $root
+     mkdir $root || _fail "root in use when processing $tgz"
+@@ -65,7 +48,7 @@ do
+     echo "== Checking hinv metric values - $base"
+     for m in $hinv_metrics
+     do
+-	pminfo $local -f $m | _fix_percpu_indom
++	pminfo $local -f $m | _sort_instname
+     done
+     echo && echo "== done" && echo
+ 
+@@ -76,12 +59,15 @@ do
+     echo "== Checking per-CPU metric values - $base"
+     for m in $percpu_metrics
+     do
+-	pminfo $local -f $m | _fix_percpu_indom
++	pminfo $local -f $m | _sort_instname
+     done
+     echo && echo "== done" && echo
+ 
+     echo "== Checking per-node CPU metric values - $base"
+-    pminfo $local -f $pernode_metrics
++    for m in $pernode_metrics
++    do
++	pminfo $local -f $m | _sort_instname
++    done
+     echo && echo "== done" && echo
+ 
+     cd $here
+diff -Naurp pcp-4.3.2.wip/qa/747.out pcp-4.3.2/qa/747.out
+--- pcp-4.3.2.wip/qa/747.out	2017-11-30 12:48:48.000000000 +1100
++++ pcp-4.3.2/qa/747.out	2020-02-17 17:28:43.161140088 +1100
+@@ -1,14 +1,12 @@
+ QA output created by 747
+ == Checking hinv metric values - sysdev-root-001.tgz
+-
+ hinv.cpu.online
+-    inst [0 or "cpuN"] value 1
+-    inst [1 or "cpuN"] value 1
+-    inst [2 or "cpuN"] value 0
+-    inst [3 or "cpuN"] value 1
+-
++   "cpu0" 1
++   "cpu1" 1
++   "cpu2" 0
++   "cpu3" 1
+ hinv.node.online
+-    inst [0 or "node0"] value 1
++   "node0" 1
+ 
+ == done
+ 
+@@ -56,127 +54,352 @@ kernel.all.cpu.wait.total
+ == done
+ 
+ == Checking per-CPU metric values - sysdev-root-001.tgz
+-
+ kernel.percpu.cpu.guest
+-    inst [0 or "cpuN"] value 20
+-    inst [1 or "cpuN"] value 0
+-    inst [2 or "cpuN"] value 0
+-    inst [3 or "cpuN"] value 0
+-
++   "cpu0" 20
++   "cpu1" 0
++   "cpu2" 0
++   "cpu3" 0
+ kernel.percpu.cpu.guest_nice
+-    inst [0 or "cpuN"] value 30
+-    inst [1 or "cpuN"] value 0
+-    inst [2 or "cpuN"] value 0
+-    inst [3 or "cpuN"] value 0
+-
++   "cpu0" 30
++   "cpu1" 0
++   "cpu2" 0
++   "cpu3" 0
+ kernel.percpu.cpu.idle
+-    inst [0 or "cpuN"] value 286728520
+-    inst [1 or "cpuN"] value 286695100
+-    inst [2 or "cpuN"] value 286198490
+-    inst [3 or "cpuN"] value 287003820
+-
++   "cpu0" 286728520
++   "cpu1" 286695100
++   "cpu2" 286198490
++   "cpu3" 287003820
+ kernel.percpu.cpu.intr
+-    inst [0 or "cpuN"] value 36540
+-    inst [1 or "cpuN"] value 25500
+-    inst [2 or "cpuN"] value 51900
+-    inst [3 or "cpuN"] value 31930
+-
++   "cpu0" 36540
++   "cpu1" 25500
++   "cpu2" 51900
++   "cpu3" 31930
+ kernel.percpu.cpu.irq.hard
+-    inst [0 or "cpuN"] value 13940
+-    inst [1 or "cpuN"] value 10830
+-    inst [2 or "cpuN"] value 18940
+-    inst [3 or "cpuN"] value 12030
+-
++   "cpu0" 13940
++   "cpu1" 10830
++   "cpu2" 18940
++   "cpu3" 12030
+ kernel.percpu.cpu.irq.soft
+-    inst [0 or "cpuN"] value 22600
+-    inst [1 or "cpuN"] value 14670
+-    inst [2 or "cpuN"] value 32960
+-    inst [3 or "cpuN"] value 19900
+-
++   "cpu0" 22600
++   "cpu1" 14670
++   "cpu2" 32960
++   "cpu3" 19900
+ kernel.percpu.cpu.nice
+-    inst [0 or "cpuN"] value 4620
+-    inst [1 or "cpuN"] value 1380
+-    inst [2 or "cpuN"] value 630
+-    inst [3 or "cpuN"] value 550
+-
++   "cpu0" 4620
++   "cpu1" 1380
++   "cpu2" 630
++   "cpu3" 550
+ kernel.percpu.cpu.steal
+-    inst [0 or "cpuN"] value 10
+-    inst [1 or "cpuN"] value 0
+-    inst [2 or "cpuN"] value 0
+-    inst [3 or "cpuN"] value 0
+-
++   "cpu0" 10
++   "cpu1" 0
++   "cpu2" 0
++   "cpu3" 0
+ kernel.percpu.cpu.sys
+-    inst [0 or "cpuN"] value 105050
+-    inst [1 or "cpuN"] value 146320
+-    inst [2 or "cpuN"] value 109360
+-    inst [3 or "cpuN"] value 146920
+-
++   "cpu0" 105050
++   "cpu1" 146320
++   "cpu2" 109360
++   "cpu3" 146920
+ kernel.percpu.cpu.user
+-    inst [0 or "cpuN"] value 101190
+-    inst [1 or "cpuN"] value 359270
+-    inst [2 or "cpuN"] value 113190
+-    inst [3 or "cpuN"] value 275520
+-
++   "cpu0" 101190
++   "cpu1" 359270
++   "cpu2" 113190
++   "cpu3" 275520
+ kernel.percpu.cpu.vnice
+-    inst [0 or "cpuN"] value 4590
+-    inst [1 or "cpuN"] value 1380
+-    inst [2 or "cpuN"] value 630
+-    inst [3 or "cpuN"] value 550
+-
++   "cpu0" 4590
++   "cpu1" 1380
++   "cpu2" 630
++   "cpu3" 550
+ kernel.percpu.cpu.vuser
+-    inst [0 or "cpuN"] value 101170
+-    inst [1 or "cpuN"] value 359270
+-    inst [2 or "cpuN"] value 113190
+-    inst [3 or "cpuN"] value 275520
+-
++   "cpu0" 101170
++   "cpu1" 359270
++   "cpu2" 113190
++   "cpu3" 275520
+ kernel.percpu.cpu.wait.total
+-    inst [0 or "cpuN"] value 877160
+-    inst [1 or "cpuN"] value 649420
+-    inst [2 or "cpuN"] value 1373400
+-    inst [3 or "cpuN"] value 420180
++   "cpu0" 877160
++   "cpu1" 649420
++   "cpu2" 1373400
++   "cpu3" 420180
+ 
+ == done
+ 
+ == Checking per-node CPU metric values - sysdev-root-001.tgz
+-
+ kernel.pernode.cpu.guest
+-    inst [0 or "node0"] value 20
+-
++   "node0" 20
+ kernel.pernode.cpu.guest_nice
+-    inst [0 or "node0"] value 30
+-
++   "node0" 30
+ kernel.pernode.cpu.idle
+-    inst [0 or "node0"] value 1146625930
+-
++   "node0" 1146625930
+ kernel.pernode.cpu.intr
+-    inst [0 or "node0"] value 145870
+-
++   "node0" 145870
+ kernel.pernode.cpu.irq.hard
+-    inst [0 or "node0"] value 55740
+-
++   "node0" 55740
+ kernel.pernode.cpu.irq.soft
+-    inst [0 or "node0"] value 90130
+-
++   "node0" 90130
+ kernel.pernode.cpu.nice
+-    inst [0 or "node0"] value 7180
+-
++   "node0" 7180
+ kernel.pernode.cpu.steal
+-    inst [0 or "node0"] value 10
+-
++   "node0" 10
+ kernel.pernode.cpu.sys
+-    inst [0 or "node0"] value 507650
+-
++   "node0" 507650
+ kernel.pernode.cpu.user
+-    inst [0 or "node0"] value 849170
+-
++   "node0" 849170
+ kernel.pernode.cpu.vnice
+-    inst [0 or "node0"] value 7150
+-
++   "node0" 7150
+ kernel.pernode.cpu.vuser
+-    inst [0 or "node0"] value 849150
++   "node0" 849150
++kernel.pernode.cpu.wait.total
++   "node0" 3320160
++
++== done
++
++== Checking hinv metric values - sysfs-numa-001.tgz
++hinv.cpu.online
++   "cpu0" 1
++   "cpu1" 1
++   "cpu2" 1
++   "cpu3" 1
++   "cpu4" 1
++   "cpu5" 1
++   "cpu6" 1
++   "cpu7" 1
++hinv.node.online
++   "node0" 1
++   "node1" 1
++   "node2" 1
++   "node3" 1
++
++== done
++
++== Checking aggregate CPU metric values - sysfs-numa-001.tgz
++
++kernel.all.cpu.guest
++    value 0
++
++kernel.all.cpu.guest_nice
++    value 0
++
++kernel.all.cpu.idle
++    value 657434330
++
++kernel.all.cpu.intr
++    value 368500
++
++kernel.all.cpu.irq.hard
++    value 252590
+ 
++kernel.all.cpu.irq.soft
++    value 115910
++
++kernel.all.cpu.nice
++    value 41160
++
++kernel.all.cpu.steal
++    value 143770
++
++kernel.all.cpu.sys
++    value 1200190
++
++kernel.all.cpu.user
++    value 3065100
++
++kernel.all.cpu.vnice
++    value 41160
++
++kernel.all.cpu.vuser
++    value 3065100
++
++kernel.all.cpu.wait.total
++    value 979420
++
++== done
++
++== Checking per-CPU metric values - sysfs-numa-001.tgz
++kernel.percpu.cpu.guest
++   "cpu0" 0
++   "cpu1" 0
++   "cpu2" 0
++   "cpu3" 0
++   "cpu4" 0
++   "cpu5" 0
++   "cpu6" 0
++   "cpu7" 0
++kernel.percpu.cpu.guest_nice
++   "cpu0" 0
++   "cpu1" 0
++   "cpu2" 0
++   "cpu3" 0
++   "cpu4" 0
++   "cpu5" 0
++   "cpu6" 0
++   "cpu7" 0
++kernel.percpu.cpu.idle
++   "cpu0" 82176250
++   "cpu1" 82246600
++   "cpu2" 82152810
++   "cpu3" 82283820
++   "cpu4" 82098120
++   "cpu5" 82009220
++   "cpu6" 82276330
++   "cpu7" 82191150
++kernel.percpu.cpu.intr
++   "cpu0" 31120
++   "cpu1" 27570
++   "cpu2" 65310
++   "cpu3" 32900
++   "cpu4" 30160
++   "cpu5" 74500
++   "cpu6" 69300
++   "cpu7" 37570
++kernel.percpu.cpu.irq.hard
++   "cpu0" 18700
++   "cpu1" 18690
++   "cpu2" 42080
++   "cpu3" 22020
++   "cpu4" 19450
++   "cpu5" 49820
++   "cpu6" 57240
++   "cpu7" 24550
++kernel.percpu.cpu.irq.soft
++   "cpu0" 12420
++   "cpu1" 8880
++   "cpu2" 23230
++   "cpu3" 10880
++   "cpu4" 10710
++   "cpu5" 24680
++   "cpu6" 12060
++   "cpu7" 13020
++kernel.percpu.cpu.nice
++   "cpu0" 2920
++   "cpu1" 3150
++   "cpu2" 2220
++   "cpu3" 4210
++   "cpu4" 7660
++   "cpu5" 9690
++   "cpu6" 2090
++   "cpu7" 9170
++kernel.percpu.cpu.steal
++   "cpu0" 16870
++   "cpu1" 13990
++   "cpu2" 26210
++   "cpu3" 17510
++   "cpu4" 15000
++   "cpu5" 16110
++   "cpu6" 18960
++   "cpu7" 19090
++kernel.percpu.cpu.sys
++   "cpu0" 124510
++   "cpu1" 156270
++   "cpu2" 125800
++   "cpu3" 133860
++   "cpu4" 189540
++   "cpu5" 192970
++   "cpu6" 133390
++   "cpu7" 143810
++kernel.percpu.cpu.user
++   "cpu0" 373300
++   "cpu1" 349760
++   "cpu2" 363240
++   "cpu3" 369770
++   "cpu4" 412040
++   "cpu5" 419270
++   "cpu6" 344030
++   "cpu7" 433650
++kernel.percpu.cpu.vnice
++   "cpu0" 2920
++   "cpu1" 3150
++   "cpu2" 2220
++   "cpu3" 4210
++   "cpu4" 7660
++   "cpu5" 9690
++   "cpu6" 2090
++   "cpu7" 9170
++kernel.percpu.cpu.vuser
++   "cpu0" 373300
++   "cpu1" 349760
++   "cpu2" 363240
++   "cpu3" 369770
++   "cpu4" 412040
++   "cpu5" 419270
++   "cpu6" 344030
++   "cpu7" 433650
++kernel.percpu.cpu.wait.total
++   "cpu0" 179200
++   "cpu1" 105950
++   "cpu2" 88480
++   "cpu3" 79880
++   "cpu4" 166720
++   "cpu5" 196030
++   "cpu6" 78000
++   "cpu7" 85130
++
++== done
++
++== Checking per-node CPU metric values - sysfs-numa-001.tgz
++kernel.pernode.cpu.guest
++   "node0" 0
++   "node1" 0
++   "node2" 0
++   "node3" 0
++kernel.pernode.cpu.guest_nice
++   "node0" 0
++   "node1" 0
++   "node2" 0
++   "node3" 0
++kernel.pernode.cpu.idle
++   "node0" 164422850
++   "node1" 164436630
++   "node2" 164107340
++   "node3" 164467480
++kernel.pernode.cpu.intr
++   "node0" 58690
++   "node1" 98210
++   "node2" 104660
++   "node3" 106870
++kernel.pernode.cpu.irq.hard
++   "node0" 37390
++   "node1" 64100
++   "node2" 69270
++   "node3" 81790
++kernel.pernode.cpu.irq.soft
++   "node0" 21300
++   "node1" 34110
++   "node2" 35390
++   "node3" 25080
++kernel.pernode.cpu.nice
++   "node0" 6070
++   "node1" 6430
++   "node2" 17350
++   "node3" 11260
++kernel.pernode.cpu.steal
++   "node0" 30860
++   "node1" 43720
++   "node2" 31110
++   "node3" 38050
++kernel.pernode.cpu.sys
++   "node0" 280780
++   "node1" 259660
++   "node2" 382510
++   "node3" 277200
++kernel.pernode.cpu.user
++   "node0" 723060
++   "node1" 733010
++   "node2" 831310
++   "node3" 777680
++kernel.pernode.cpu.vnice
++   "node0" 6070
++   "node1" 6430
++   "node2" 17350
++   "node3" 11260
++kernel.pernode.cpu.vuser
++   "node0" 723060
++   "node1" 733010
++   "node2" 831310
++   "node3" 777680
+ kernel.pernode.cpu.wait.total
+-    inst [0 or "node0"] value 3320160
++   "node0" 285150
++   "node1" 168360
++   "node2" 362750
++   "node3" 163130
+ 
+ == done
+ 
+diff -Naurp pcp-4.3.2.wip/qa/group pcp-4.3.2/qa/group
+--- pcp-4.3.2.wip/qa/group	2020-02-17 12:19:02.743341620 +1100
++++ pcp-4.3.2/qa/group	2020-02-17 17:28:43.161140088 +1100
+@@ -1651,6 +1651,7 @@ BAD
+ 1388 pmwebd local
+ 1389 pmwebd local
+ 1390 atop local
++1393 pmda.linux local
+ 1395 pmda.prometheus local python
+ 1396 pcp python pidstat local BAD @vm34
+ 1397 pmda.smart local valgrind
+diff -Naurp pcp-4.3.2.wip/src/pmdas/linux/linux.h pcp-4.3.2/src/pmdas/linux/linux.h
+--- pcp-4.3.2.wip/src/pmdas/linux/linux.h	2019-01-25 11:25:19.000000000 +1100
++++ pcp-4.3.2/src/pmdas/linux/linux.h	2020-02-17 17:28:43.155140157 +1100
+@@ -277,20 +277,23 @@ typedef struct {
+ } softnet_t;
+ 
+ typedef struct {
+-    unsigned int	cpuid;
+-    unsigned int	nodeid;
++    unsigned int	nodeid; /* node%d instance name */
++    unsigned int	instid; /* internal instance id */
++    cpuacct_t		stat;
++    struct linux_table	*meminfo;
++    struct linux_table	*memstat;
++    double		bandwidth;
++} pernode_t;
++
++typedef struct {
++    unsigned int	cpuid;  /* cpu%d instance name */
++    unsigned int	instid; /* internal instance id */
++    pernode_t		*node;
+     char		*name;
+     cpuacct_t		stat;
+     cpuinfo_t		info;
+     softnet_t		*softnet;
+ } percpu_t;
+ 
+-typedef struct {
+-    unsigned int	nodeid;
+-    cpuacct_t		stat;
+-    struct linux_table	*meminfo;
+-    struct linux_table	*memstat;
+-    double		bandwidth;
+-} pernode_t;
+ 
+ #endif /* LINUX_PMDA_H */
+diff -Naurp pcp-4.3.2.wip/src/pmdas/linux/numa_meminfo.c pcp-4.3.2/src/pmdas/linux/numa_meminfo.c
+--- pcp-4.3.2.wip/src/pmdas/linux/numa_meminfo.c	2018-03-05 18:14:58.000000000 +1100
++++ pcp-4.3.2/src/pmdas/linux/numa_meminfo.c	2020-02-17 17:28:43.152140192 +1100
+@@ -113,14 +113,14 @@ refresh_numa_meminfo(void)
+ 	    continue;
+ 
+ 	pmsprintf(buf, sizeof(buf), "%s/sys/devices/system/node/node%d/meminfo",
+-		linux_statspath, i);
++		linux_statspath, np->nodeid);
+ 	if ((fp = fopen(buf, "r")) != NULL) {
+ 	    linux_table_scan(fp, np->meminfo);
+ 	    fclose(fp);
+ 	}
+ 
+ 	pmsprintf(buf, sizeof(buf), "%s/sys/devices/system/node/node%d/numastat",
+-		linux_statspath, i);
++		linux_statspath, np->nodeid);
+ 	if ((fp = fopen(buf, "r")) != NULL) {
+ 	    linux_table_scan(fp, np->memstat);
+ 	    fclose(fp);
+diff -Naurp pcp-4.3.2.wip/src/pmdas/linux/pmda.c pcp-4.3.2/src/pmdas/linux/pmda.c
+--- pcp-4.3.2.wip/src/pmdas/linux/pmda.c	2020-02-17 12:19:15.146197738 +1100
++++ pcp-4.3.2/src/pmdas/linux/pmda.c	2020-02-17 17:28:43.156140146 +1100
+@@ -6098,6 +6098,7 @@ linux_fetchCallBack(pmdaMetric *mdesc, u
+     net_addr_t		*addrp;
+     net_interface_t	*netip;
+     scsi_entry_t	*scsi_entry;
++    char		*name;
+ 
+     if (mdesc->m_user != NULL) {
+ 	/* 
+@@ -7306,7 +7307,7 @@ linux_fetchCallBack(pmdaMetric *mdesc, u
+ 	    atom->cp = get_machine_info(kernel_uname.machine);
+ 	    break;
+ 	case 8: /* hinv.map.cpu_node */
+-	    atom->ul = cp->nodeid;
++	    atom->ul = cp->node->nodeid;
+ 	    break;
+ 	case 9: /* hinv.cpu.model_name */
+ 	    if ((i = cp->info.model_name) < 0)
+@@ -7333,14 +7334,14 @@ linux_fetchCallBack(pmdaMetric *mdesc, u
+     case CLUSTER_SYSFS_DEVICES:
+ 	switch (item) {
+ 	case 0: /* hinv.cpu.online */
+-	    if (pmdaCacheLookup(INDOM(CPU_INDOM), inst, NULL, NULL) < 0)
++	    if (pmdaCacheLookup(INDOM(CPU_INDOM), inst, &name, NULL) < 0)
+ 		return PM_ERR_INST;
+-	    atom->ul = refresh_sysfs_online(inst, "cpu");
++	    atom->ul = refresh_sysfs_online(name, "cpu");
+ 	    break;
+ 	case 1: /* hinv.node.online */
+-	    if (pmdaCacheLookup(INDOM(NODE_INDOM), inst, NULL, NULL) < 0)
++	    if (pmdaCacheLookup(INDOM(NODE_INDOM), inst, &name, NULL) < 0)
+ 		return PM_ERR_INST;
+-	    atom->ul = refresh_sysfs_online(inst, "node");
++	    atom->ul = refresh_sysfs_online(name, "node");
+ 	    break;
+ 
+ 	default:
+diff -Naurp pcp-4.3.2.wip/src/pmdas/linux/proc_cpuinfo.c pcp-4.3.2/src/pmdas/linux/proc_cpuinfo.c
+--- pcp-4.3.2.wip/src/pmdas/linux/proc_cpuinfo.c	2018-03-05 18:14:58.000000000 +1100
++++ pcp-4.3.2/src/pmdas/linux/proc_cpuinfo.c	2020-02-17 17:28:43.156140146 +1100
+@@ -28,7 +28,7 @@
+  * CPU or NUMA node ("node" parameter).
+  */
+ int
+-refresh_sysfs_online(unsigned int node_num, const char *node)
++refresh_sysfs_online(char *instname, const char *node_or_cpu)
+ {
+     const char *sysfs_path = "sys/devices/system";
+     char path[MAXPATHLEN];
+@@ -36,8 +36,8 @@ refresh_sysfs_online(unsigned int node_n
+     FILE *fp;
+     int n;
+ 
+-    pmsprintf(path, sizeof(path), "%s/%s/%s/%s%u/online",
+-		linux_statspath, sysfs_path, node, node, node_num);
++    pmsprintf(path, sizeof(path), "%s/%s/%s/%s/online",
++		linux_statspath, sysfs_path, node_or_cpu, instname);
+     if ((fp = fopen(path, "r")) == NULL)
+ 	return 1;
+     n = fscanf(fp, "%u", &online);
+diff -Naurp pcp-4.3.2.wip/src/pmdas/linux/proc_cpuinfo.h pcp-4.3.2/src/pmdas/linux/proc_cpuinfo.h
+--- pcp-4.3.2.wip/src/pmdas/linux/proc_cpuinfo.h	2017-11-30 12:48:48.000000000 +1100
++++ pcp-4.3.2/src/pmdas/linux/proc_cpuinfo.h	2020-02-17 17:28:43.156140146 +1100
+@@ -19,4 +19,4 @@
+  */
+ 
+ extern int refresh_proc_cpuinfo(void);
+-extern int refresh_sysfs_online(unsigned int, const char *);
++extern int refresh_sysfs_online(char *, const char *);
+diff -Naurp pcp-4.3.2.wip/src/pmdas/linux/proc_stat.c pcp-4.3.2/src/pmdas/linux/proc_stat.c
+--- pcp-4.3.2.wip/src/pmdas/linux/proc_stat.c	2018-09-18 16:41:15.000000000 +1000
++++ pcp-4.3.2/src/pmdas/linux/proc_stat.c	2020-02-17 17:28:43.157140134 +1100
+@@ -60,7 +60,7 @@ setup_cpu_info(cpuinfo_t *cip)
+ }
+ 
+ static void
+-cpu_add(pmInDom cpus, unsigned int cpuid, unsigned int nodeid)
++cpu_add(pmInDom cpus, unsigned int cpuid, pernode_t *np)
+ {
+     percpu_t	*cpu;
+     char	name[64];
+@@ -68,23 +68,24 @@ cpu_add(pmInDom cpus, unsigned int cpuid
+     if ((cpu = (percpu_t *)calloc(1, sizeof(percpu_t))) == NULL)
+ 	return;
+     cpu->cpuid = cpuid;
+-    cpu->nodeid = nodeid;
++    cpu->node = np;
+     setup_cpu_info(&cpu->info);
+     pmsprintf(name, sizeof(name)-1, "cpu%u", cpuid);
+-    pmdaCacheStore(cpus, PMDA_CACHE_ADD, name, (void*)cpu);
++    cpu->instid = pmdaCacheStore(cpus, PMDA_CACHE_ADD, name, (void*)cpu);
+ }
+ 
+-static void
++static pernode_t *
+ node_add(pmInDom nodes, unsigned int nodeid)
+ {
+     pernode_t	*node;
+     char	name[64];
+ 
+     if ((node = (pernode_t *)calloc(1, sizeof(pernode_t))) == NULL)
+-	return;
++	return NULL;
+     node->nodeid = nodeid;
+     pmsprintf(name, sizeof(name)-1, "node%u", nodeid);
+-    pmdaCacheStore(nodes, PMDA_CACHE_ADD, name, (void*)node);
++    node->instid = pmdaCacheStore(nodes, PMDA_CACHE_ADD, name, (void*)node);
++    return node;
+ }
+ 
+ void
+@@ -98,6 +99,7 @@ cpu_node_setup(void)
+     DIR			*cpu_dir;
+     int			i, count;
+     char		path[MAXPATHLEN];
++    pernode_t		*np;
+     static int		setup;
+ 
+     if (setup)
+@@ -112,16 +114,16 @@ cpu_node_setup(void)
+     count = scandir(path, &node_files, NULL, versionsort);
+     if (!node_files || (linux_test_mode & LINUX_TEST_NCPUS)) {
+ 	/* QA mode or no sysfs support, assume single NUMA node */
+-	node_add(nodes, 0);	/* default to just node zero */
++	np = node_add(nodes, 0);	/* default to just node zero */
+ 	for (cpu = 0; cpu < _pm_ncpus; cpu++)
+-	    cpu_add(cpus, cpu, 0);	/* all in node zero */
++	    cpu_add(cpus, cpu, np);	/* all in node zero */
+ 	goto done;
+     }
+ 
+     for (i = 0; i < count; i++) {
+ 	if (sscanf(node_files[i]->d_name, "node%u", &node) != 1)
+ 	    continue;
+-	node_add(nodes, node);
++	np = node_add(nodes, node);
+ 	pmsprintf(path, sizeof(path), "%s/%s/%s",
+ 		 linux_statspath, node_path, node_files[i]->d_name);
+ 	if ((cpu_dir = opendir(path)) == NULL)
+@@ -129,7 +131,7 @@ cpu_node_setup(void)
+ 	while ((cpu_entry = readdir(cpu_dir)) != NULL) {
+ 	    if (sscanf(cpu_entry->d_name, "cpu%u", &cpu) != 1)
+ 		continue;
+-	    cpu_add(cpus, cpu, node);
++	    cpu_add(cpus, cpu, np);
+ 	}
+ 	closedir(cpu_dir);
+     }
+@@ -172,6 +174,7 @@ refresh_proc_stat(proc_stat_t *proc_stat
+     percpu_t	*cp;
+     pmInDom	cpus, nodes;
+     char	buf[MAXPATHLEN], *name, *sp, **bp;
++    char	cpuname[32];
+     int		n = 0, i, size;
+ 
+     static int fd = -1; /* kept open until exit(), unless testing */
+@@ -282,7 +285,8 @@ refresh_proc_stat(proc_stat_t *proc_stat
+ 	    cp = NULL;
+ 	    np = NULL;
+ 	    i = atoi(&bufindex[n][3]);	/* extract CPU identifier */
+-	    if (pmdaCacheLookup(cpus, i, &name, (void **)&cp) < 0 || !cp)
++	    pmsprintf(cpuname, sizeof(cpuname), "cpu%u", i); /* instance name */
++	    if (pmdaCacheLookupName(cpus, cpuname, &i, (void **)&cp) < 0 || !cp)
+ 		continue;
+ 	    memset(&cp->stat, 0, sizeof(cp->stat));
+ 	    sscanf(bufindex[n], PERCPU_FMT, &i,
+@@ -290,10 +294,10 @@ refresh_proc_stat(proc_stat_t *proc_stat
+ 		    &cp->stat.idle, &cp->stat.wait, &cp->stat.irq,
+ 		    &cp->stat.sirq, &cp->stat.steal, &cp->stat.guest,
+ 		    &cp->stat.guest_nice);
+-	    pmdaCacheStore(cpus, PMDA_CACHE_ADD, name, (void *)cp);
++	    pmdaCacheStore(cpus, PMDA_CACHE_ADD, cpuname, (void *)cp);
+ 
+ 	    /* update per-node aggregate CPU utilisation stats as well */
+-	    if (pmdaCacheLookup(nodes, cp->nodeid, NULL, (void **)&np) < 0)
++	    if (pmdaCacheLookup(nodes, cp->node->instid, NULL, (void **)&np) < 0 || !np)
+ 		continue;
+ 	    np->stat.user += cp->stat.user;
+ 	    np->stat.nice += cp->stat.nice;
diff --git a/SOURCES/redhat-bugzilla-1764748.patch b/SOURCES/redhat-bugzilla-1764748.patch
new file mode 100644
index 0000000..d09c330
--- /dev/null
+++ b/SOURCES/redhat-bugzilla-1764748.patch
@@ -0,0 +1,166 @@
+commit 2ab1cf5d1e547f991c64dde97749a666c045fc25
+Author: Nathan Scott <nathans@redhat.com>
+Date:   Tue Oct 29 02:28:10 2019 +1100
+
+    pcp-atopsar: fix mishandling of some command line arguments
+    
+    Cleanup several aspects of command line handling in pcp-atopsar,
+    and resolve a reported bug where the samples argument was not
+    honoured due to shadowing of a same-named variable with atop.
+    
+    Resolves Red Hat BZ 1764748.
+
+diff --git a/qa/785 b/qa/785
+index 89e564d2a..5f637367b 100755
+--- a/qa/785
++++ b/qa/785
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/usr/bin/sh
+ # PCP QA Test No. 785
+ # Basic checkout of the pcp-atopsar(1) utility.
+ #
+@@ -51,10 +51,11 @@ echo; echo == Checking sample count and interval
+ export PCP_ARCHIVE=$here/archives/pcp-atop
+ pcp -z atopsar -m 2 3 > $tmp.mem1
+ pcp -z -t 2 -s 3 atopsar -m > $tmp.mem2
+-unset PCP_ARCHIVE
+ test -s $tmp.mem1 || echo "Unexpected empty file 1"
+ test -s $tmp.mem2 || echo "Unexpected empty file 2"
+ diff $tmp.mem1 $tmp.mem2 && echo OK
++pcp -z atopsar -m 1 2 | _filter
++unset PCP_ARCHIVE
+ 
+ echo; echo == Check handling of missing values
+ pcp atopsar -r archives/pcp-vmstat
+diff --git a/qa/785.out b/qa/785.out
+index 32207712c..e38b7e743 100644
+--- a/qa/785.out
++++ b/qa/785.out
+@@ -89,6 +89,13 @@ HOST-SUMMARY-LINE
+ == Checking sample count and interval
+ OK
+ 
++HOST-SUMMARY-LINE
++
++-------------------------- analysis date: 2015/09/25 --------------------------
++
++11:03:21  memtotal memfree buffers cached dirty slabmem  swptotal swpfree _mem_
++11:03:21     3849M    196M    275M  1553M    0M    357M    13661M  13652M
++
+ == Check handling of missing values
+ pcp-atopsar: no per-processor values available
+ pcp-atopsar: no per-interface values available
+diff --git a/src/pcp/atop/atop.c b/src/pcp/atop/atop.c
+index cf6ec821f..fbfc19c89 100644
+--- a/src/pcp/atop/atop.c
++++ b/src/pcp/atop/atop.c
+@@ -173,7 +173,7 @@ struct visualize vis = {generic_samp, generic_error,
+ ** argument values
+ */
+ static char		awaittrigger;	/* boolean: awaiting trigger */
+-static unsigned int 	nsamples = 0xffffffff;
++unsigned int		nsamples = 0xffffffff;
+ static char		midnightflag;
+ 
+ /*
+@@ -294,7 +294,6 @@ main(int argc, char *argv[])
+ 	if ( (p = getenv("HOME")) )
+ 	{
+ 		pmsprintf(path, sizeof(path), "%s/.atoprc", p);
+-		path[sizeof(path)-1] = '\0';
+ 		readrc(path, 0);
+ 	}
+ 
+@@ -424,7 +423,7 @@ main(int argc, char *argv[])
+ 	if (opts.narchives > 0)
+ 		rawreadflag++;
+ 
+-	__pmEndOptions(&opts);
++	close_options(&opts);
+ 
+ 	if (opts.errors)
+ 		prusage(pmGetProgname(), &opts);
+diff --git a/src/pcp/atop/atop.h b/src/pcp/atop/atop.h
+index 45f09dc76..c10e5e13a 100644
+--- a/src/pcp/atop/atop.h
++++ b/src/pcp/atop/atop.h
+@@ -175,6 +175,7 @@ int		contcompar(const void *, const void *);
+ count_t		subcount(count_t, count_t);
+ 
+ void		setup_options(struct pmOptions *, char **, char *);
++void		close_options(struct pmOptions *);
+ void  		rawread(struct pmOptions *);
+ void		rawfolio(struct pmOptions *);
+ void		rawarchive(struct pmOptions *, const char *);
+diff --git a/src/pcp/atop/atopsar.c b/src/pcp/atop/atopsar.c
+index 47324e757..4a61c8dc5 100644
+--- a/src/pcp/atop/atopsar.c
++++ b/src/pcp/atop/atopsar.c
+@@ -48,7 +48,6 @@
+ /*
+ ** miscellaneous values
+ */
+-static unsigned int 	nsamples = 9999999;
+ static char		stampalways;
+ static char		usemarkers;
+ static char		allresources;
+@@ -74,6 +73,7 @@ struct pridef {
+ 	char    *about;         /* statistics about what                  */
+ };
+ 
++extern unsigned int 	nsamples;
+ extern struct pridef	pridef[];      /* table of print-functions        */
+ extern int		pricnt;	       /* total number of print-functions */
+ 
+@@ -272,13 +272,13 @@ atopsar(int argc, char *argv[])
+ 		rawreadflag++;
+ 	}
+ 
+-	__pmEndOptions(&opts);
++	close_options(&opts);
+ 
+ 	if (opts.errors)
+-		prusage(pmGetProgname(), &opts);
++		pratopsaruse(pmGetProgname(), &opts);
+ 
+-	if (opts.samples)
+-		nsamples = opts.samples;
++	if (opts.samples > 0)
++		nsamples = opts.samples + 1;
+ 
+ 	if (opts.interval.tv_sec || opts.interval.tv_usec)
+ 		interval = opts.interval;
+@@ -314,9 +314,9 @@ atopsar(int argc, char *argv[])
+ 	if (rawreadflag)
+ 	{
+ 		vis.show_samp = reportraw;
+-               vis.prep = prep;
+-               vis.next = next_prinow;
+-               prinow = 0;
++		vis.prep = prep;
++		vis.next = next_prinow;
++		prinow = 0;
+ 	}
+ 	else
+ 		vis.show_samp = reportlive;
+diff --git a/src/pcp/atop/various.c b/src/pcp/atop/various.c
+index 1a89af05d..afd418279 100644
+--- a/src/pcp/atop/various.c
++++ b/src/pcp/atop/various.c
+@@ -71,6 +71,15 @@ setup_options(pmOptions *opts, char **argv, char *short_options)
+ 	__pmStartOptions(opts);
+ }
+ 
++void
++close_options(pmOptions *opts)
++{
++	__pmEndOptions(opts);
++
++	if (opts->errors)
++		pmflush();
++}
++
+ /*
+ ** Function convtime() converts a value (number of seconds since
+ ** 1-1-1970) to an ascii-string in the format hh:mm:ss, stored in
diff --git a/SOURCES/redhat-bugzilla-1765641.patch b/SOURCES/redhat-bugzilla-1765641.patch
new file mode 100644
index 0000000..715338c
--- /dev/null
+++ b/SOURCES/redhat-bugzilla-1765641.patch
@@ -0,0 +1,111 @@
+diff -Naurp pcp-4.3.2.wip/src/pcp/atop/atop.c pcp-4.3.2/src/pcp/atop/atop.c
+--- pcp-4.3.2.wip/src/pcp/atop/atop.c	2020-02-17 17:31:31.697197181 +1100
++++ pcp-4.3.2/src/pcp/atop/atop.c	2020-02-17 17:32:10.437750572 +1100
+@@ -631,14 +631,12 @@ engine(void)
+ 		*/
+ 		if (nprocexit > 0)
+ 		{
+-			curpexit = malloc(nprocexit * sizeof(struct tstat));
++			curpexit = calloc(nprocexit, sizeof(struct tstat));
+ 
+ 			ptrverify(curpexit,
+ 			          "Malloc failed for %lu exited processes\n",
+ 			          nprocexit);
+ 
+-			memset(curpexit, 0, nprocexit * sizeof(struct tstat));
+-
+ 			nprocexit = acctphotoproc(curpexit, nprocexit);
+ 
+ 			/*
+diff -Naurp pcp-4.3.2.wip/src/pcp/atop/deviate.c pcp-4.3.2/src/pcp/atop/deviate.c
+--- pcp-4.3.2.wip/src/pcp/atop/deviate.c	2019-03-08 08:26:34.000000000 +1100
++++ pcp-4.3.2/src/pcp/atop/deviate.c	2020-02-17 17:32:10.437750572 +1100
+@@ -84,7 +84,7 @@ deviattask(struct tstat    *curtpres, un
+ 	** create list for the sample deviations of all tasks
+ 	*/
+  	devtstat->ntaskall = ntaskpres + nprocexit;
+-	devtstat->taskall  = malloc(devtstat->ntaskall * sizeof(struct tstat));
++	devtstat->taskall  = calloc(devtstat->ntaskall, sizeof(struct tstat));
+ 
+ 	ptrverify(devtstat->taskall, "Malloc failed for %lu deviated tasks\n",
+                                   devtstat->ntaskall);
+@@ -371,9 +371,9 @@ deviattask(struct tstat    *curtpres, un
+ 	/*
+ 	** create and fill other pointer lists
+ 	*/
+-	devtstat->procall    = malloc(devtstat->nprocall *
++	devtstat->procall    = calloc(devtstat->nprocall,
+ 						sizeof(struct tstat *));
+-	devtstat->procactive = malloc(devtstat->nprocactive *
++	devtstat->procactive = calloc(devtstat->nprocactive,
+ 						sizeof(struct tstat *));
+ 
+ 	ptrverify(devtstat->procall, "Malloc failed for %d processes\n",
+diff -Naurp pcp-4.3.2.wip/src/pcp/atop/photoproc.c pcp-4.3.2/src/pcp/atop/photoproc.c
+--- pcp-4.3.2.wip/src/pcp/atop/photoproc.c	2019-01-24 10:23:34.000000000 +1100
++++ pcp-4.3.2/src/pcp/atop/photoproc.c	2020-02-17 17:32:10.438750561 +1100
+@@ -166,8 +166,10 @@ photoproc(struct tstat **tasks, unsigned
+ 		fprintf(stderr, "%s: done %lu processes\n", pmGetProgname(), count);
+ 
+ 	pmFreeResult(result);
+-	free(insts);
+-	free(pids);
++	if (count > 0) {
++	    free(insts);
++	    free(pids);
++	}
+ 
+ 	return count;
+ }
+diff -Naurp pcp-4.3.2.wip/src/pcp/atop/showlinux.c pcp-4.3.2/src/pcp/atop/showlinux.c
+--- pcp-4.3.2.wip/src/pcp/atop/showlinux.c	2019-01-24 10:24:56.000000000 +1100
++++ pcp-4.3.2/src/pcp/atop/showlinux.c	2020-02-17 17:32:10.438750561 +1100
+@@ -654,19 +654,22 @@ totalcap(struct syscap *psc, struct ssta
+ 		struct tstat 	*curstat = *(proclist+i);
+ 		count_t		nett_wsz;
+ 
+-		psc->availnet += curstat->net.tcpssz;
+-		psc->availnet += curstat->net.tcprsz;
+-		psc->availnet += curstat->net.udpssz;
+-		psc->availnet += curstat->net.udprsz;
+-
+-		if (curstat->dsk.wsz > curstat->dsk.cwsz)
+-			nett_wsz = curstat->dsk.wsz -
+-			           curstat->dsk.cwsz;
+-		else
+-			nett_wsz = 0;
++		if (curstat)
++		{
++			psc->availnet += curstat->net.tcpssz;
++			psc->availnet += curstat->net.tcprsz;
++			psc->availnet += curstat->net.udpssz;
++			psc->availnet += curstat->net.udprsz;
++
++			if (curstat->dsk.wsz > curstat->dsk.cwsz)
++				nett_wsz = curstat->dsk.wsz -
++					   curstat->dsk.cwsz;
++			else
++				nett_wsz = 0;
+ 
+-		psc->availdsk += curstat->dsk.rsz;
+-		psc->availdsk += nett_wsz;
++			psc->availdsk += curstat->dsk.rsz;
++			psc->availdsk += nett_wsz;
++		}
+ 	}
+ 
+ 	for (psc->availgpumem=i=0; i < sstat->gpu.nrgpus; i++)
+@@ -985,8 +988,11 @@ pricumproc(struct sstat *sstat, struct d
+         {
+ 		struct tstat *curstat = *(devtstat->procactive+i);
+ 
+-                extra.totut	+= curstat->cpu.utime;
+-                extra.totst 	+= curstat->cpu.stime;
++		if (curstat)
++		{
++			extra.totut	+= curstat->cpu.utime;
++			extra.totst 	+= curstat->cpu.stime;
++		}
+         }
+ 
+         extra.nproc	= devtstat->nprocall;
diff --git a/SOURCES/redhat-bugzilla-1775373.patch b/SOURCES/redhat-bugzilla-1775373.patch
new file mode 100644
index 0000000..0189157
--- /dev/null
+++ b/SOURCES/redhat-bugzilla-1775373.patch
@@ -0,0 +1,112 @@
+diff -Naurp pcp-4.3.2.wip/build/rpm/fedora.spec pcp-4.3.2/build/rpm/fedora.spec
+--- pcp-4.3.2.wip/build/rpm/fedora.spec	2019-04-26 11:54:27.000000000 +1000
++++ pcp-4.3.2/build/rpm/fedora.spec	2020-02-17 17:46:27.631805233 +1100
+@@ -2888,6 +2888,7 @@ cd
+ %else
+ %config(noreplace) %{_sysconfdir}/cron.d/pcp-pmlogger-daily-report
+ %endif
++%{_localstatedir}/lib/pcp/config/pmieconf/zeroconf
+ %{_localstatedir}/lib/pcp/config/pmlogconf/zeroconf
+ 
+ #additional pmlogger config files
+diff -Naurp pcp-4.3.2.wip/man/man1/pmieconf.1 pcp-4.3.2/man/man1/pmieconf.1
+--- pcp-4.3.2.wip/man/man1/pmieconf.1	2017-11-30 12:48:48.000000000 +1100
++++ pcp-4.3.2/man/man1/pmieconf.1	2020-02-17 17:46:53.461502780 +1100
+@@ -61,7 +61,7 @@ Any rule modifications resulting from
+ manipulation of variable values will be written to \f2file\f1.
+ The default value of \f2file\f1 is dependent on the user ID \- for the root
+ user, the file
+-.I $PCP_VAR_DIR/config/pmieconf/config.pmie
++.I $PCP_SYSCONF_DIR/pmie/config.pmie
+ is used, for other users the default is
+ .IR $HOME/.pcp/pmie/config.pmie .
+ .TP 8
+@@ -309,7 +309,7 @@ option is presented.
+ .IR $PCP_VAR_DIR/config/pmieconf/ */*
+ generalized system resource monitoring rules
+ .TP 10
+-.I $PCP_VAR_DIR/config/pmieconf/config.pmie
++.I $PCP_SYSCONF_DIR/pmie/config.pmie
+ default super-user settings for system resource monitoring rules
+ .TP 10
+ .I $HOME/.pcp/pmie/config.pmie
+diff -Naurp pcp-4.3.2.wip/src/pmieconf/.gitignore pcp-4.3.2/src/pmieconf/.gitignore
+--- pcp-4.3.2.wip/src/pmieconf/.gitignore	2017-11-30 12:48:48.000000000 +1100
++++ pcp-4.3.2/src/pmieconf/.gitignore	2020-02-17 17:46:27.632805221 +1100
+@@ -2,14 +2,15 @@ cpu/GNUmakefile
+ entropy/GNUmakefile
+ filesys/GNUmakefile
+ global/GNUmakefile
+-local
+ memory/GNUmakefile
+ percpu/GNUmakefile
+ pernetif/GNUmakefile
+ primary/GNUmakefile
++zeroconf/GNUmakefile
+ pmieconf
+ pmieconf.static
+ pmlogconf
+ pmlogconf.tmp
+ rate-syscalls
+ rules
++local
+diff -Naurp pcp-4.3.2.wip/src/pmieconf/GNUmakefile pcp-4.3.2/src/pmieconf/GNUmakefile
+--- pcp-4.3.2.wip/src/pmieconf/GNUmakefile	2018-07-10 11:42:44.000000000 +1000
++++ pcp-4.3.2/src/pmieconf/GNUmakefile	2020-02-17 17:46:27.632805221 +1100
+@@ -17,7 +17,8 @@ TOPDIR = ../..
+ include	$(TOPDIR)/src/include/builddefs
+ include $(TOPDIR)/src/libpcp/src/GNUlibrarydefs
+ 
+-MKFILE_SUBDIRS = cpu entropy filesys memory percpu pernetif global primary
++MKFILE_SUBDIRS = cpu entropy filesys memory percpu pernetif \
++		 global primary zeroconf
+ SUBDIRS	= $(MKFILE_SUBDIRS)
+ 
+ CMDTARGET = pmieconf$(EXECSUFFIX)
+diff -Naurp pcp-4.3.2.wip/src/pmieconf/zeroconf/all_threads pcp-4.3.2/src/pmieconf/zeroconf/all_threads
+--- pcp-4.3.2.wip/src/pmieconf/zeroconf/all_threads	1970-01-01 10:00:00.000000000 +1000
++++ pcp-4.3.2/src/pmieconf/zeroconf/all_threads	2020-02-17 17:46:27.633805209 +1100
+@@ -0,0 +1,37 @@
++#pmieconf-rules 1
++# --- DO NOT MODIFY THIS FILE --- see pmieconf(5)
++#
++
++rule	zeroconf.all_threads
++	default	= "$rule$"
++	predicate = "some_host ( proc.control.all.threads == 0 )"
++	enabled	= no
++	version	= 1
++	help	=
++"Ensure per-thread metrics are exported by the pmdaproc(1)
++Performance Metric Domain Agent (PMDA).";
++
++string	rule
++	default	= "Enable per-thread proc metrics"
++	modify	= no
++	display	= no;
++
++string	action_expand
++	default	= "threads[%v]@%h"
++	display	= no
++	modify	= no;
++
++string	email_expand
++	default	= "host: %h threads=%v"
++	display	= no
++	modify	= no;
++
++shell	all_threads_action
++	enabled	= yes
++	default	= "pmstore proc.control.all.threads 1"
++	help	=
++"The pmdaproc(1) Performance Metrics Domain Agent will receive a
++metric store to via pmstore(1) to export threads values as well.";
++
++# 
++# --- DO NOT MODIFY THIS FILE --- see pmieconf(5)
+diff -Naurp pcp-4.3.2.wip/src/pmieconf/zeroconf/localdefs pcp-4.3.2/src/pmieconf/zeroconf/localdefs
+--- pcp-4.3.2.wip/src/pmieconf/zeroconf/localdefs	1970-01-01 10:00:00.000000000 +1000
++++ pcp-4.3.2/src/pmieconf/zeroconf/localdefs	2020-02-17 17:46:27.633805209 +1100
+@@ -0,0 +1,2 @@
++ALL_RULES = all_threads
++LOCAL_RULES = $(ALL_RULES)
diff --git a/SOURCES/redhat-bugzilla-1818710.patch b/SOURCES/redhat-bugzilla-1818710.patch
new file mode 100644
index 0000000..173e2ab
--- /dev/null
+++ b/SOURCES/redhat-bugzilla-1818710.patch
@@ -0,0 +1,88 @@
+commit 11694bffe991a989468f017109697d17824fad28
+Author: Nathan Scott <nathans@redhat.com>
+Date:   Mon Mar 30 16:12:47 2020 +1100
+
+    pcp-atop: ensure allocated task memory is always initialised
+    
+    We've received a report from a customer and intermittent failures
+    in test qa/1080 from valgrind, along these lines:
+    
+    Invalid read of size 8
+    at 0x4248A1: compcpu (showlinux.c:2031)
+    by 0x4B38E74: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B38E01: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B38E01: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B38E01: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B38E01: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B38E01: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B38E01: msort_with_tmp.part.0 (in /usr/lib64/libc-2.30.so)
+    by 0x4B39345: qsort_r (in /usr/lib64/libc-2.30.so)
+    by 0x41CA8A: generic_samp (showgeneric.c:645)
+    by 0x4043E7: engine (atop.c:686)
+    by 0x403F07: main (atop.c:478)
+    Address 0x188 is not stack'd, malloc'd or (recently) free'd
+    
+    I've found a couple of places where we might read uninitialized
+    memory after a malloc - closed those holes, and now running the
+    test in a loop 250 times, I've not observed the issue anymore.
+
+diff --git a/src/pcp/atop/showgeneric.c b/src/pcp/atop/showgeneric.c
+index f643132c3..50c52685f 100644
+--- a/src/pcp/atop/showgeneric.c
++++ b/src/pcp/atop/showgeneric.c
+@@ -336,7 +336,7 @@ generic_samp(double sampletime, double nsecs,
+ 			move(curline, 0);
+ 
+ 			limitedlines();
+-			
++
+ 			curline = prisyst(sstat, curline, nsecs, avgval,
+ 					fixedhead,  &syssel, &autoorder,
+ 					maxcpulines, maxdsklines, maxmddlines,
+@@ -448,7 +448,7 @@ generic_samp(double sampletime, double nsecs,
+ 			** one entry per user (list has worst-case size)
+ 			*/
+ 			tucumlist = calloc(sizeof(struct tstat),    nproc);
+-			ucumlist  = malloc(sizeof(struct tstat *) * nproc);
++			ucumlist  = calloc(sizeof(struct tstat *),  nproc);
+ 
+ 			ptrverify(tucumlist,
+ 			        "Malloc failed for %d ucum procs\n", nproc);
+@@ -491,7 +491,7 @@ generic_samp(double sampletime, double nsecs,
+ 			** one entry per program (list has worst-case size)
+ 			*/
+ 			tpcumlist = calloc(sizeof(struct tstat),    nproc);
+-			pcumlist  = malloc(sizeof(struct tstat *) * nproc);
++			pcumlist  = calloc(sizeof(struct tstat *),  nproc);
+ 
+ 			ptrverify(tpcumlist,
+ 			        "Malloc failed for %d pcum procs\n", nproc);
+@@ -534,7 +534,7 @@ generic_samp(double sampletime, double nsecs,
+ 			** one entry per user (list has worst-case size)
+ 			*/
+ 			tccumlist = calloc(sizeof(struct tstat),    nproc);
+-			ccumlist  = malloc(sizeof(struct tstat *) * nproc);
++			ccumlist  = calloc(sizeof(struct tstat *),  nproc);
+ 
+ 			ptrverify(tccumlist,
+ 			        "Malloc failed for %d ccum procs\n", nproc);
+@@ -590,7 +590,7 @@ generic_samp(double sampletime, double nsecs,
+ 			if (sellist)	// remove previous list if needed
+ 				free(sellist);
+ 
+-			sellist = malloc(sizeof(struct tstat *) * ncurlist);
++			sellist = calloc(sizeof(struct tstat *), ncurlist);
+ 
+ 			ptrverify(sellist,
+ 			       "Malloc failed for %d select ptrs\n", ncurlist);
+@@ -672,8 +672,8 @@ generic_samp(double sampletime, double nsecs,
+ 					if (tsklist)
+ 						free(tsklist);	// remove current
+ 
+-					tsklist = malloc(sizeof(struct tstat *)
+-								    * ntotal);
++					tsklist = calloc(sizeof(struct tstat *),
++								    ntotal);
+ 
+ 					ptrverify(tsklist,
+ 				             "Malloc failed for %d taskptrs\n",
diff --git a/SOURCES/selinux-policy.patch b/SOURCES/selinux-policy.patch
index 34d7299..4f65e52 100644
--- a/SOURCES/selinux-policy.patch
+++ b/SOURCES/selinux-policy.patch
@@ -1,6 +1,6 @@
 diff -Naurp pcp-4.3.2.orig/qa/917 pcp-4.3.2/qa/917
 --- pcp-4.3.2.orig/qa/917	2018-11-27 10:46:07.000000000 +1100
-+++ pcp-4.3.2/qa/917	2019-08-08 15:22:24.520841699 +1000
++++ pcp-4.3.2/qa/917	2020-04-01 15:30:14.402025885 +1100
 @@ -21,6 +21,7 @@ which seinfo >/dev/null 2>&1 || _notrun
  ( seinfo -t 2>&1 | grep 'Default policy search failed: No such file or directory' >/dev/null ) && _notrun "seinfo version bad: can't load default policy"
  [ -f "$policy_file" ] || _notrun "upstream policy package not installed"
@@ -259,7 +259,7 @@ diff -Naurp pcp-4.3.2.orig/qa/917 pcp-4.3.2/qa/917
  # real QA test starts here
 diff -Naurp pcp-4.3.2.orig/qa/917.out.in pcp-4.3.2/qa/917.out.in
 --- pcp-4.3.2.orig/qa/917.out.in	2019-04-26 09:57:42.000000000 +1000
-+++ pcp-4.3.2/qa/917.out.in	2019-08-08 15:22:24.520841699 +1000
++++ pcp-4.3.2/qa/917.out.in	2020-04-01 15:30:37.069633323 +1100
 @@ -3,6 +3,17 @@ full policy modules list on the system
  Checking that pcpupstream policy module has been properly installed
  pcpupstream
@@ -278,7 +278,7 @@ diff -Naurp pcp-4.3.2.orig/qa/917.out.in pcp-4.3.2/qa/917.out.in
  --- begin avrule block ---
  decl 1:
    allow [init_t] [pcp_log_t] : [dir] { read };
-@@ -14,32 +25,32 @@ decl 1:
+@@ -14,60 +25,65 @@ decl 1:
    allow [init_t] [system_cronjob_t] : [dbus] { send_msg };
    allow [pcp_pmcd_t] [user_home_t] : [file] { execute execute_no_trans };
    allow [pcp_pmcd_t] [debugfs_t] : [file] { append getattr ioctl open read write };
@@ -309,6 +309,7 @@ diff -Naurp pcp-4.3.2.orig/qa/917.out.in pcp-4.3.2/qa/917.out.in
    allow [pcp_pmcd_t] [sysfs_t] : [dir] { write };
    allow [pcp_pmcd_t] [modules_object_t] : [lnk_file] { read };
    allow [pcp_pmcd_t] [mdadm_exec_t] : [file] { execute execute_no_trans open read };
++  allow [pcp_pmcd_t] [ndc_exec_t] : [file] { execute };
    allow [pcp_pmcd_t] [proc_mdstat_t] : [file] { getattr open read };
 -  allow [pcp_pmcd_t] [numad_t] : [msgq] { unix_read };
 +! allow [pcp_pmcd_t] [numad_t] : [msgq] { unix_read };
@@ -322,11 +323,14 @@ diff -Naurp pcp-4.3.2.orig/qa/917.out.in pcp-4.3.2/qa/917.out.in
    allow [pcp_pmcd_t] [kernel_t] : [system] { module_request };
    allow [pcp_pmcd_t] [su_exec_t] : [file] { execute };
    allow [pcp_pmlogger_t] [kmsg_device_t] : [chr_file] { open write };
-@@ -48,26 +59,30 @@ decl 1:
+-  allow [pcp_pmlogger_t] self : [capability] { kill };
+-  allow [pcp_pmlogger_t] self : [capability] { sys_ptrace fowner fsetid };
++  allow [pcp_pmlogger_t] self : [capability] { kill sys_ptrace fowner fsetid };
    allow [pcp_pmlogger_t] [unconfined_t] : [process] { signal };
    allow [pcp_pmlogger_t] [unconfined_service_t] : [process] { signal };
    allow [pcp_pmlogger_t] [user_tmp_t] : [file] { setattr unlink };
 -  allow [pcp_pmie_t] [hostname_exec_t] : [file] { execute execute_no_trans getattr open read map };
++  allow [pcp_pmlogger_t] [setfiles_exec_t] : [file] { execute };
 +! allow [pcp_pmie_t] [hostname_exec_t] : [file] { execute execute_no_trans getattr open read map };
    allow [pcp_pmie_t] self : [capability] { kill dac_override sys_ptrace net_admin chown fowner };
    allow [pcp_pmie_t] [proc_net_t] : [file] { read };
@@ -362,7 +366,7 @@ diff -Naurp pcp-4.3.2.orig/qa/917.out.in pcp-4.3.2/qa/917.out.in
    allow [pcp_pmcd_t] [file_type] : [dir] { open read search getattr lock ioctl };
    allow [pcp_pmcd_t] [file_type] : [dir] { open search getattr };
    allow [pcp_pmcd_t] [file_type] : [file] { getattr ioctl lock open read };
-@@ -93,6 +108,7 @@ decl 1:
+@@ -93,6 +109,7 @@ decl 1:
    allow [pcp_domain] [userdomain] : [sem] { unix_read associate getattr read };
    allow [pcp_domain] [domain] : [unix_stream_socket] { connectto };
    allow [pcp_domain] [port_type] : [tcp_socket] { name_connect };
@@ -372,7 +376,7 @@ diff -Naurp pcp-4.3.2.orig/qa/917.out.in pcp-4.3.2/qa/917.out.in
    allow [pcp_pmcd_t] [etc_t] : [dir] { open read search getattr lock ioctl };
 diff -Naurp pcp-4.3.2.orig/src/pmdas/bcc/modules/pcpbcc.python pcp-4.3.2/src/pmdas/bcc/modules/pcpbcc.python
 --- pcp-4.3.2.orig/src/pmdas/bcc/modules/pcpbcc.python	2018-09-18 16:41:15.000000000 +1000
-+++ pcp-4.3.2/src/pmdas/bcc/modules/pcpbcc.python	2019-08-08 15:31:12.058022014 +1000
++++ pcp-4.3.2/src/pmdas/bcc/modules/pcpbcc.python	2020-04-01 15:30:14.403025868 +1100
 @@ -323,6 +323,11 @@ class PCPBCCBase(object):
              else:
                  return "0.5.0"
@@ -399,7 +403,7 @@ diff -Naurp pcp-4.3.2.orig/src/pmdas/bcc/modules/pcpbcc.python pcp-4.3.2/src/pmd
          """
 diff -Naurp pcp-4.3.2.orig/src/selinux/GNUlocaldefs pcp-4.3.2/src/selinux/GNUlocaldefs
 --- pcp-4.3.2.orig/src/selinux/GNUlocaldefs	2019-04-16 11:43:42.000000000 +1000
-+++ pcp-4.3.2/src/selinux/GNUlocaldefs	2019-08-08 15:30:17.502036498 +1000
++++ pcp-4.3.2/src/selinux/GNUlocaldefs	2020-04-01 15:30:14.403025868 +1100
 @@ -1,101 +1,68 @@
  ifeq "$(PCP_SELINUX_CONTAINER_RUNTIME)" "true"
 -PCP_CONTAINER_RUNTIME_T="type container_runtime_t\;"
@@ -558,7 +562,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/GNUlocaldefs pcp-4.3.2/src/selinux/GNUloc
 +endif
 diff -Naurp pcp-4.3.2.orig/src/selinux/GNUmakefile pcp-4.3.2/src/selinux/GNUmakefile
 --- pcp-4.3.2.orig/src/selinux/GNUmakefile	2019-03-07 08:26:45.000000000 +1100
-+++ pcp-4.3.2/src/selinux/GNUmakefile	2019-08-08 15:30:17.502036498 +1000
++++ pcp-4.3.2/src/selinux/GNUmakefile	2020-04-01 15:30:14.404025851 +1100
 @@ -33,51 +33,43 @@ build-me: $(IAM).te selinux-setup.sh
  
  $(IAM).te: $(IAM).te.in
@@ -650,8 +654,24 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/GNUmakefile pcp-4.3.2/src/selinux/GNUmake
  	make -f /usr/share/selinux/devel/Makefile
 diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/pcpupstream.te.in
 --- pcp-4.3.2.orig/src/selinux/pcpupstream.te.in	2019-04-26 09:34:21.000000000 +1000
-+++ pcp-4.3.2/src/selinux/pcpupstream.te.in	2019-08-08 15:30:17.504036461 +1000
-@@ -39,7 +39,7 @@ require {
++++ pcp-4.3.2/src/selinux/pcpupstream.te.in	2020-04-01 15:30:37.069633323 +1100
+@@ -9,6 +9,7 @@ require {
+ 	type tmp_t;
+ 	type init_t;
+ 	type default_t;
++	type gpmctl_t;
+ 	type pcp_pmlogger_t;
+ 	type pcp_pmlogger_exec_t;
+ 	type pcp_var_lib_t;
+@@ -33,13 +34,15 @@ require {
+         type sysctl_fs_t; #RHBZ1505888
+         type sysfs_t; #RHBZ1545245
+         type modules_object_t; # pcp.lio, pcp.bcc
++        type setfiles_exec_t;
+         type mdadm_exec_t;
++        type ndc_exec_t;
+         type proc_mdstat_t;
+         @PCP_NUMAD_CONTEXT@
          type glusterd_log_t;
          type sysctl_irq_t; #pmda.bcc
          type unconfined_t; #RHBZ1443632
@@ -660,7 +680,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
          type configfs_t; #pcp.lio
          type ldconfig_exec_t;
          type sysctl_net_t;
-@@ -49,19 +49,20 @@ require {
+@@ -49,19 +52,20 @@ require {
  	type kmsg_device_t;
          type proc_kcore_t;
          type su_exec_t;
@@ -677,13 +697,14 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  	class chr_file { open write };
  	class fifo_file { getattr read open unlink lock ioctl }; # qa/455
  	class process { signull signal execmem setrlimit ptrace }; #RHBZ1443632
- 	class sock_file write; #RHBZ1449671
+-	class sock_file write; #RHBZ1449671
 -	@PCP_SOCK_FILE_GETATTR@
 -	@PCP_CLASS_STATUS@
++	class sock_file { getattr write }; #RHBZ1449671, RHBZ1449671
  	class tcp_socket { name_bind name_connect };
  	class shm { unix_read associate getattr read };
  	class filesystem mount;
-@@ -98,49 +99,24 @@ allow init_t system_cronjob_t:dbus send_
+@@ -98,49 +102,24 @@ allow init_t system_cronjob_t:dbus send_
  
  
  #============= pcp_pmcd_t ==============
@@ -735,7 +756,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  #type=AVC msg=audit(YYY.11): avc:  denied  { sys_chroot kill sys_resource } for  pid=25873 comm="pmdalinux" capability=18  scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=capability
  #type=AVC msg=audit(YYY.87): avc:  denied  { chown } for  pid=8999 comm="pmdasimple" capability=0  scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=capability
  allow pcp_pmcd_t self:capability { sys_chroot kill sys_resource ipc_lock chown };
-@@ -149,10 +125,6 @@ allow pcp_pmcd_t self:capability { sys_c
+@@ -149,10 +128,6 @@ allow pcp_pmcd_t self:capability { sys_c
  #type=AVC msg=audit(YYY.12): avc:  denied  { read } for  pid=29112 comm="pmdalinux" dev="nsfs" ino=4026532454 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:nsfs_t:s0 tclass=file permissive=1
  @PCP_NSFS_RULE@
  
@@ -746,7 +767,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  #type=AVC msg=audit(YYY.13): avc:  denied  { name_bind } for  pid=7079 comm="pmdasimple" src=5650 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
  #type=AVC msg=audit(YYY.14): avc:  denied  { name_connect } for  pid=29238 comm="pmcd" dest=5650 scontex =system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
  @PCP_UNRESERVED_PORT_RULE@
-@@ -160,19 +132,9 @@ allow pcp_pmcd_t self:capability { sys_c
+@@ -160,19 +135,9 @@ allow pcp_pmcd_t self:capability { sys_c
  #type=AVC msg=audit(YYY.15): avc:  denied  { name_connect } for  pid=13816 comm="python3" dest=9090 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:websm_port_t:s0 tclass=tcp_socket permissive=0
  allow pcp_pmcd_t websm_port_t:tcp_socket name_connect; # pmda.prometheus
  
@@ -767,7 +788,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  
  #type=AVC msg=audit(YYY.23): avc:  denied  { getattr } for  pid=8656 comm="sh" path="/usr/bin/hostname" dev="dm-1" ino=1051243 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=0
  #type=AVC msg=audit(YYY.24): avc:  denied  { execute } for  pid=8656 comm="sh" name="hostname" dev="dm-1" ino=1051243 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=0
-@@ -187,84 +149,31 @@ allow pcp_pmcd_t hostname_exec_t:file {
+@@ -187,87 +152,39 @@ allow pcp_pmcd_t hostname_exec_t:file {
  #type=AVC msg=audit(YYY.29): avc:  denied  { search } for  pid=22090 comm="pmdaperfevent" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:tracefs_t:s0 tclass=dir permissive=0
  #type=AVC msg=audit(YYY.30): avc:  denied  { read } for  pid=22090 comm="pmdaperfevent" name="events" dev="tracefs" ino=176 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:tracefs_t:s0 tclass=dir permissive=0
  #type=AVC msg=audit(YYY.31): avc:  denied  { open } for  pid=22090 comm="pmdaperfevent" path="/sys/kernel/debug/tracing/events" dev="tracefs" ino=176 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:tracefs_t:s0 tclass=dir permissive=0
@@ -794,7 +815,9 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
 -
 -#type=AVC msg=audit(XXX.15): avc:  denied  { search } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:haproxy_var_lib_t:s0 tclass=dir permissive=0
 -# allow pcp_pmcd_t haproxy_var_lib_t:dir search;
--
++#type=AVC msg=audit(YYY.37): avc:  denied  { getattr } for  pid=YYYY comm="pmdaproc" path="/dev/gpmctl" dev="devtmpfs" ino=19750 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:gpmctl_t:s0 tclass=sock_file permissive=1
++allow pcp_pmcd_t gpmctl_t:sock_file getattr;
+ 
  #type=AVC msg=audit(XXX.16): avc:  denied  { write } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:haproxy_var_lib_t:s0 tclass=sock_file permissive=0
  allow pcp_pmcd_t haproxy_var_lib_t:sock_file write;
  
@@ -854,7 +877,12 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  #type=AVC msg=audit(XXX.26): avc:  denied  { execute execute_no_trans open read } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:mdadm_exec_t:s0 tclass=file permissive=0
  allow pcp_pmcd_t mdadm_exec_t:file { execute execute_no_trans open read };
  
-@@ -275,93 +184,29 @@ allow pcp_pmcd_t proc_mdstat_t:file { ge
++allow pcp_pmcd_t ndc_exec_t:file execute;
++
+ #type=AVC msg=audit(XXX.27): avc:  denied  { getattr open read } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:proc_mdstat_t:s0 tclass=file permissive=0
+ allow pcp_pmcd_t proc_mdstat_t:file { getattr open read };
+ 
+@@ -275,93 +192,29 @@ allow pcp_pmcd_t proc_mdstat_t:file { ge
  #type=AVC msg=audit(YYY.36): avc:  denied  { unix_read } for  pid=1423 comm="pmdalinux" key=-559038737  scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:numad_t:s0 tclass=msgq permissive=0
  @PCP_NUMAD_RULE@
  
@@ -951,10 +979,13 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  # type=AVC msg=audit(YYY.83): avc: denied { execute } for pid=19060 comm="zimbraprobe" name="su" dev="dm-0" ino=26416761 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:su_exec_t:s0 tclass=file permissive=0
  #pmdazimbra
  allow pcp_pmcd_t su_exec_t:file { execute };
-@@ -373,14 +218,6 @@ allow pcp_pmlogger_t kmsg_device_t:chr_f
- #type=AVC msg=audit(XXX.45): avc:  denied  { kill } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:pcp_pmlogger_t:s0 tclass=capability permissive=0
- allow pcp_pmlogger_t self:capability kill;
+@@ -370,56 +223,21 @@ allow pcp_pmcd_t su_exec_t:file { execut
+ #type=AVC msg=audit(XXX.44): avc:  denied  { open write } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:kmsg_device_t:s0 tclass=chr_file permissive=0
+ allow pcp_pmlogger_t kmsg_device_t:chr_file { open write };
  
+-#type=AVC msg=audit(XXX.45): avc:  denied  { kill } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:pcp_pmlogger_t:s0 tclass=capability permissive=0
+-allow pcp_pmlogger_t self:capability kill;
+-
 -# @PCP_PMLOGGER_SYSTEM_STATUS_RULE@
 -
 -#type=AVC msg=audit(YYY.41): avc:  denied  { write } for  pid=18266 comm="logger" name="log" dev="devtmpfs" ino=1413 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:devlog_t:s0 tclass=sock_file
@@ -964,9 +995,12 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
 -# allow pcp_pmlogger_t devlog_t:lnk_file read;
 -
  # type=AVC msg=audit(YYY.43): avc:  denied  { sys_ptrace } for  pid=21962 comm="ps" capability=19  scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:system_r:pcp_pmlogger_t:s0 tclass=capability
- # src/pmlogger/pmnewlog.sh
- allow pcp_pmlogger_t self:capability { sys_ptrace fowner fsetid };
-@@ -389,38 +226,11 @@ allow pcp_pmlogger_t self:capability { s
+-# src/pmlogger/pmnewlog.sh
+-allow pcp_pmlogger_t self:capability { sys_ptrace fowner fsetid };
++#type=AVC msg=audit(XXX.45): avc:  denied  { kill } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:pcp_pmlogger_t:s0 tclass=capability permissive=0
++allow pcp_pmlogger_t self:capability { sys_ptrace fowner fsetid kill };
+ 
+ ## type=AVC msg=audit(YYY.44) : avc:  denied  { signal } for  pid=28414 comm=pmsignal scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=process
  allow pcp_pmlogger_t unconfined_t:process signal;
  
  ## type=AVC msg=audit(YYY.85): avc: denied { signal } for pid=31205 comm="pmsignal" scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=process permissive=0
@@ -1002,11 +1036,12 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
 -#RHBZ1634205
 -#type=AVC msg=audit(YYY.49): avc:  denied  { search } for  pid=8613 comm="ps" name=".cache" dev="dm-0" ino=1277884 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:cache_home_t:s0 tclass=dir permissive=0
 -# allow pcp_pmlogger_t cache_home_t: dir search;
--
++#type=AVC msg=audit(XXX.72): avc:  denied  { execute } for  pid=9634 comm="pmlogger_daily" name="setfiles" dev="dm-0" ino=34500334 scontext=system_u:system_r:pcp_pmlogger_t:s0 tcontext=system_u:object_r:setfiles_exec_t:s0 tclass=file permissive=0
++allow pcp_pmlogger_t setfiles_exec_t:file execute;
+ 
  #============= pcp_pmie_t ==============
  #type=AVC msg=audit(XXX.49): avc:  denied  { execute execute_no_trans getattr open read } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:object_r:hostname_exec_t:s0 tclass=file permissive=0
- allow pcp_pmie_t hostname_exec_t:file { execute execute_no_trans getattr open read @PCP_HOSTNAME_EXEC_MAP@ };
-@@ -429,77 +239,27 @@ allow pcp_pmie_t hostname_exec_t:file {
+@@ -429,77 +247,27 @@ allow pcp_pmie_t hostname_exec_t:file {
  #type=AVC msg=audit(YYY.50): avc:  denied  { sys_ptrace } for  pid=30881 comm="ps" capability=19  scontext=system_u:system_r:pcp_pmie_t:s0 tcontext=system_u:system_r:pcp_pmie_t:s0 tclass=capability permissive=0
  allow pcp_pmie_t self:capability { chown fowner dac_override kill net_admin sys_ptrace };
  
@@ -1089,7 +1124,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  
  #type=AVC msg=audit(XXX.57): avc:  denied  { getattr read } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:configfs_t:s0 tclass=lnk_file permissive=0
  allow pcp_pmcd_t configfs_t:lnk_file { getattr read };
-@@ -507,23 +267,6 @@ allow pcp_pmcd_t configfs_t:lnk_file { g
+@@ -507,23 +275,6 @@ allow pcp_pmcd_t configfs_t:lnk_file { g
  #type=AVC msg=audit(XXX.58): avc:  denied  { execute execute_no_trans getattr open read } for  pid=YYYY comm="pmdaX" name="/" dev="tracefs" ino=1 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:ldconfig_exec_t:s0 tclass=file permissive=0
  allow pcp_pmcd_t ldconfig_exec_t:file { execute execute_no_trans getattr open read };
  
@@ -1113,7 +1148,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  #============= pcp_pmproxy_t ==============
  #type=AVC msg=audit(YYY.67) : avc: denied { net_admin } for pid=6669 comm=pmproxy capability=net_admin scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:system_r:pcp_pmproxy_t:s0 tclass=capability
  allow pcp_pmproxy_t self:capability { net_admin dac_override };
-@@ -533,9 +276,6 @@ allow pcp_pmproxy_t self:capability { ne
+@@ -533,9 +284,6 @@ allow pcp_pmproxy_t self:capability { ne
  #type=AVC msg=audit(YYY.70) : avc: denied { getattr } for pid=9669 comm=pmproxy path=/proc/sys/net/ipv6/conf/all/disable_ipv6 dev="proc" ino=9994 scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:object_r:sysctl_net_t:s0 tclass=file
  allow pcp_pmproxy_t sysctl_net_t:file { getattr open read };
  
@@ -1123,7 +1158,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  #type=AVC msg=audit(YYY.72): avc:  denied  { read } for  pid=28833 comm="pmproxy" name="unix" dev="proc" ino=4026532015 scontext=system_u:system_r:pcp_pmproxy_t:s0 tcontext=system_u:object_r:proc_net_t:s0 tclass=file
  #RHBZ1517656
  allow pcp_pmproxy_t proc_net_t:file read;
-@@ -545,14 +285,11 @@ allow pcp_pmproxy_t proc_net_t:file read
+@@ -545,14 +293,11 @@ allow pcp_pmproxy_t proc_net_t:file read
  #type=AVC msg=audit(YYY.73): avc:  denied  { name_bind } for  pid=13114 comm="pmlogger" src=4332 scontext=system_u:system_r:pcp_pmmgr_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
  @PCP_UNRESERVED_PORT_RULE_PMMGR@
  
@@ -1140,7 +1175,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  
  #============= pmda-smart ==============
  
-@@ -564,23 +301,25 @@ allow pcp_pmmgr_t ldconfig_exec_t:file {
+@@ -564,23 +309,25 @@ allow pcp_pmmgr_t ldconfig_exec_t:file {
  #type=AVC msg=audit(YYY.80): avc:  denied  { map } for  pid=8678 comm="smartctl" path="/usr/sbin/smartctl" dev="dm-1" ino=2249815 scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:object_r:fsadm_exec_t:s0 tclass=file permissive=1
  #type=AVC msg=audit(YYY.81): avc:  denied  { sys_rawio } for  pid=8678 comm="smartctl" capability=17  scontext=system_u:system_r:pcp_pmcd_t:s0 tcontext=system_u:system_r:pcp_pmcd_t:s0 tclass=capability permissive=1
  
@@ -1174,7 +1209,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
  @PCP_SELINUX_MACRO_RULE@
  files_read_all_files(pcp_pmcd_t)
  files_read_all_files(pcp_pmie_t)
-@@ -591,14 +330,17 @@ files_read_all_files(pcp_pmwebd_t)
+@@ -591,14 +338,17 @@ files_read_all_files(pcp_pmwebd_t)
  
  allow pcp_domain file_type:fifo_file read_fifo_file_perms;
  
@@ -1197,7 +1232,7 @@ diff -Naurp pcp-4.3.2.orig/src/selinux/pcpupstream.te.in pcp-4.3.2/src/selinux/p
 +@PCP_MMAP_ALL@
 diff -Naurp pcp-4.3.2.orig/src/selinux/README pcp-4.3.2/src/selinux/README
 --- pcp-4.3.2.orig/src/selinux/README	2019-04-09 10:48:01.000000000 +1000
-+++ pcp-4.3.2/src/selinux/README	2019-08-08 15:30:17.504036461 +1000
++++ pcp-4.3.2/src/selinux/README	2020-04-01 15:30:14.404025851 +1100
 @@ -55,6 +55,22 @@ rather than the singular form
  
  as reported by audit2allow -m.
diff --git a/SPECS/pcp.spec b/SPECS/pcp.spec
index 6b57466..7a30b1e 100644
--- a/SPECS/pcp.spec
+++ b/SPECS/pcp.spec
@@ -1,6 +1,6 @@
 Name:    pcp
 Version: 4.3.2
-Release: 6%{?dist}
+Release: 8%{?dist}
 Summary: System-level performance monitoring and performance management
 License: GPLv2+ and LGPLv2+ and CC-BY
 URL:     https://pcp.io
@@ -14,13 +14,19 @@ Source2: %{github}/pcp-webapp-grafana/archive/1.9.1-2/pcp-webapp-grafana-1.9.1-2
 Source3: %{github}/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz
 Source4: %{github}/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz
 # bcc/kernel compatibility (needed for the life of RHEL7)
-Patch0: redhat-bugzilla-1597975.patch
-Patch1: pmcd-pmlogger-local-context.patch
-Patch2: selinux-policy.patch
-Patch3: selinux-override.patch
-Patch4: qa-fixmod.patch
-Patch5: redhat-bugzilla-1721107.patch
-Patch6: redhat-bugzilla-1673053.patch
+Patch000: redhat-bugzilla-1597975.patch
+Patch001: pmcd-pmlogger-local-context.patch
+Patch002: selinux-policy.patch
+Patch003: selinux-override.patch
+Patch004: qa-fixmod.patch
+Patch005: redhat-bugzilla-1721107.patch
+Patch006: redhat-bugzilla-1673053.patch
+Patch007: redhat-bugzilla-1730107.patch
+Patch008: redhat-bugzilla-1730492.patch
+Patch009: redhat-bugzilla-1764748.patch
+Patch010: redhat-bugzilla-1765641.patch
+Patch011: redhat-bugzilla-1775373.patch
+Patch012: redhat-bugzilla-1818710.patch
 
 %if 0%{?fedora} >= 26 || 0%{?rhel} > 7
 %global __python2 python2
@@ -274,6 +280,7 @@ Requires: pcp-libs = %{version}-%{release}
 %global _testsdir %{_localstatedir}/lib/pcp/testsuite
 %global _selinuxdir %{_localstatedir}/lib/pcp/selinux
 %global _logconfdir %{_localstatedir}/lib/pcp/config/pmlogconf
+%global _ieconfdir %{_localstatedir}/lib/pcp/config/pmieconf
 %global _pixmapdir %{_datadir}/pcp-gui/pixmaps
 %global _hicolordir %{_datadir}/icons/hicolor
 %global _booksdir %{_datadir}/doc/pcp-doc
@@ -2086,7 +2093,7 @@ BuildRequires: setools
 %else
 BuildRequires: setools-console
 %endif
-Requires: policycoreutils
+Requires: policycoreutils selinux-policy-targeted
 
 %description selinux
 This package contains Security Enhanced Linux support for PCP.  The
@@ -2100,13 +2107,19 @@ adjustments for an updated policy package.
 %setup -q -T -D -a 3 -c -n graphite
 %setup -q -T -D -a 4 -c -n blinkenlights
 %setup -q
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
+%patch000 -p1
+%patch001 -p1
+%patch002 -p1
+%patch003 -p1
+%patch004 -p1
+%patch005 -p1
+%patch006 -p1
+%patch007 -p1
+%patch008 -p1
+%patch009 -p1
+%patch010 -p1
+%patch011 -p1
+%patch012 -p1
 
 %build
 %if !%{disable_python2} && 0%{?default_python} != 3
@@ -2298,8 +2311,11 @@ cat base_bin.list base_exec.list |\
 ls -1 $RPM_BUILD_ROOT/%{_logconfdir}/ |\
     sed -e 's#^#'%{_logconfdir}'\/#' |\
     grep -E -v 'zeroconf' >pcp-logconf.list
+ls -1 $RPM_BUILD_ROOT/%{_ieconfdir}/ |\
+    sed -e 's#^#'%{_ieconfdir}'\/#' |\
+    grep -E -v 'zeroconf' >pcp-ieconf.list
 cat base_pmdas.list base_bin.list base_exec.list pcp-logconf.list |\
-  grep -E -v 'pmdaib|pmmgr|pmweb|pmsnap|2pcp|pmdas/systemd' |\
+  grep -E -v 'pmdaib|pmmgr|pmweb|pmsnap|2pcp|pmdas/systemd|zeroconf' |\
   grep -E -v "$PCP_GUI|pixmaps|hicolor|pcp-doc|tutorials|selinux" |\
   grep -E -v %{_confdir} | grep -E -v %{_logsdir} > base.list
 
@@ -2341,56 +2357,6 @@ exit 0
 getent group pcp >/dev/null || groupadd -r pcp
 getent passwd pcp >/dev/null || \
   useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp
-PCP_CONFIG_DIR=%{_localstatedir}/lib/pcp/config
-PCP_SYSCONF_DIR=%{_confdir}
-PCP_LOG_DIR=%{_logsdir}
-PCP_ETC_DIR=%{_sysconfdir}
-# rename crontab files to align with current Fedora packaging guidelines
-for crontab in pmlogger pmie
-do
-    test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue
-    mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab"
-done
-# produce a script to run post-install to move configs to their new homes
-save_configs_script()
-{
-    _new="$1"
-    shift
-    for _dir
-    do
-        [ "$_dir" = "$_new" ] && continue
-        if [ -d "$_dir" ]
-        then
-            ( cd "$_dir" ; find . -maxdepth 1 -type f ) | sed -e 's/^\.\///' \
-            | while read _file
-            do
-                [ "$_file" = "control" ] && continue
-                _want=true
-                if [ -f "$_new/$_file" ]
-                then
-                    # file exists in both directories, pick the more
-                    # recently modified one
-                    _try=`find "$_dir/$_file" -newer "$_new/$_file" -print`
-                    [ -n "$_try" ] || _want=false
-                fi
-                $_want && echo cp -p "$_dir/$_file" "$_new/$_file"
-            done
-        fi
-    done
-}
-# migrate and clean configs if we have had a previous in-use installation
-[ -d "$PCP_LOG_DIR" ] || exit 0	# no configuration file upgrades required
-rm -f "$PCP_LOG_DIR/configs.sh"
-for daemon in pmie pmlogger
-do
-    save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_CONFIG_DIR/$daemon" \
-        "$PCP_SYSCONF_DIR/$daemon"
-done
-for daemon in pmcd pmproxy
-do
-    save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon"\
-        "$PCP_CONFIG_DIR/$daemon" /etc/$daemon
-done
 exit 0
 
 %if !%{disable_microhttpd}
@@ -2737,12 +2703,7 @@ pmieconf -c enable dmthin
 %endif
 
 %post
-PCP_LOG_DIR=%{_logsdir}
 PCP_PMNS_DIR=%{_pmnsdir}
-# restore saved configs, if any
-test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh"
-rm -f $PCP_LOG_DIR/configs.sh
-
 chown -R pcp:pcp %{_logsdir}/pmcd 2>/dev/null
 chown -R pcp:pcp %{_logsdir}/pmlogger 2>/dev/null
 chown -R pcp:pcp %{_logsdir}/sa 2>/dev/null
@@ -2769,7 +2730,7 @@ chmod 644 "$PCP_PMNS_DIR/.NeedRebuild"
     /sbin/service pmproxy condrestart
 %endif
 
-cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild
+cd "$PCP_PMNS_DIR" && ./Rebuild -s && rm -f .NeedRebuild
 cd
 
 %if 0%{?fedora} >= 26 || 0%{?rhel} > 7
@@ -2909,7 +2870,8 @@ cd
 %else
 %config(noreplace) %{_sysconfdir}/cron.d/pcp-pmlogger-daily-report
 %endif
-%{_localstatedir}/lib/pcp/config/pmlogconf/zeroconf
+%{_ieconfdir}/zeroconf
+%{_logconfdir}/zeroconf
 
 #additional pmlogger config files
 
@@ -3152,6 +3114,7 @@ cd
 
 %files pmda-dm
 %{_pmdasdir}/dm
+%{_ieconfdir}/dm
 
 %if !%{disable_bcc}
 %files pmda-bcc
@@ -3317,6 +3280,19 @@ cd
 %endif
 
 %changelog
+* Mon Apr 01 2020 Nathan Scott <nathans@redhat.com> - 4.3.2-8
+- Fix pcp-atop dynamic memory initialization issue (BZ 1818710)
+- Fix rpm %post privilege escalation CVEs (BZs 1815249, 1815528)
+- Resolve an selinux policy issue with pmlogger (BZ 1792859)
+
+* Mon Feb 17 2020 Nathan Scott <nathans@redhat.com> - 4.3.2-7
+- Fix hugepage metrics in pmdalinux (BZ 1730107)
+- Fix NUMA nodes instance domain in pmdalinux (BZ 1730492)
+- Several selinux policy fixes (BZs 1749870, 1756252, 1760750)
+- Fix pcp-atopsar sample count command line argument (BZ 1764748)
+- Fix pcp-atop sigsegv with certain process state changes (BZ 1765641)
+- Add pcp-zeroconf pmieconf rule to enable per-thread logging (BZ 1775373)
+
 * Wed Aug 28 2019 Nathan Scott <nathans@redhat.com> - 4.3.2-6
 - Improve libpcp corrupt archive handling in multi-archive mode (BZ 1673053)