summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/plugin_proc.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--collectors/proc.plugin/plugin_proc.c (renamed from src/plugin_proc.c)20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/plugin_proc.c b/collectors/proc.plugin/plugin_proc.c
index e0afb0d6d..0c3244d61 100644
--- a/src/plugin_proc.c
+++ b/collectors/proc.plugin/plugin_proc.c
@@ -1,4 +1,6 @@
-#include "common.h"
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "plugin_proc.h"
static struct proc_module {
const char *name;
@@ -37,6 +39,7 @@ static struct proc_module {
{ .name = "/proc/net/netstat", .dim = "netstat", .func = do_proc_net_netstat }, // this has to be before /proc/net/snmp, because there is a shared metric
{ .name = "/proc/net/snmp", .dim = "snmp", .func = do_proc_net_snmp },
{ .name = "/proc/net/snmp6", .dim = "snmp6", .func = do_proc_net_snmp6 },
+ { .name = "/proc/net/sctp/snmp", .dim = "sctp", .func = do_proc_net_sctp_snmp },
{ .name = "/proc/net/softnet_stat", .dim = "softnet", .func = do_proc_net_softnet_stat },
{ .name = "/proc/net/ip_vs/stats", .dim = "ipvs", .func = do_proc_net_ip_vs_stats },
@@ -91,8 +94,12 @@ void *proc_main(void *ptr) {
usec_t step = localhost->rrd_update_every * USEC_PER_SEC;
heartbeat_t hb;
heartbeat_init(&hb);
+ size_t iterations = 0;
while(!netdata_exit) {
+ iterations++;
+ (void)iterations;
+
usec_t hb_dt = heartbeat_next(&hb, step);
usec_t duration = 0ULL;
@@ -106,10 +113,19 @@ void *proc_main(void *ptr) {
debug(D_PROCNETDEV_LOOP, "PROC calling %s.", pm->name);
+//#ifdef NETDATA_LOG_ALLOCATIONS
+// if(pm->func == do_proc_interrupts)
+// log_thread_memory_allocations = iterations;
+//#endif
pm->enabled = !pm->func(localhost->rrd_update_every, hb_dt);
- pm->duration = heartbeat_dt_usec(&hb) - duration;
+ pm->duration = heartbeat_monotonic_dt_to_now_usec(&hb) - duration;
duration += pm->duration;
+//#ifdef NETDATA_LOG_ALLOCATIONS
+// if(pm->func == do_proc_interrupts)
+// log_thread_memory_allocations = 0;
+//#endif
+
if(unlikely(netdata_exit)) break;
}