@cryptotaxi247 / netdata-1 / commits / d0e1172e0

Disable cpuidle module if schedstat file is missing (#5059)

Vladimir Kobal committed Dec 28, 2018 at 15:02 UTC d0e1172e0e1e5882fe30ef16d565a2f112f2c351
1 file changed +7
collectors/proc.plugin/proc_stat.c
+7
@@ -536,6 +536,13 @@ int do_proc_stat(int update_every, usec_t dt) {
536 snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/schedstat");
537 schedstat_filename = config_get("plugin:proc:/proc/stat", "schedstat filename to monitor", filename);
538
539 + if(do_cpuidle != CONFIG_BOOLEAN_NO) {
540 + struct stat stbuf;
541 +
542 + if (stat(schedstat_filename, &stbuf))
543 + do_cpuidle = CONFIG_BOOLEAN_NO;
544 + }
545 +
546 snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/sys/devices/system/cpu/cpu%zu/cpuidle/state%zu/name");
547 cpuidle_name_filename = config_get("plugin:proc:/proc/stat", "cpuidle name filename to monitor", filename);
548