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;
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;
}
unsigned long i = procfile_linewords(ff, 0);
if(unlikely(i == 0)) {
- return;
ca->updated = 0;
+ return;
}
// we may have 1 more CPU reported
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;
}
);
for(i = 0; i < cg->cpuacct_usage.cpus; i++) {
- snprintfz(id, CHART_TITLE_MAX, "cpu%u", i);
+ snprintfz(id, RRD_ID_LENGTH_MAX, "cpu%u", i);
rrddim_add(cg->st_cpu_per_core, id, NULL, 100, 1000000000, RRD_ALGORITHM_INCREMENTAL);
}
}
rrdset_next(cg->st_cpu_per_core);
for(i = 0; i < cg->cpuacct_usage.cpus ;i++) {
- snprintfz(id, CHART_TITLE_MAX, "cpu%u", i);
+ snprintfz(id, RRD_ID_LENGTH_MAX, "cpu%u", i);
rrddim_set(cg->st_cpu_per_core, id, cg->cpuacct_usage.cpu_percpu[i]);
}
rrdset_done(cg->st_cpu_per_core);
// 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);