summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_softirq.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-27 18:46:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-06-27 18:46:20 +0000
commitc933bf105b0de89e3fd524517daf163a16dd0d44 (patch)
tree50cb525f946e4ac65a416178766e2e124167a40f /collectors/ebpf.plugin/ebpf_softirq.c
parentReleasing debian version 1.40.0-2. (diff)
downloadnetdata-c933bf105b0de89e3fd524517daf163a16dd0d44.tar.xz
netdata-c933bf105b0de89e3fd524517daf163a16dd0d44.zip
Merging upstream version 1.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_softirq.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_softirq.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/collectors/ebpf.plugin/ebpf_softirq.c b/collectors/ebpf.plugin/ebpf_softirq.c
index 01e2d0a52..b5c77bf06 100644
--- a/collectors/ebpf.plugin/ebpf_softirq.c
+++ b/collectors/ebpf.plugin/ebpf_softirq.c
@@ -61,17 +61,18 @@ static softirq_val_t softirq_vals[] = {
static softirq_ebpf_val_t *softirq_ebpf_vals = NULL;
/**
- * Cachestat Free
+ * Cleanup
*
- * Cleanup variables after child threads to stop
+ * Clean up allocated memory.
*
* @param ptr thread data.
*/
-static void ebpf_softirq_free(ebpf_module_t *em)
+static void softirq_cleanup(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);
for (int i = 0; softirq_tracepoints[i].class != NULL; i++) {
ebpf_disable_tracepoint(&softirq_tracepoints[i]);
@@ -83,19 +84,6 @@ static void ebpf_softirq_free(ebpf_module_t *em)
pthread_mutex_unlock(&ebpf_exit_cleanup);
}
-/**
- * Cleanup
- *
- * Clean up allocated memory.
- *
- * @param ptr thread data.
- */
-static void softirq_cleanup(void *ptr)
-{
- ebpf_module_t *em = (ebpf_module_t *)ptr;
- ebpf_softirq_free(em);
-}
-
/*****************************************************************
* MAIN LOOP
*****************************************************************/