From c1dd27e335a07327c10f6605d4d59177f6b250cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Geyslan=20Greg=C3=B3rio?= Date: Sat, 18 Jan 2025 17:28:39 -0300 Subject: [PATCH] chore(cmd): add proctree disable-procfs --- .../docs/advanced/data-sources/builtin/process-tree.md | 3 ++- pkg/cmd/flags/proctree.go | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/docs/advanced/data-sources/builtin/process-tree.md b/docs/docs/advanced/data-sources/builtin/process-tree.md index 8d0eb400c55d..e94a2e25f87c 100644 --- a/docs/docs/advanced/data-sources/builtin/process-tree.md +++ b/docs/docs/advanced/data-sources/builtin/process-tree.md @@ -37,7 +37,8 @@ Example: --proctree thread-cache=16384 | will cache up to 16384 threads in the tree (LRU cache). --proctree process-cache-ttl=60 | will set the process cache element TTL to 60 seconds. --proctree thread-cache-ttl=60 | will set the thread cache element TTL to 60 seconds. - --proctree disable-procfs-query | Will disable procfs quering during runtime + --proctree disable-procfs | will disable procfs entirely. + --proctree disable-procfs-query | will disable procfs quering during runtime. Use comma OR use the flag multiple times to choose multiple options: --proctree source=A,process-cache=B,thread-cache=C diff --git a/pkg/cmd/flags/proctree.go b/pkg/cmd/flags/proctree.go index 020c86f369e6..30d8f10b7169 100644 --- a/pkg/cmd/flags/proctree.go +++ b/pkg/cmd/flags/proctree.go @@ -20,7 +20,8 @@ Example: both | process tree is built from both events and signals. --proctree process-cache=8192 | will cache up to 8192 processes in the tree (LRU cache). --proctree thread-cache=4096 | will cache up to 4096 threads in the tree (LRU cache). - --proctree disable-procfs-query | Will disable procfs queries during runtime + --proctree disable-procfs | will disable procfs entirely. + --proctree disable-procfs-query | will disable procfs quering during runtime. Use comma OR use the flag multiple times to choose multiple options: --proctree source=A,process-cache=B,thread-cache=C @@ -93,7 +94,12 @@ func PrepareProcTree(cacheSlice []string) (proctree.ProcTreeConfig, error) { cacheSet = true continue } - if strings.HasPrefix(value, "disable-procfs-query") { + if value == "disable-procfs" { + config.ProcfsInitialization = false + config.ProcfsQuerying = false + continue + } + if value == "disable-procfs-query" { config.ProcfsQuerying = false continue }