Skip to content

Commit

Permalink
fix(apps.plugin): fix debug msg spam on macOS/freeBSD (netdata#18743)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Oct 10, 2024
1 parent 402227a commit d05e989
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/collectors/apps.plugin/apps_os_freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ bool apps_os_read_pid_stat_freebsd(struct pid_stat *p, void *ptr) {
usec_t started_ut = timeval_usec(&proc_info->ki_start);
p->values[PDF_UPTIME] = (system_current_time_ut > started_ut) ? (system_current_time_ut - started_ut) / USEC_PER_SEC : 0;

if(unlikely(debug_enabled || p->target))
if(unlikely(debug_enabled))
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",
netdata_configured_host_prefix, p->pid, pid_stat_comm(p), (p->target)?string2str(p->target->name):"UNSET",
p->stat_collected_usec - p->last_stat_collected_usec,
Expand Down
2 changes: 1 addition & 1 deletion src/collectors/apps.plugin/apps_os_macos.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ bool apps_os_read_pid_stat_macos(struct pid_stat *p, void *ptr) {
// Note: Some values such as guest time, cutime, cstime, etc., are not directly available in MacOS.
// You might need to approximate or leave them unset depending on your needs.

if(unlikely(debug_enabled || p->target)) {
if(unlikely(debug_enabled)) {
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",
pid_stat_comm(p), (p->target) ? string2str(p->target->name) : "UNSET",
p->values[PDF_UTIME],
Expand Down

0 comments on commit d05e989

Please sign in to comment.