summaryrefslogtreecommitdiffstats
path: root/src/plugin_proc.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:10 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:10 +0000
commit87649cf32bd0e14d5a903fb85b01e9f41a253540 (patch)
treebbefda6dac074aeb87529592e8e5064f69cbe024 /src/plugin_proc.c
parentImported Upstream version 1.3.0+dfsg (diff)
downloadnetdata-87649cf32bd0e14d5a903fb85b01e9f41a253540.tar.xz
netdata-87649cf32bd0e14d5a903fb85b01e9f41a253540.zip
New upstream version 1.4.0+dfsgupstream/1.4.0+dfsg
Diffstat (limited to 'src/plugin_proc.c')
-rw-r--r--src/plugin_proc.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/plugin_proc.c b/src/plugin_proc.c
index a1bf314de..a50a22514 100644
--- a/src/plugin_proc.c
+++ b/src/plugin_proc.c
@@ -28,10 +28,12 @@ void *proc_main(void *ptr)
int vdo_proc_stat = !config_get_boolean("plugin:proc", "/proc/stat", 1);
int vdo_proc_meminfo = !config_get_boolean("plugin:proc", "/proc/meminfo", 1);
int vdo_proc_vmstat = !config_get_boolean("plugin:proc", "/proc/vmstat", 1);
+ int vdo_proc_net_rpc_nfs = !config_get_boolean("plugin:proc", "/proc/net/rpc/nfs", 1);
int vdo_proc_net_rpc_nfsd = !config_get_boolean("plugin:proc", "/proc/net/rpc/nfsd", 1);
int vdo_proc_sys_kernel_random_entropy_avail = !config_get_boolean("plugin:proc", "/proc/sys/kernel/random/entropy_avail", 1);
int vdo_proc_interrupts = !config_get_boolean("plugin:proc", "/proc/interrupts", 1);
int vdo_proc_softirqs = !config_get_boolean("plugin:proc", "/proc/softirqs", 1);
+ int vdo_proc_net_softnet_stat = !config_get_boolean("plugin:proc", "/proc/net/softnet_stat", 1);
int vdo_proc_loadavg = !config_get_boolean("plugin:proc", "/proc/loadavg", 1);
int vdo_sys_kernel_mm_ksm = !config_get_boolean("plugin:proc", "/sys/kernel/mm/ksm", 1);
int vdo_cpu_netdata = !config_get_boolean("plugin:proc", "netdata server resources", 1);
@@ -48,10 +50,12 @@ void *proc_main(void *ptr)
unsigned long long sutime_proc_stat = 0ULL;
unsigned long long sutime_proc_meminfo = 0ULL;
unsigned long long sutime_proc_vmstat = 0ULL;
+ unsigned long long sutime_proc_net_rpc_nfs = 0ULL;
unsigned long long sutime_proc_net_rpc_nfsd = 0ULL;
unsigned long long sutime_proc_sys_kernel_random_entropy_avail = 0ULL;
unsigned long long sutime_proc_interrupts = 0ULL;
unsigned long long sutime_proc_softirqs = 0ULL;
+ unsigned long long sutime_proc_net_softnet_stat = 0ULL;
unsigned long long sutime_proc_loadavg = 0ULL;
unsigned long long sutime_sys_kernel_mm_ksm = 0ULL;
@@ -59,7 +63,7 @@ void *proc_main(void *ptr)
unsigned long long sunext = (time(NULL) - (time(NULL) % rrd_update_every) + rrd_update_every) * 1000000ULL;
unsigned long long sunow;
- for(;1;) {
+ for(;;) {
if(unlikely(netdata_exit)) break;
// delay until it is our time to run
@@ -107,6 +111,14 @@ void *proc_main(void *ptr)
}
if(unlikely(netdata_exit)) break;
+ if(!vdo_proc_net_softnet_stat) {
+ debug(D_PROCNETDEV_LOOP, "PROCNETDEV: calling do_proc_net_softnet_stat().");
+ sunow = time_usec();
+ vdo_proc_net_softnet_stat = do_proc_net_softnet_stat(rrd_update_every, (sutime_proc_net_softnet_stat > 0)?sunow - sutime_proc_net_softnet_stat:0ULL);
+ sutime_proc_net_softnet_stat = sunow;
+ }
+ if(unlikely(netdata_exit)) break;
+
if(!vdo_proc_sys_kernel_random_entropy_avail) {
debug(D_PROCNETDEV_LOOP, "PROCNETDEV: calling do_proc_sys_kernel_random_entropy_avail().");
sunow = time_usec();
@@ -211,6 +223,14 @@ void *proc_main(void *ptr)
}
if(unlikely(netdata_exit)) break;
+ if(!vdo_proc_net_rpc_nfs) {
+ debug(D_PROCNETDEV_LOOP, "PROCNETDEV: calling do_proc_net_rpc_nfs().");
+ sunow = time_usec();
+ vdo_proc_net_rpc_nfs = do_proc_net_rpc_nfs(rrd_update_every, (sutime_proc_net_rpc_nfs > 0)?sunow - sutime_proc_net_rpc_nfs:0ULL);
+ sutime_proc_net_rpc_nfs = sunow;
+ }
+ if(unlikely(netdata_exit)) break;
+
// END -- the job is done
// --------------------------------------------------------------------
@@ -221,6 +241,8 @@ void *proc_main(void *ptr)
}
}
+ info("PROC thread exiting");
+
pthread_exit(NULL);
return NULL;
}