diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2023-08-03 21:15:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-03 21:15:36 +0300 |
commit | c3a40401c5c36437ca85ff3abc1f1b4bb430e3a7 (patch) | |
tree | 50bbb057d0d56f4c7a20424070f77c054c2a165f /collectors/proc.plugin | |
parent | 2033d03c2b8dd94a0f889630f72fb90fdbf99103 (diff) |
proc.plugin: dont log if pressure/irq does not exist (#15732)
Diffstat (limited to 'collectors/proc.plugin')
-rw-r--r-- | collectors/proc.plugin/proc_pressure.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/collectors/proc.plugin/proc_pressure.c b/collectors/proc.plugin/proc_pressure.c index e500bf7484..4037e60ace 100644 --- a/collectors/proc.plugin/proc_pressure.c +++ b/collectors/proc.plugin/proc_pressure.c @@ -178,6 +178,9 @@ int do_proc_pressure(int update_every, usec_t dt) { procfile *ff = resource_info[i].pf; int do_some = resources[i].some.enabled, do_full = resources[i].full.enabled; + if (!resources[i].some.available && !resources[i].full.available) + continue; + if (unlikely(!ff)) { char filename[FILENAME_MAX + 1]; char config_key[CONFIG_MAX_NAME + 1]; @@ -200,12 +203,19 @@ int do_proc_pressure(int update_every, usec_t dt) { do_full = config_get_boolean(CONFIG_SECTION_PLUGIN_PROC_PRESSURE, config_key, do_full); resources[i].full.enabled = do_full; - if(!do_full && !do_some) + if (!do_full && !do_some) { + resources[i].some.available = false; + resources[i].full.available = false; continue; + } - ff = procfile_open(filename, " =", PROCFILE_FLAG_DEFAULT); + ff = procfile_open(filename, " =", PROCFILE_FLAG_NO_ERROR_ON_FILE_IO); if (unlikely(!ff)) { - collector_error("Cannot read pressure information from %s.", filename); + // PSI IRQ was added recently (https://github.com/torvalds/linux/commit/52b1364ba0b105122d6de0e719b36db705011ac1) + if (strcmp(resource_info[i].name, "irq") != 0) + collector_error("Cannot read pressure information from %s.", filename); + resources[i].some.available = false; + resources[i].full.available = false; continue; } } |