ST_I_INF_MAX
};
+/* Flags for stat_col.flags */
+#define STAT_COL_FL_NONE 0x00
+#define STAT_COL_FL_GENERIC 0x01 /* stat is generic if set */
+
/* Represent an exposed statistic. */
struct stat_col {
const char *name; /* short name, used notably in CSV headers */
uint32_t type; /* combination of field_nature and field_format */
uint8_t cap; /* mask of stats_domain_px_cap to restrain metrics to an object types subset */
- uint8_t generic; /* bit set if generic */
- /* 2 bytes hole */
+ /* 1 byte hole */
+ uint16_t flags; /* STAT_COL_FL_* flags */
/* used only for generic metrics */
struct {
/* Returns true if <col> is fully defined, false if only used as name-desc. */
static inline int stcol_is_generic(const struct stat_col *col)
{
- return col->generic;
+ return col->flags & STAT_COL_FL_GENERIC;
}
static inline enum field_format stcol_format(const struct stat_col *col)
.metric.offset[0] = offsetof(struct fe_counters, offset_f), \
.metric.offset[1] = offsetof(struct be_counters, offset_f), \
.cap = (cap_f), \
- .generic = 1, \
+ .flags = STAT_COL_FL_GENERIC, \
.alt_name = alt_n, \
}
{ .name = (name_f), .desc = (desc_f), .type = (nature)|(format), \
.metric.offset[0] = offsetof(struct fe_counters, offset_f), \
.cap = (cap_f), \
- .generic = 1, \
+ .flags = STAT_COL_FL_GENERIC, \
.alt_name = alt_n, \
}
{ .name = (name_f), .desc = (desc_f), .type = (nature)|(format), \
.metric.offset[1] = offsetof(struct be_counters, offset_f), \
.cap = (cap_f), \
- .generic = 1, \
+ .flags = STAT_COL_FL_GENERIC, \
.alt_name = alt_n, \
}