fix(cgroups.plugin): remove "search for cgroups under PATH" conf option to fix memory leak (#12752)
Ilya Mashchenko committed
Apr 25, 2022 at 16:36 UTC
5e8b714acc6a385013c7ddda596f335b298284b6
2 files changed
+1
-16
collectors/cgroups.plugin/README.md
-7
@@ -45,13 +45,6 @@ Netdata rescans these directories for added or removed cgroups every `check for
45
46
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).
47
48
-For each of the directories found, Netdata provides a configuration variable:
49
-
50
-```
51
-[plugin:cgroups]
52
- search for cgroups under PATH = yes | no
53
-```
54
-
48
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):
49
50
```
collectors/cgroups.plugin/sys_fs_cgroup.c
+1
-9
@@ -1964,15 +1964,7 @@ static inline int find_dir_in_subdirs(const char *base, const char *this, void (
1964
if(*r == '\0') r = "/";
1965
1966
// do not decent in directories we are not interested
1967
- int def = simple_pattern_matches(enabled_cgroup_paths, r);
1968
-
1969
- // we check for this option here
1970
- // so that the config will not have settings
1971
- // for leaf directories
1972
- char option[FILENAME_MAX + 1];
1973
- snprintfz(option, FILENAME_MAX, "search for cgroups under %s", r);
1974
- option[FILENAME_MAX] = '\0';
1975
- enabled = config_get_boolean("plugin:cgroups", option, def);
1967
+ enabled = simple_pattern_matches(enabled_cgroup_paths, r);
1968
}
1969
1970
if(enabled) {