static char *cgroups_rename_script = NULL;
+static int cgroups_check = 0;
+
static uint32_t Read_hash = 0;
static uint32_t Write_hash = 0;
static uint32_t user_hash = 0;
enabled_cgroup_patterns = simple_pattern_create(
config_get("plugin:cgroups", "enable by default cgroups matching",
" /system.slice/docker-*.scope "
+ " /qemu.slice/*.scope " // #1949
" !*.mount "
" !*.partition "
" !*.scope "
" !/docker "
" !/libvirt "
" !/lxc "
- " !/lxc/*/ns " // #1397
+ " !/lxc/*/ns " // #1397
" !/machine "
" !/qemu "
" !/system "
" !/systemd "
" !/user "
- " * " // enable anything else
+ " * " // enable anything else
), SIMPLE_PATTERN_EXACT);
enabled_cgroup_paths = simple_pattern_create(
config_get("plugin:cgroups", "search for cgroups in subpaths matching",
- " !*-qemu " // #345
+ " !*-qemu " // #345
" !/init.scope "
" !/system "
" !/systemd "
enabled_cgroup_renames = simple_pattern_create(
config_get("plugin:cgroups", "run script to rename cgroups matching",
+ " /qemu.slice/*.scope " // #1949
" *docker* "
" *lxc* "
" !/ "
ff = procfile_reopen(ff, cp->filename, NULL, PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
cp->updated = 0;
+ cgroups_check = 1;
return;
}
ff = procfile_readall(ff);
if(unlikely(!ff)) {
cp->updated = 0;
+ cgroups_check = 1;
return;
}
ff = procfile_reopen(ff, ca->filename, NULL, PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
ca->updated = 0;
+ cgroups_check = 1;
return;
}
ff = procfile_readall(ff);
if(unlikely(!ff)) {
ca->updated = 0;
+ cgroups_check = 1;
return;
}
ff = procfile_reopen(ff, io->filename, NULL, PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
io->updated = 0;
+ cgroups_check = 1;
return;
}
ff = procfile_readall(ff);
if(unlikely(!ff)) {
io->updated = 0;
+ cgroups_check = 1;
return;
}
ff = procfile_reopen(ff, mem->filename_detailed, NULL, PROCFILE_FLAG_DEFAULT);
if(unlikely(!ff)) {
mem->updated_detailed = 0;
+ cgroups_check = 1;
goto memory_next;
}
ff = procfile_readall(ff);
if(unlikely(!ff)) {
mem->updated_detailed = 0;
+ cgroups_check = 1;
goto memory_next;
}
// BEGIN -- the job to be done
find_dt += hb_dt;
- if(unlikely(find_dt >= find_every)) {
+ if(unlikely(find_dt >= find_every || cgroups_check)) {
find_all_cgroups();
find_dt = 0;
+ cgroups_check = 0;
}
read_all_cgroups(cgroup_root);