*/
struct activity cpu_act = {
.id = A_CPU,
- .options = AO_COLLECTED + AO_MULTIPLE_OUTPUTS +
- AO_GRAPH_PER_ITEM,
+ .options = AO_COLLECTED + AO_COUNTED + AO_PERSISTENT +
+ AO_MULTIPLE_OUTPUTS + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
/* Interrupts statistics */
struct activity irq_act = {
.id = A_IRQ,
- .options = AO_NULL,
+ .options = AO_COUNTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_INT,
#ifdef SOURCE_SADC
/* Serial lines activity */
struct activity serial_act = {
.id = A_SERIAL,
- .options = AO_COLLECTED,
+ .options = AO_COLLECTED + AO_COUNTED,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
/* Block devices activity */
struct activity disk_act = {
.id = A_DISK,
- .options = AO_GRAPH_PER_ITEM,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DISK,
#ifdef SOURCE_SADC
/* Network interfaces activity */
struct activity net_dev_act = {
.id = A_NET_DEV,
- .options = AO_COLLECTED + AO_GRAPH_PER_ITEM,
+ .options = AO_COLLECTED + AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE + 2,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
/* Network interfaces (errors) activity */
struct activity net_edev_act = {
.id = A_NET_EDEV,
- .options = AO_COLLECTED + AO_GRAPH_PER_ITEM,
+ .options = AO_COLLECTED + AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE + 1,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
/* CPU frequency */
struct activity pwr_cpufreq_act = {
.id = A_PWR_CPUFREQ,
- .options = AO_GRAPH_PER_ITEM,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
/* Fan */
struct activity pwr_fan_act = {
.id = A_PWR_FAN,
- .options = AO_GRAPH_PER_ITEM,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
/* Temperature */
struct activity pwr_temp_act = {
.id = A_PWR_TEMP,
- .options = AO_GRAPH_PER_ITEM,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
/* Voltage inputs */
struct activity pwr_in_act = {
.id = A_PWR_IN,
- .options = AO_GRAPH_PER_ITEM,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
/* CPU weighted frequency */
struct activity pwr_wghfreq_act = {
.id = A_PWR_WGHFREQ,
- .options = AO_MATRIX,
+ .options = AO_COUNTED + AO_MATRIX,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
/* USB devices plugged into the system */
struct activity pwr_usb_act = {
.id = A_PWR_USB,
- .options = AO_CLOSE_MARKUP,
+ .options = AO_COUNTED + AO_CLOSE_MARKUP,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_POWER,
#ifdef SOURCE_SADC
/* Filesystem usage activity */
struct activity filesystem_act = {
.id = A_FILESYSTEM,
- .options = AO_GRAPH_PER_ITEM + AO_MULTIPLE_OUTPUTS,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM + AO_MULTIPLE_OUTPUTS,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_XDISK,
#ifdef SOURCE_SADC
/* Fibre Channel HBA usage activity */
struct activity fchost_act = {
.id = A_NET_FC,
- .options = AO_GRAPH_PER_ITEM,
+ .options = AO_COUNTED + AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DISK,
#ifdef SOURCE_SADC
/* Softnet activity */
struct activity softnet_act = {
.id = A_NET_SOFT,
- .options = AO_COLLECTED + AO_CLOSE_MARKUP + AO_GRAPH_PER_ITEM,
+ .options = AO_COLLECTED + AO_COUNTED + AO_CLOSE_MARKUP +
+ AO_GRAPH_PER_ITEM,
.magic = ACTIVITY_MAGIC_BASE,
.group = G_DEFAULT,
#ifdef SOURCE_SADC
*/
#define AO_SELECTED 0x02
/*
- * 0x04: Unused.
- * 0x08: Unused.
+ * Indicate that corresponding activity has items that need to be counted.
+ * This means that its @f_count_index values is >= 0.
+ * (We use AO_COUNTED instead of @f_count_index because @f_count_index
+ * is available (initialized) only for sadc).
*/
+#define AO_COUNTED 0x04
+/*
+ * Indicate that activity's metrics have persistent values when devices
+ * are registered again (this means that when the device is registered again,
+ * the metrics pick the values they had when they had been unregistered).
+ */
+#define AO_PERSISTENT 0x08
/*
* This flag should be set for every activity closing a markup used
* by several activities. Used by sadf f_xml_print() functions to
#define IS_COLLECTED(m) (((m) & AO_COLLECTED) == AO_COLLECTED)
#define IS_SELECTED(m) (((m) & AO_SELECTED) == AO_SELECTED)
+#define HAS_COUNT_FUNCTION(m) (((m) & AO_COUNTED) == AO_COUNTED)
+#define HAS_PERSISTENT_VALUES(m) (((m) & AO_PERSISTENT) == AO_PERSISTENT)
#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)