Blame SOURCES/redhat-bugzilla-2081262-pmdaproc-cgroups-fix.patch

8ffe19
commit d874d2e486c8a64fa9945ed7aa0048cccbd46f77
8ffe19
Author: Nathan Scott <nathans@redhat.com>
8ffe19
Date:   Wed May 4 17:11:19 2022 +1000
8ffe19
8ffe19
    pmdaproc: fix cgroup cpu metrics refresh structures
8ffe19
    
8ffe19
    Jan Kurik encountered this issue when running the regression
8ffe19
    testsuite (especially qa/359) on non-x86_64 architectures.
8ffe19
    
8ffe19
    Something must've changed in the toolchain recently on these
8ffe19
    platforms since we've not seen this before, but this bug has
8ffe19
    been in our code for some time.  It works everywhere else by
8ffe19
    good fortune, when there just happen to be NULLs after these
8ffe19
    cgroups CPU parsing data structures.
8ffe19
    
8ffe19
    Resolves Red Hat BZ #2081262.
8ffe19
8ffe19
diff --git a/src/pmdas/linux_proc/cgroups.c b/src/pmdas/linux_proc/cgroups.c
8ffe19
index 413a72343..26d59863a 100644
8ffe19
--- a/src/pmdas/linux_proc/cgroups.c
8ffe19
+++ b/src/pmdas/linux_proc/cgroups.c
8ffe19
@@ -1,5 +1,5 @@
8ffe19
 /*
8ffe19
- * Copyright (c) 2012-2019 Red Hat.
8ffe19
+ * Copyright (c) 2012-2019,2022 Red Hat.
8ffe19
  * Copyright (c) 2010 Aconex.  All Rights Reserved.
8ffe19
  *
8ffe19
  * This program is free software; you can redistribute it and/or modify it
8ffe19
@@ -863,6 +863,7 @@ read_cpu_time(const char *file, cgroup_cputime_t *ccp)
8ffe19
 	{ "usage_usec",			&cputime.usage },
8ffe19
 	{ "user_usec",			&cputime.user },
8ffe19
 	{ "system_usec",		&cputime.system },
8ffe19
+	{ NULL, NULL }
8ffe19
     };
8ffe19
     char buffer[4096], name[64];
8ffe19
     unsigned long long value;
8ffe19
@@ -903,6 +904,7 @@ read_cpu_stats(const char *file, cgroup_cpustat_t *ccp)
8ffe19
 	{ "nr_periods",			&cpustat.nr_periods },
8ffe19
 	{ "nr_throttled",		&cpustat.nr_throttled },
8ffe19
 	{ "throttled_time",		&cpustat.throttled_time },
8ffe19
+	{ NULL, NULL }
8ffe19
     };
8ffe19
     char buffer[4096], name[64];
8ffe19
     unsigned long long value;