summaryrefslogtreecommitdiffstats
path: root/pcp/Platform.c
diff options
context:
space:
mode:
authorSohaib <sohaib.amhmd@gmail.com>2021-02-22 16:50:39 +1100
committerNathan Scott <nathans@redhat.com>2021-06-09 17:09:29 +1000
commit407d32e1213b655e64b21f9864f8117a4d80871c (patch)
treed4db4da46d5987b9050487addfc44f181d727d97 /pcp/Platform.c
parente1d1a5cec6db15c05e6b75f06e451c7ffa3fde24 (diff)
Fix PCP ZramMeter in presense of missing zram metrics
Diffstat (limited to 'pcp/Platform.c')
-rw-r--r--pcp/Platform.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pcp/Platform.c b/pcp/Platform.c
index 37074cc2..5882338b 100644
--- a/pcp/Platform.c
+++ b/pcp/Platform.c
@@ -605,6 +605,9 @@ void Platform_setZramValues(Meter* this) {
(void)this;
int i, count = Metric_instanceCount(PCP_ZRAM_CAPACITY);
+ if(!count)
+ return;
+
pmAtomValue *values = xCalloc(count, sizeof(pmAtomValue));
ZramStats stats = {0};

© 2014-2024 Faster IT GmbH | imprint | privacy policy