library: make struct name more descriptive, <STAT> api

After normalizing the <SLABINFO> module, much of which
was based on this module, a structure which is crucial
to concurrent select/reap support is renamed the same.

Such a need for concurrent support was revealed during
slabtop testing. That program requests (select) global
data after calling for individual node data (reap) but
before those stacks have been accessed. Therefore, one
set of 'items'/'extents' could not possibly be shared.

So now we will know the former struct fetch_support as
ext_support. The former name was potentially confusing
since the struct was used by both 'select' and 'reap'.
However, only 'reap' ever called the 'fetch' function.

[ this <STAT> already accommodated concurrent usage. ]
[ in fact it contains 3 separate sets of items/exts. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2016-06-06 00:00:00 -05:00 committed by Craig Small
parent 8650518b5a
commit 335cbc2e61

View File

@ -76,7 +76,7 @@ struct stacks_extent {
struct stat_stack **stacks;
};
struct fetch_support {
struct ext_support {
int numitems; // includes 'logical_end' delimiter
enum stat_item *items; // includes 'logical_end' delimiter
struct stacks_extent *extents; // anchor for these extents
@ -91,7 +91,7 @@ struct tic_support {
struct reap_support {
int total; // independently obtained # of cpus/nodes
struct fetch_support fetch; // extents plus items details
struct ext_support fetch; // extents plus items details
struct tic_support hist; // cpu and node jiffies management
int n_anchor_alloc; // last known anchor pointers allocation
struct stat_stack **anchor; // reapable stacks (consolidated extents)
@ -106,8 +106,8 @@ struct procps_statinfo {
struct hist_tic cpu_hist; // TIC type management for cpu summary
struct reap_support cpus; // TIC type management for real cpus
struct reap_support nodes; // TIC type management for numa nodes
struct fetch_support cpu_summary; // supports /proc/stat line #1 results
struct fetch_support select; // support for 'procps_stat_select()'
struct ext_support cpu_summary; // supports /proc/stat line #1 results
struct ext_support select; // support for 'procps_stat_select()'
struct stat_reaped results; // for return to caller after a reap
#ifndef NUMA_DISABLE
void *libnuma_handle; // if dlopen() for libnuma succeessful
@ -359,7 +359,7 @@ static inline void cleanup_stack (
static inline void cleanup_stacks_all (
struct fetch_support *this)
struct ext_support *this)
{
struct stacks_extent *ext = this->extents;
int i;
@ -374,7 +374,7 @@ static inline void cleanup_stacks_all (
static void extents_free_all (
struct fetch_support *this)
struct ext_support *this)
{
do {
struct stacks_extent *p = this->extents;
@ -646,7 +646,7 @@ reap_em_again:
* Returns a stack_extent struct anchoring the 'heads' of each new stack.
*/
static struct stacks_extent *stacks_alloc (
struct fetch_support *this,
struct ext_support *this,
int maxstacks)
{
struct stacks_extent *p_blob;
@ -742,7 +742,7 @@ static int stacks_fetch_tics (
static int stacks_reconfig_maybe (
struct fetch_support *this,
struct ext_support *this,
enum stat_item *items,
int numitems)
{
@ -769,7 +769,7 @@ static int stacks_reconfig_maybe (
static struct stat_stack *update_single_stack (
struct procps_statinfo *info,
struct fetch_support *this,
struct ext_support *this,
enum stat_item *items,
int numitems)
{
@ -777,7 +777,7 @@ static struct stat_stack *update_single_stack (
return NULL;
if (!this->extents
&& !(this->extents = stacks_alloc(this, 1)))
&& !(stacks_alloc(this, 1)))
return NULL;
if (this->dirty_stacks)