return (1 - irq_list_action);
}
- static void irq_submit (unsigned int irq, derive_t value)
-static void irq_submit (const char *irq_name, counter_t value)
++static void irq_submit (const char *irq_name, derive_t value)
{
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- int status;
- if (check_ignore_irq (irq))
+ if (check_ignore_irq (irq_name))
return;
- values[0].counter = value;
+ values[0].derive = value;
vl.values = values;
vl.values_len = 1;
sstrerror (errno, errbuf, sizeof (errbuf)));
return (-1);
}
- while (fgets (buffer, BUFSIZE, fh) != NULL)
+
+ while (fgets (buffer, sizeof (buffer), fh) != NULL)
{
- unsigned int irq;
+ char *irq_name;
+ size_t irq_name_len;
+ derive_t irq_value;
- char *endptr;
+ int i;
+
+ char *fields[64];
+ int fields_num;
fields_num = strsplit (buffer, fields, 64);
if (fields_num < 2)
irq_value = 0;
for (i = 1; i < fields_num; i++)
{
- errno = 0;
- endptr = NULL;
- value = strtoull (fields[i], &endptr, 10);
+ /* Per-CPU value */
+ value_t v;
+ int status;
- /* Ignore all fields following a non-numeric field. */
- if ((errno != 0) || (endptr == NULL) || (*endptr != 0))
+ status = parse_value (fields[i], &v, DS_TYPE_DERIVE);
+ if (status != 0)
break;
- irq_value += value;
+ irq_value += v.derive;
} /* for (i) */
- if (i < fields_num)
+ /* No valid fields -> do not submit anything. */
+ if (i <= 1)
continue;
- irq_submit (irq, irq_value);
- /* Force 32bit wrap-around */
- irq_submit (irq_name, irq_value % 4294967296ULL);
++ irq_submit (irq_name, irq_value);
}
fclose (fh);