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.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/collectors/ebpf.plugin/ebpf_mdflush.c b/collectors/ebpf.plugin/ebpf_mdflush.c
index 1a5a7731..fc794e5e 100644
--- a/collectors/ebpf.plugin/ebpf_mdflush.c
+++ b/collectors/ebpf.plugin/ebpf_mdflush.c
@@ -46,7 +46,7 @@ static void ebpf_mdflush_free(ebpf_module_t *em)
{
freez(mdflush_ebpf_vals);
pthread_mutex_lock(&ebpf_exit_cleanup);
- em->thread->enabled = NETDATA_THREAD_EBPF_STOPPED;
+ em->enabled = NETDATA_THREAD_EBPF_STOPPED;
pthread_mutex_unlock(&ebpf_exit_cleanup);
}
@@ -208,6 +208,7 @@ static void mdflush_collector(ebpf_module_t *em)
pthread_mutex_lock(&lock);
mdflush_create_charts(update_every);
ebpf_update_stats(&plugin_statistics, em);
+ ebpf_update_kernel_memory_with_vector(&plugin_statistics, em->maps);
pthread_mutex_unlock(&lock);
// loop and read from published data until ebpf plugin is closed.
@@ -246,24 +247,19 @@ void *ebpf_mdflush_thread(void *ptr)
char *md_flush_request = ebpf_find_symbol("md_flush_request");
if (!md_flush_request) {
- em->thread->enabled = NETDATA_THREAD_EBPF_STOPPED;
error("Cannot monitor MD devices, because md is not loaded.");
- }
- freez(md_flush_request);
-
- if (em->thread->enabled == NETDATA_THREAD_EBPF_STOPPED) {
goto endmdflush;
}
em->probe_links = ebpf_load_program(ebpf_plugin_dir, em, running_on_kernel, isrh, &em->objects);
if (!em->probe_links) {
- em->enabled = NETDATA_THREAD_EBPF_STOPPED;
goto endmdflush;
}
mdflush_collector(em);
endmdflush:
+ freez(md_flush_request);
ebpf_update_disabled_plugin_stats(em);
netdata_thread_cleanup_pop(1);