]> granicus.if.org Git - procps-ng/commitdiff
library: partial revert of that numa 'fix', <STAT> api
authorJim Warner <james.warner@comcast.net>
Wed, 22 Jun 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Tue, 28 Jun 2016 11:11:25 +0000 (21:11 +1000)
This patch represents the partial revert of the commit
referenced below. And, so that yours truly (the author
for goodness sake) doesn't shoot his tootsies again in
the future, a cautionary programmer comment was added.

Reference(s):
commit dea403341886d7cc8338fd14461835794625b6a1

Signed-off-by: Jim Warner <james.warner@comcast.net>
proc/stat.c

index 3c174613b12a99f4dffe02fd825ca28971b765f3..22863f41af4b61bbd123440343cc427318b932ee 100644 (file)
@@ -965,14 +965,17 @@ PROCPS_EXPORT struct stat_reaped *procps_stat_reap (
                 return NULL;
             break;
         case STAT_REAP_CPUS_AND_NODES:
-            if (!stacks_fetch_tics(info, &info->cpus))
-                return NULL;
 #ifndef NUMA_DISABLE
+            /* note: if we are doing numa at all, we must call make_numa_hist
+               before we build (fetch) the cpu stacks since the read_stat guy
+               will have marked (temporarily) all the cpu node ids as invalid */
             if (0 > make_numa_hist(info))
                 return NULL;
             // tolerate an unexpected absence of libnuma.so ...
             stacks_fetch_tics(info, &info->nodes);
 #endif
+            if (!stacks_fetch_tics(info, &info->cpus))
+                return NULL;
             break;
         default:
             return NULL;