summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/proc_interrupts.c
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/proc.plugin/proc_interrupts.c')
-rw-r--r--collectors/proc.plugin/proc_interrupts.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/collectors/proc.plugin/proc_interrupts.c b/collectors/proc.plugin/proc_interrupts.c
index 46290554b..f87684758 100644
--- a/collectors/proc.plugin/proc_interrupts.c
+++ b/collectors/proc.plugin/proc_interrupts.c
@@ -146,8 +146,6 @@ int do_proc_interrupts(int update_every, usec_t dt) {
irr->used = 1;
}
- // --------------------------------------------------------------------
-
static RRDSET *st_system_interrupts = NULL;
if(unlikely(!st_system_interrupts))
st_system_interrupts = rrdset_create_localhost(
@@ -164,8 +162,6 @@ int do_proc_interrupts(int update_every, usec_t dt) {
, update_every
, RRDSET_TYPE_STACKED
);
- else
- rrdset_next(st_system_interrupts);
for(l = 0; l < lines ;l++) {
struct interrupt *irr = irrindex(irrs, l, cpus);
@@ -173,9 +169,9 @@ int do_proc_interrupts(int update_every, usec_t dt) {
// some interrupt may have changed without changing the total number of lines
// if the same number of interrupts have been added and removed between two
// calls of this function.
- if(unlikely(!irr->rd || strncmp(irr->rd->name, irr->name, MAX_INTERRUPT_NAME) != 0)) {
+ if(unlikely(!irr->rd || strncmp(rrddim_name(irr->rd), irr->name, MAX_INTERRUPT_NAME) != 0)) {
irr->rd = rrddim_add(st_system_interrupts, irr->id, irr->name, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rrddim_set_name(st_system_interrupts, irr->rd, irr->name);
+ rrddim_reset_name(st_system_interrupts, irr->rd, irr->name);
// also reset per cpu RRDDIMs to avoid repeating strncmp() in the per core loop
if(likely(do_per_core != CONFIG_BOOLEAN_NO)) {
@@ -190,8 +186,6 @@ int do_proc_interrupts(int update_every, usec_t dt) {
rrdset_done(st_system_interrupts);
- // --------------------------------------------------------------------
-
if(likely(do_per_core != CONFIG_BOOLEAN_NO)) {
static RRDSET **core_st = NULL;
static int old_cpus = 0;
@@ -228,16 +222,15 @@ int do_proc_interrupts(int update_every, usec_t dt) {
char core[50+1];
snprintfz(core, 50, "cpu%d", c);
- rrdlabels_add(core_st[c]->state->chart_labels, "cpu", core, RRDLABEL_SRC_AUTO);
+ rrdlabels_add(core_st[c]->rrdlabels, "cpu", core, RRDLABEL_SRC_AUTO);
}
- else rrdset_next(core_st[c]);
for(l = 0; l < lines ;l++) {
struct interrupt *irr = irrindex(irrs, l, cpus);
if(irr->used && (do_per_core == CONFIG_BOOLEAN_YES || irr->cpu[c].value)) {
if(unlikely(!irr->cpu[c].rd)) {
irr->cpu[c].rd = rrddim_add(core_st[c], irr->id, irr->name, 1, 1, RRD_ALGORITHM_INCREMENTAL);
- rrddim_set_name(core_st[c], irr->cpu[c].rd, irr->name);
+ rrddim_reset_name(core_st[c], irr->cpu[c].rd, irr->name);
}
rrddim_set_by_pointer(core_st[c], irr->cpu[c].rd, irr->cpu[c].value);