summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_mdflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_mdflush.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_mdflush.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/collectors/ebpf.plugin/ebpf_mdflush.c b/collectors/ebpf.plugin/ebpf_mdflush.c
index e2420ec8e..9f75543d7 100644
--- a/collectors/ebpf.plugin/ebpf_mdflush.c
+++ b/collectors/ebpf.plugin/ebpf_mdflush.c
@@ -256,6 +256,7 @@ static void mdflush_collector(ebpf_module_t *em)
// create chart and static dims.
pthread_mutex_lock(&lock);
mdflush_create_charts(em->update_every);
+ ebpf_update_stats(&plugin_statistics, em);
pthread_mutex_unlock(&lock);
// loop and read from published data until ebpf plugin is closed.
@@ -294,18 +295,29 @@ void *ebpf_mdflush_thread(void *ptr)
ebpf_module_t *em = (ebpf_module_t *)ptr;
em->maps = mdflush_maps;
+ char *md_flush_request = ebpf_find_symbol("md_flush_request");
+ if (!md_flush_request) {
+ em->enabled = CONFIG_BOOLEAN_NO;
+ error("Cannot monitor MD devices, because md is not loaded.");
+ }
+ freez(md_flush_request);
+
if (!em->enabled) {
goto endmdflush;
}
- probe_links = ebpf_load_program(ebpf_plugin_dir, em, kernel_string, &objects);
+ probe_links = ebpf_load_program(ebpf_plugin_dir, em, running_on_kernel, isrh, &objects);
if (!probe_links) {
+ em->enabled = CONFIG_BOOLEAN_NO;
goto endmdflush;
}
mdflush_collector(em);
endmdflush:
+ if (!em->enabled)
+ ebpf_update_disabled_plugin_stats(em);
+
netdata_thread_cleanup_pop(1);
return NULL;