summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/sys_class_infiniband.c
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/proc.plugin/sys_class_infiniband.c')
-rw-r--r--collectors/proc.plugin/sys_class_infiniband.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/collectors/proc.plugin/sys_class_infiniband.c b/collectors/proc.plugin/sys_class_infiniband.c
index 7e63bcbb4..fca0cb8a2 100644
--- a/collectors/proc.plugin/sys_class_infiniband.c
+++ b/collectors/proc.plugin/sys_class_infiniband.c
@@ -184,7 +184,7 @@ static struct ibport {
RRDSET *st_hwpackets;
RRDSET *st_hwerrors;
- RRDSETVAR *stv_speed;
+ const RRDSETVAR_ACQUIRED *stv_speed;
usec_t speed_last_collected_usec;
@@ -543,15 +543,14 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
// x4 lanes multiplier as per Documentation/ABI/stable/sysfs-class-infiniband
FOREACH_COUNTER_BYTES(GEN_RRD_DIM_ADD_CUSTOM, port, 4 * 8 * port->width, 1024, RRD_ALGORITHM_INCREMENTAL)
- port->stv_speed = rrdsetvar_custom_chart_variable_create(port->st_bytes, "link_speed");
- } else
- rrdset_next(port->st_bytes);
+ port->stv_speed = rrdsetvar_custom_chart_variable_add_and_acquire(port->st_bytes, "link_speed");
+ }
// Link read values to dimensions
FOREACH_COUNTER_BYTES(GEN_RRD_DIM_SETP, port)
// For link speed set only variable
- rrdsetvar_custom_chart_variable_set(port->stv_speed, port->speed);
+ rrdsetvar_custom_chart_variable_set(port->st_bytes, port->stv_speed, port->speed);
rrdset_done(port->st_bytes);
}
@@ -578,8 +577,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
// Create Dimensions
rrdset_flag_set(port->st_packets, RRDSET_FLAG_DETAIL);
FOREACH_COUNTER_PACKETS(GEN_RRD_DIM_ADD, port)
- } else
- rrdset_next(port->st_packets);
+ }
// Link read values to dimensions
FOREACH_COUNTER_PACKETS(GEN_RRD_DIM_SETP, port)
@@ -608,8 +606,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
// Create Dimensions
rrdset_flag_set(port->st_errors, RRDSET_FLAG_DETAIL);
FOREACH_COUNTER_ERRORS(GEN_RRD_DIM_ADD, port)
- } else
- rrdset_next(port->st_errors);
+ }
// Link read values to dimensions
FOREACH_COUNTER_ERRORS(GEN_RRD_DIM_SETP, port)
@@ -658,8 +655,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
port->name);
port->do_hwerrors = CONFIG_BOOLEAN_NO;
}
- } else
- rrdset_next(port->st_hwerrors);
+ }
}
if (port->do_hwpackets != CONFIG_BOOLEAN_NO) {
@@ -695,8 +691,7 @@ int do_sys_class_infiniband(int update_every, usec_t dt)
port->name);
port->do_hwpackets = CONFIG_BOOLEAN_NO;
}
- } else
- rrdset_next(port->st_hwpackets);
+ }
}
// Update values to rrd (done by vendor-specific function)