summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2022-04-25 16:36:58 +0300
committerGitHub <noreply@github.com>2022-04-25 16:36:58 +0300
commit5e8b714acc6a385013c7ddda596f335b298284b6 (patch)
tree71a1780a6f3d39cbdbc89ec57f5643cea6dd4f93 /collectors
parent79cf06f6a016edf44dbb084f83208e00c183589e (diff)
fix(cgroups.plugin): remove "search for cgroups under PATH" conf option to fix memory leak (#12752)
Diffstat (limited to 'collectors')
-rw-r--r--collectors/cgroups.plugin/README.md7
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.c10
2 files changed, 1 insertions, 16 deletions
diff --git a/collectors/cgroups.plugin/README.md b/collectors/cgroups.plugin/README.md
index d74ef000e9..45f965eaff 100644
--- a/collectors/cgroups.plugin/README.md
+++ b/collectors/cgroups.plugin/README.md
@@ -45,13 +45,6 @@ Netdata rescans these directories for added or removed cgroups every `check for
Since cgroups are hierarchical, for each of the directories shown above, Netdata walks through the subdirectories recursively searching for cgroups (each subdirectory is another cgroup).
-For each of the directories found, Netdata provides a configuration variable:
-
-```
-[plugin:cgroups]
- search for cgroups under PATH = yes | no
-```
-
To provide a sane default for this setting, Netdata uses the following pattern list (patterns starting with `!` give a negative match and their order is important: the first matching a path will be used):
```
diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.c b/collectors/cgroups.plugin/sys_fs_cgroup.c
index 6cb2e048e6..3e0154dadc 100644
--- a/collectors/cgroups.plugin/sys_fs_cgroup.c
+++ b/collectors/cgroups.plugin/sys_fs_cgroup.c
@@ -1964,15 +1964,7 @@ static inline int find_dir_in_subdirs(const char *base, const char *this, void (
if(*r == '\0') r = "/";
// do not decent in directories we are not interested
- int def = simple_pattern_matches(enabled_cgroup_paths, r);
-
- // we check for this option here
- // so that the config will not have settings
- // for leaf directories
- char option[FILENAME_MAX + 1];
- snprintfz(option, FILENAME_MAX, "search for cgroups under %s", r);
- option[FILENAME_MAX] = '\0';
- enabled = config_get_boolean("plugin:cgroups", option, def);
+ enabled = simple_pattern_matches(enabled_cgroup_paths, r);
}
if(enabled) {