fix(apps.plugin): fix debug msg spam on macOS/freeBSD (#18743)
Ilya Mashchenko committed
Oct 10, 2024 at 12:36 UTC
d05e98941a4b38c26f46df692bf8257e22a5c6c5
2 files changed
+2
-2
src/collectors/apps.plugin/apps_os_freebsd.c
+1
-1
@@ -291,7 +291,7 @@ bool apps_os_read_pid_stat_freebsd(struct pid_stat *p, void *ptr) {
291
usec_t started_ut = timeval_usec(&proc_info->ki_start);
292
p->values[PDF_UPTIME] = (system_current_time_ut > started_ut) ? (system_current_time_ut - started_ut) / USEC_PER_SEC : 0;
293
294
- if(unlikely(debug_enabled || p->target))
294
+ if(unlikely(debug_enabled))
295
debug_log_int("READ PROC/PID/STAT: %s/proc/%d/stat, process: '%s' on target '%s' (dt=%llu) VALUES: utime=" KERNEL_UINT_FORMAT ", stime=" KERNEL_UINT_FORMAT ", cutime=" KERNEL_UINT_FORMAT ", cstime=" KERNEL_UINT_FORMAT ", minflt=" KERNEL_UINT_FORMAT ", majflt=" KERNEL_UINT_FORMAT ", cminflt=" KERNEL_UINT_FORMAT ", cmajflt=" KERNEL_UINT_FORMAT ", threads=%d",
296
netdata_configured_host_prefix, p->pid, pid_stat_comm(p), (p->target)?string2str(p->target->name):"UNSET",
297
p->stat_collected_usec - p->last_stat_collected_usec,
src/collectors/apps.plugin/apps_os_macos.c
+1
-1
@@ -242,7 +242,7 @@ bool apps_os_read_pid_stat_macos(struct pid_stat *p, void *ptr) {
242
// Note: Some values such as guest time, cutime, cstime, etc., are not directly available in MacOS.
243
// You might need to approximate or leave them unset depending on your needs.
244
245
- if(unlikely(debug_enabled || p->target)) {
245
+ if(unlikely(debug_enabled)) {
246
debug_log_int("READ PROC/PID/STAT for MacOS: process: '%s' on target '%s' VALUES: utime=" KERNEL_UINT_FORMAT ", stime=" KERNEL_UINT_FORMAT ", minflt=" KERNEL_UINT_FORMAT ", majflt=" KERNEL_UINT_FORMAT ", threads=%d",
247
pid_stat_comm(p), (p->target) ? string2str(p->target->name) : "UNSET",
248
p->values[PDF_UTIME],