diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-27 18:46:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-27 18:46:20 +0000 |
commit | c933bf105b0de89e3fd524517daf163a16dd0d44 (patch) | |
tree | 50cb525f946e4ac65a416178766e2e124167a40f /collectors/ebpf.plugin/ebpf_hardirq.c | |
parent | Releasing debian version 1.40.0-2. (diff) | |
download | netdata-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_hardirq.c')
-rw-r--r-- | collectors/ebpf.plugin/ebpf_hardirq.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/collectors/ebpf.plugin/ebpf_hardirq.c b/collectors/ebpf.plugin/ebpf_hardirq.c index 113648ec9..f714c261c 100644 --- a/collectors/ebpf.plugin/ebpf_hardirq.c +++ b/collectors/ebpf.plugin/ebpf_hardirq.c @@ -188,35 +188,28 @@ void ebpf_hardirq_release(hardirq_val_t *stat) *****************************************************************/ /** - * Hardirq Free + * Hardirq Exit * - * Cleanup variables after child threads to stop + * Cancel child and exit. * * @param ptr thread data. */ -static void ebpf_hardirq_free(ebpf_module_t *em) +static void hardirq_exit(void *ptr) { + ebpf_module_t *em = (ebpf_module_t *)ptr; + + if (em->objects) + ebpf_unload_legacy_code(em->objects, em->probe_links); + for (int i = 0; hardirq_tracepoints[i].class != NULL; i++) { ebpf_disable_tracepoint(&hardirq_tracepoints[i]); } + pthread_mutex_lock(&ebpf_exit_cleanup); em->enabled = NETDATA_THREAD_EBPF_STOPPED; pthread_mutex_unlock(&ebpf_exit_cleanup); } -/** - * Hardirq Exit - * - * Cancel child and exit. - * - * @param ptr thread data. - */ -static void hardirq_exit(void *ptr) -{ - ebpf_module_t *em = (ebpf_module_t *)ptr; - ebpf_hardirq_free(em); -} - /***************************************************************** * MAIN LOOP *****************************************************************/ |