|
|
87cc1f |
commit 29092aa58df23fcc43f813d54b16a733d19f770c
|
|
|
87cc1f |
Author: Nathan Scott <nathans@redhat.com>
|
|
|
87cc1f |
Date: Tue Jul 16 12:28:26 2019 +1000
|
|
|
87cc1f |
|
|
|
87cc1f |
pmdalinux: fix hugepage metric value calculations
|
|
|
87cc1f |
|
|
|
87cc1f |
The values for some of the Linux kernel hugepage metrics were
|
|
|
87cc1f |
being incorrectly multiplied by 1024. This was due to a code
|
|
|
87cc1f |
assumption in proc_meminfo.c::refresh_proc_meminfo around line
|
|
|
87cc1f |
115, which was assuming all meminfo values needed conversion
|
|
|
87cc1f |
from kbytes to bytes - not so for these metrics.
|
|
|
87cc1f |
|
|
|
87cc1f |
The fix involves removing this assumption (for all values from
|
|
|
87cc1f |
/proc/meminfo) and individually applying unit conversion where
|
|
|
87cc1f |
needed only. Updated calculations are now reflected in qa/821.
|
|
|
87cc1f |
|
|
|
87cc1f |
Resolves Red Hat BZ #1730107.
|
|
|
87cc1f |
|
|
|
87cc1f |
diff --git a/qa/821.out b/qa/821.out
|
|
|
87cc1f |
index b519775e9..8ab0d47b3 100644
|
|
|
87cc1f |
--- a/qa/821.out
|
|
|
87cc1f |
+++ b/qa/821.out
|
|
|
87cc1f |
@@ -5360,28 +5360,28 @@ mem.util.highTotal
|
|
|
87cc1f |
No value(s) available!
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesFree
|
|
|
87cc1f |
- value 185344
|
|
|
87cc1f |
+ value 181
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesFreeBytes
|
|
|
87cc1f |
- value 388694540288
|
|
|
87cc1f |
+ value 379584512
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesRsvd
|
|
|
87cc1f |
- value 11264
|
|
|
87cc1f |
+ value 11
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesRsvdBytes
|
|
|
87cc1f |
- value 23622320128
|
|
|
87cc1f |
+ value 23068672
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesSurp
|
|
|
87cc1f |
- value 8192
|
|
|
87cc1f |
+ value 8
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesSurpBytes
|
|
|
87cc1f |
- value 17179869184
|
|
|
87cc1f |
+ value 16777216
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesTotal
|
|
|
87cc1f |
- value 204800
|
|
|
87cc1f |
+ value 200
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.hugepagesTotalBytes
|
|
|
87cc1f |
- value 429496729600
|
|
|
87cc1f |
+ value 419430400
|
|
|
87cc1f |
|
|
|
87cc1f |
mem.util.inactive
|
|
|
87cc1f |
value 17315560
|
|
|
87cc1f |
diff --git a/src/pmdas/linux/pmda.c b/src/pmdas/linux/pmda.c
|
|
|
87cc1f |
index f8460902b..115731a6e 100644
|
|
|
87cc1f |
--- a/src/pmdas/linux/pmda.c
|
|
|
87cc1f |
+++ b/src/pmdas/linux/pmda.c
|
|
|
87cc1f |
@@ -6483,18 +6483,18 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
|
|
|
87cc1f |
case 0: /* mem.physmem (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.MemTotal >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MemTotal;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 1: /* mem.util.used (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemTotal) ||
|
|
|
87cc1f |
!MEMINFO_VALID_VALUE(proc_meminfo.MemFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = (proc_meminfo.MemTotal - proc_meminfo.MemFree) >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MemTotal - proc_meminfo.MemFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 2: /* mem.util.free (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.MemFree >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MemFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 3: /* mem.util.shared (in kbytes) */
|
|
|
87cc1f |
/*
|
|
|
87cc1f |
@@ -6504,43 +6504,43 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
|
|
|
87cc1f |
*/
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemShared))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.MemShared >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MemShared;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 4: /* mem.util.bufmem (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Buffers))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Buffers >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Buffers;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 5: /* mem.util.cached (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Cached))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Cached >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Cached;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 6: /* swap.length (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SwapTotal;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SwapTotal << 10;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 7: /* swap.used (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapTotal) ||
|
|
|
87cc1f |
!MEMINFO_VALID_VALUE(proc_meminfo.SwapFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SwapTotal - proc_meminfo.SwapFree;
|
|
|
87cc1f |
+ atom->ull = (proc_meminfo.SwapTotal - proc_meminfo.SwapFree) << 10;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 8: /* swap.free (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SwapFree;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SwapFree << 10;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 9: /* hinv.physmem (in mbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ul = proc_meminfo.MemTotal >> 20;
|
|
|
87cc1f |
+ atom->ul = proc_meminfo.MemTotal >> 10;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 10: /* mem.freemem (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.MemFree >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MemFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 11: /* hinv.pagesize (in bytes) */
|
|
|
87cc1f |
atom->ul = 1 << _pm_pageshift;
|
|
|
87cc1f |
@@ -6552,91 +6552,91 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
|
|
|
87cc1f |
!MEMINFO_VALID_VALUE(proc_meminfo.Cached) ||
|
|
|
87cc1f |
!MEMINFO_VALID_VALUE(proc_meminfo.Buffers))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- sl = (proc_meminfo.MemTotal -
|
|
|
87cc1f |
+ sl = proc_meminfo.MemTotal -
|
|
|
87cc1f |
proc_meminfo.MemFree -
|
|
|
87cc1f |
proc_meminfo.Cached -
|
|
|
87cc1f |
- proc_meminfo.Buffers) >> 10;
|
|
|
87cc1f |
+ proc_meminfo.Buffers;
|
|
|
87cc1f |
atom->ull = sl >= 0 ? sl : 0;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 13: /* mem.util.swapCached (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapCached))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SwapCached >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SwapCached;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 14: /* mem.util.active (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Active))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Active >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Active;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 15: /* mem.util.inactive (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Inactive))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Inactive >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Inactive;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 16: /* mem.util.highTotal (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HighTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HighTotal >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HighTotal;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 17: /* mem.util.highFree (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HighFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HighFree >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HighFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 18: /* mem.util.lowTotal (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.LowTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.LowTotal >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.LowTotal;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 19: /* mem.util.lowFree (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.LowFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.LowFree >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.LowFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 20: /* mem.util.swapTotal (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SwapTotal >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SwapTotal;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 21: /* mem.util.swapFree (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SwapFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SwapFree >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SwapFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 22: /* mem.util.dirty (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Dirty))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Dirty >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Dirty;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 23: /* mem.util.writeback (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Writeback))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Writeback >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Writeback;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 24: /* mem.util.mapped (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Mapped))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Mapped >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Mapped;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 25: /* mem.util.slab (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Slab))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Slab >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Slab;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 26: /* mem.util.committed_AS (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Committed_AS))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Committed_AS >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Committed_AS;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 27: /* mem.util.pageTables (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.PageTables))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.PageTables >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.PageTables;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 28: /* mem.util.reverseMaps (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.ReverseMaps))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.ReverseMaps >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.ReverseMaps;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 29: /* mem.util.cache_clean (in kbytes) */
|
|
|
87cc1f |
/* clean=cached-(dirty+writeback) */
|
|
|
87cc1f |
@@ -6644,180 +6644,184 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
|
|
|
87cc1f |
!MEMINFO_VALID_VALUE(proc_meminfo.Dirty) ||
|
|
|
87cc1f |
!MEMINFO_VALID_VALUE(proc_meminfo.Writeback))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- sl = (proc_meminfo.Cached -
|
|
|
87cc1f |
+ sl = proc_meminfo.Cached -
|
|
|
87cc1f |
proc_meminfo.Dirty -
|
|
|
87cc1f |
- proc_meminfo.Writeback) >> 10;
|
|
|
87cc1f |
+ proc_meminfo.Writeback;
|
|
|
87cc1f |
atom->ull = sl >= 0 ? sl : 0;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 30: /* mem.util.anonpages */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.AnonPages))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.AnonPages >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.AnonPages;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 31: /* mem.util.commitLimit (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.CommitLimit))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.CommitLimit >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.CommitLimit;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 32: /* mem.util.bounce */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Bounce))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Bounce >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Bounce;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 33: /* mem.util.NFS_Unstable */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.NFS_Unstable))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.NFS_Unstable >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.NFS_Unstable;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 34: /* mem.util.slabReclaimable */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SlabReclaimable))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SlabReclaimable >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SlabReclaimable;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 35: /* mem.util.slabUnreclaimable */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.SlabUnreclaimable))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.SlabUnreclaimable >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.SlabUnreclaimable;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 36: /* mem.util.active_anon */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Active_anon))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Active_anon >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Active_anon;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 37: /* mem.util.inactive_anon */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Inactive_anon))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Inactive_anon >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Inactive_anon;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 38: /* mem.util.active_file */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Active_file))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Active_file >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Active_file;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 39: /* mem.util.inactive_file */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Inactive_file))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Inactive_file >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Inactive_file;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 40: /* mem.util.unevictable */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Unevictable))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Unevictable >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Unevictable;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 41: /* mem.util.mlocked */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Mlocked))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Mlocked >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Mlocked;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 42: /* mem.util.shmem */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Shmem))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Shmem >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Shmem;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 43: /* mem.util.kernelStack */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.KernelStack))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.KernelStack >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.KernelStack;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 44: /* mem.util.hugepagesTotal */
|
|
|
87cc1f |
+ case 44: /* mem.util.hugepagesTotal (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
atom->ull = proc_meminfo.HugepagesTotal;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 45: /* mem.util.hugepagesFree */
|
|
|
87cc1f |
+ case 45: /* mem.util.hugepagesFree (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
atom->ull = proc_meminfo.HugepagesFree;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 46: /* mem.util.hugepagesRsvd */
|
|
|
87cc1f |
+ case 46: /* mem.util.hugepagesRsvd (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesRsvd))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
atom->ull = proc_meminfo.HugepagesRsvd;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 47: /* mem.util.hugepagesSurp */
|
|
|
87cc1f |
+ case 47: /* mem.util.hugepagesSurp (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesSurp))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
atom->ull = proc_meminfo.HugepagesSurp;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 48: /* mem.util.directMap4k */
|
|
|
87cc1f |
+ case 48: /* mem.util.directMap4k (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.directMap4k))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.directMap4k >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.directMap4k;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 49: /* mem.util.directMap2M */
|
|
|
87cc1f |
+ case 49: /* mem.util.directMap2M (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.directMap2M))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.directMap2M >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.directMap2M;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 50: /* mem.util.vmallocTotal */
|
|
|
87cc1f |
+ case 50: /* mem.util.vmallocTotal (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.VmallocTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.VmallocTotal >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.VmallocTotal;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 51: /* mem.util.vmallocUsed */
|
|
|
87cc1f |
+ case 51: /* mem.util.vmallocUsed (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.VmallocUsed))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.VmallocUsed >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.VmallocUsed;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 52: /* mem.util.vmallocChunk */
|
|
|
87cc1f |
+ case 52: /* mem.util.vmallocChunk (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.VmallocChunk))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.VmallocChunk >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.VmallocChunk;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 53: /* mem.util.mmap_copy */
|
|
|
87cc1f |
+ case 53: /* mem.util.mmap_copy (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MmapCopy))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.MmapCopy >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MmapCopy;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 54: /* mem.util.quicklists */
|
|
|
87cc1f |
+ case 54: /* mem.util.quicklists (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Quicklists))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.Quicklists >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.Quicklists;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 55: /* mem.util.corrupthardware */
|
|
|
87cc1f |
+ case 55: /* mem.util.corrupthardware (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HardwareCorrupted))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HardwareCorrupted >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HardwareCorrupted;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 56: /* mem.util.anonhugepages */
|
|
|
87cc1f |
+ case 56: /* mem.util.anonhugepages (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.AnonHugePages))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.AnonHugePages >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.AnonHugePages;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 57: /* mem.util.directMap1G */
|
|
|
87cc1f |
+ case 57: /* mem.util.directMap1G (in pages) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.directMap1G))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.directMap1G >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.directMap1G;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 58: /* mem.util.available */
|
|
|
87cc1f |
+ case 58: /* mem.util.available (in kbytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.MemAvailable))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.MemAvailable >> 10;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.MemAvailable;
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 59: /* hinv.hugepagesize (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ul = proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ul = (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 60: /* mem.util.hugepagesTotalBytes */
|
|
|
87cc1f |
+ case 60: /* mem.util.hugepagesTotalBytes (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesTotal))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HugepagesTotal * proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HugepagesTotal *
|
|
|
87cc1f |
+ (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 61: /* mem.util.hugepagesFreeBytes */
|
|
|
87cc1f |
+ case 61: /* mem.util.hugepagesFreeBytes (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesFree))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HugepagesFree * proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HugepagesFree *
|
|
|
87cc1f |
+ (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 62: /* mem.util.hugepagesRsvdBytes */
|
|
|
87cc1f |
+ case 62: /* mem.util.hugepagesRsvdBytes (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesRsvd))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HugepagesRsvd * proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HugepagesRsvd *
|
|
|
87cc1f |
+ (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
- case 63: /* mem.util.hugepagesSurpBytes */
|
|
|
87cc1f |
+ case 63: /* mem.util.hugepagesSurpBytes (in bytes) */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.HugepagesSurp))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
- atom->ull = proc_meminfo.HugepagesSurp * proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull = proc_meminfo.HugepagesSurp *
|
|
|
87cc1f |
+ (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
default:
|
|
|
87cc1f |
return PM_ERR_PMID;
|
|
|
87cc1f |
@@ -7825,19 +7829,19 @@ linux_fetchCallBack(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
sts = linux_table_lookup("HugePages_Total:", np->meminfo, &atom->ull);
|
|
|
87cc1f |
- atom->ull *= proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull *= (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 40: /* mem.numa.util.hugepagesFreeBytes */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
sts = linux_table_lookup("HugePages_Free:", np->meminfo, &atom->ull);
|
|
|
87cc1f |
- atom->ull *= proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull *= (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
case 41: /* mem.numa.util.hugepagesSurpBytes */
|
|
|
87cc1f |
if (!MEMINFO_VALID_VALUE(proc_meminfo.Hugepagesize))
|
|
|
87cc1f |
return 0; /* no values available */
|
|
|
87cc1f |
sts = linux_table_lookup("HugePages_Surp:", np->meminfo, &atom->ull);
|
|
|
87cc1f |
- atom->ull *= proc_meminfo.Hugepagesize;
|
|
|
87cc1f |
+ atom->ull *= (proc_meminfo.Hugepagesize << 10);
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
|
|
|
87cc1f |
default:
|
|
|
87cc1f |
diff --git a/src/pmdas/linux/proc_meminfo.c b/src/pmdas/linux/proc_meminfo.c
|
|
|
87cc1f |
index a3270e3ed..c5011ceb8 100644
|
|
|
87cc1f |
--- a/src/pmdas/linux/proc_meminfo.c
|
|
|
87cc1f |
+++ b/src/pmdas/linux/proc_meminfo.c
|
|
|
87cc1f |
@@ -113,7 +113,6 @@ refresh_proc_meminfo(proc_meminfo_t *proc_meminfo)
|
|
|
87cc1f |
for (bufp++; *bufp; bufp++) {
|
|
|
87cc1f |
if (isdigit((int)*bufp)) {
|
|
|
87cc1f |
sscanf(bufp, "%llu", (unsigned long long *)p);
|
|
|
87cc1f |
- *p *= 1024; /* kbytes -> bytes */
|
|
|
87cc1f |
break;
|
|
|
87cc1f |
}
|
|
|
87cc1f |
}
|