summaryrefslogtreecommitdiffstats
path: root/collectors/ebpf.plugin/ebpf_oomkill.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
commit89f3604407aff8f4cb2ed958252c61e23c767e24 (patch)
tree7fbf408102cab051557d38193524d8c6e991d070 /collectors/ebpf.plugin/ebpf_oomkill.c
parentAdding upstream version 1.34.1. (diff)
downloadnetdata-89f3604407aff8f4cb2ed958252c61e23c767e24.tar.xz
netdata-89f3604407aff8f4cb2ed958252c61e23c767e24.zip
Adding upstream version 1.35.0.upstream/1.35.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/ebpf.plugin/ebpf_oomkill.c')
-rw-r--r--collectors/ebpf.plugin/ebpf_oomkill.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/collectors/ebpf.plugin/ebpf_oomkill.c b/collectors/ebpf.plugin/ebpf_oomkill.c
index f38801875..463a32904 100644
--- a/collectors/ebpf.plugin/ebpf_oomkill.c
+++ b/collectors/ebpf.plugin/ebpf_oomkill.c
@@ -377,6 +377,15 @@ void *ebpf_oomkill_thread(void *ptr)
ebpf_module_t *em = (ebpf_module_t *)ptr;
em->maps = oomkill_maps;
+ if (unlikely(!all_pids || !em->apps_charts)) {
+ // When we are not running integration with apps, we won't fill necessary variables for this thread to run, so
+ // we need to disable it.
+ if (em->enabled)
+ info("Disabling OOMKILL thread, because apps integration is completely disabled.");
+
+ em->enabled = 0;
+ }
+
if (!em->enabled) {
goto endoomkill;
}