activity structure's f_count2() member (used to count the number of
sub-items) was tested in sadf.c but never initialized (its value is
initialized only when sadc.c is compiled, not sadf.c). So use a specific
flag to indicate if activity has sub-items instead of testing f_count2()
value.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
/* CPU weighted frequency */
struct activity pwr_wghfreq_act = {
.id = A_PWR_WGHFREQ,
- .options = AO_VOLATILE,
+ .options = AO_VOLATILE + AO_MATRIX,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
* distinct item for this activity (sadf -g).
*/
#define AO_GRAPH_PER_ITEM 0x40
+/*
+ * Indicate that this activity may have sub-items.
+ */
+#define AO_MATRIX 0x80
#define IS_COLLECTED(m) (((m) & AO_COLLECTED) == AO_COLLECTED)
#define IS_SELECTED(m) (((m) & AO_SELECTED) == AO_SELECTED)
#define CLOSE_MARKUP(m) (((m) & AO_CLOSE_MARKUP) == AO_CLOSE_MARKUP)
#define HAS_MULTIPLE_OUTPUTS(m) (((m) & AO_MULTIPLE_OUTPUTS) == AO_MULTIPLE_OUTPUTS)
#define ONE_GRAPH_PER_ITEM(m) (((m) & AO_GRAPH_PER_ITEM) == AO_GRAPH_PER_ITEM)
+#define IS_MATRIX(m) (((m) & AO_MATRIX) == AO_MATRIX)
#define _buf0 buf[0]
p = get_activity_position(act, id_seq[i], EXIT_IF_NOT_FOUND);
printf("%02d: %s\t(x%d)", act[p]->id, act[p]->name, act[p]->nr);
- if (act[p]->f_count2 || (act[p]->nr2 > 1)) {
+ if (IS_MATRIX(act[p]->options) || (act[p]->nr2 > 1)) {
printf("\t(x%d)", act[p]->nr2);
}
if (act[p]->magic == ACTIVITY_MAGIC_UNKNOWN) {