summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_disk.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-27 18:46:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-27 18:46:10 +0000
commit9abec302a4736c965a34b930f4f5bf2b1494bf6e (patch)
treeaef24838cdda26750d86362b832263f4bcdf5a0e /collectors/ebpf.plugin/ebpf_disk.c
parentAdding upstream version 1.40.0. (diff)
downloadnetdata-9abec302a4736c965a34b930f4f5bf2b1494bf6e.tar.xz
netdata-9abec302a4736c965a34b930f4f5bf2b1494bf6e.zip
Adding upstream version 1.40.1.upstream/1.40.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_disk.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_disk.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/collectors/ebpf.plugin/ebpf_disk.c b/collectors/ebpf.plugin/ebpf_disk.c
index 71c972777..231186b84 100644
--- a/collectors/ebpf.plugin/ebpf_disk.c
+++ b/collectors/ebpf.plugin/ebpf_disk.c
@@ -435,17 +435,18 @@ static void ebpf_cleanup_disk_list()
}
/**
- * DISK Free
+ * Disk exit.
*
- * Cleanup variables after child threads to stop
+ * Cancel child and exit.
*
* @param ptr thread data.
*/
-static void ebpf_disk_free(ebpf_module_t *em)
+static void ebpf_disk_exit(void *ptr)
{
- pthread_mutex_lock(&ebpf_exit_cleanup);
- em->enabled = NETDATA_THREAD_EBPF_STOPPING;
- pthread_mutex_unlock(&ebpf_exit_cleanup);
+ ebpf_module_t *em = (ebpf_module_t *)ptr;
+
+ if (em->objects)
+ ebpf_unload_legacy_code(em->objects, em->probe_links);
ebpf_disk_disable_tracepoints();
@@ -463,19 +464,6 @@ static void ebpf_disk_free(ebpf_module_t *em)
pthread_mutex_unlock(&ebpf_exit_cleanup);
}
-/**
- * Disk exit.
- *
- * Cancel child and exit.
- *
- * @param ptr thread data.
- */
-static void ebpf_disk_exit(void *ptr)
-{
- ebpf_module_t *em = (ebpf_module_t *)ptr;
- ebpf_disk_free(em);
-}
-
/*****************************************************************
*
* MAIN LOOP