memset(info->nodes.hist.tics, 0, info->nodes.hist.n_alloc * sizeof(struct hist_tic));
nod_ptr = info->nodes.hist.tics;
for (i = 0; i < info->nodes.total; i++) {
- nod_ptr->id = nod_ptr->numa_node = STAT_NODE_INVALID;
+ nod_ptr->numa_node = STAT_NODE_INVALID;
+ nod_ptr->id = i;
++nod_ptr;
}
nod_ptr->new.xusr += cpu_ptr->new.xusr; nod_ptr->old.xusr += cpu_ptr->old.xusr;
nod_ptr->new.xsys += cpu_ptr->new.xsys; nod_ptr->old.xsys += cpu_ptr->old.xsys;
- cpu_ptr->numa_node = node;
- nod_ptr->id = node;
+ cpu_ptr->numa_node = nod_ptr->numa_node = node;
nod_ptr->count++; ;
}
}
p->refcount = 1;
p->results.cpus = &p->cpus.result;
- p->results.nodes = &p->nodes.result;
+ p->results.numa = &p->nodes.result;
// these 3 are for reap, sharing a single set of items
p->cpu_summary.items = p->cpus.fetch.items = p->nodes.fetch.items = &p->reap_items;
errno = EINVAL;
if (info == NULL || items == NULL)
return NULL;
- if (what != STAT_REAP_CPUS_ONLY && what != STAT_REAP_CPUS_AND_NODES)
+ if (what != STAT_REAP_CPUS_ONLY && what != STAT_REAP_NUMA_NODES_TOO)
return NULL;
#ifdef ENFORCE_LOGICAL
if (0 > stat_stacks_fetch(info, &info->cpus))
return NULL;
break;
- case STAT_REAP_CPUS_AND_NODES:
+ case STAT_REAP_NUMA_NODES_TOO:
/* note: if we're doing numa at all, we must do this numa history |
before we build (fetch) cpu stacks since that stat_read_failed |
guy always marks (temporarily) all the cpu node ids as invalid | */
STAT_extra, // ( reset to zero )
// returns origin, see proc(5)
// ------- -------------------
- STAT_TIC_ID, // s_int /proc/stat
- STAT_TIC_NUMA_NODE, // s_int [ ID based, see: numa(3) ]
+ STAT_TIC_ID, // s_int /proc/stat, cpu or numa node id
+ STAT_TIC_NUMA_NODE, // s_int [ CPU ID based, see: numa(3) ]
STAT_TIC_NUM_CONTRIBUTORS, // s_int [ total CPUs contributing to TIC counts ]
STAT_TIC_USER, // ull_int /proc/stat
enum stat_reap_type {
STAT_REAP_CPUS_ONLY,
- STAT_REAP_CPUS_AND_NODES
+ STAT_REAP_NUMA_NODES_TOO
};
enum stat_sort_order {
struct stat_reaped {
struct stat_stack *summary;
struct stat_reap *cpus;
- struct stat_reap *nodes;
+ struct stat_reap *numa;
};
+ // STAT_TIC_ID value for /proc/stat cpu summary
#define STAT_SUMMARY_ID -11111
+ // STAT_TIC_NUMA_NODE value for STAT_REAP_CPUS_ONLY or
+ // for STAT_REAP_NUMA_NODES_TOO when node was inactive
#define STAT_NODE_INVALID -22222
+
#define STAT_GET( info, actual_enum, type ) ( { \
struct stat_result *r = procps_stat_get( info, actual_enum ); \
r ? r->result . type : 0; } )