Skip to content

macOS: support zeroconf pmlogconf configurations #2541

@tallpsmith

Description

@tallpsmith

Problem

The pcp-zeroconf package on Linux provides 18 extended pmlogger configurations for richer out-of-the-box metric recording — per-process stats, disk activity, filesystem metrics, etc. On macOS, this is explicitly gated out in src/pmlogconf/GNUmakefile:

ifeq "$(TARGET_OS)" "linux"
SUBDIRS += zeroconf
PMCHECK=zeroconf.pmcheck
else
PMCHECK=no.zeroconf.pmcheck
endif

The no.zeroconf.pmcheck simply reports "not currently available for Darwin."

Why there's no technical barrier

Investigation shows no technical reason for the Linux-only gate. The zeroconf pmlogconf configs use a probe mechanism that gracefully self-selects based on metric availability.

Configs that work on macOS (metrics exist in darwin/darwin_proc PMDAs)

Config Probe Status
atop-proc proc.psinfo.rss values Works (darwin_proc has this)
pidstat proc.psinfo.rss values Works (darwin_proc has this)
disk force include Works (darwin has disk.dev.*)
filesystem force include Works (darwin has filesys.*)
rpc force include Works (darwin has rpc.*)

Configs gracefully excluded on macOS (probe fails, no error)

Config Probe Why excluded
pidstat-summary kernel.uname.sysname ~ Linux Explicit Linux check
interrupts kernel.percpu.interrupts.LOC Linux-only metric
nfsclient nfsclient.pages.read Linux namespace
hugepages mem.hugepages.totalsize > 0 Linux memory feature
hv-balloon hyperv.balloon.state > 0 Hyper-V only
hv-balloon-summary hyperv.balloon.state > 0 Hyper-V only
tapestat tape.dev.in_flight Linux tape devices
xfs-perdev xfs.perdev.read Linux filesystem
vmmemctl mem.vmmemctl.target > 0 VMware balloon driver
numahugepages mem.numa.hugepages.totalsize > 0 Linux NUMA
numastat hinv.nnode > 1 macOS is single-node

Force-included but harmless (metrics absent, pmlogger handles gracefully)

Config Notes
numa NUMA metrics don't exist on macOS, no error
tty tty.serial.* doesn't exist on macOS, no error

Nothing breaks. The probe mechanism was designed for exactly this kind of cross-platform graceful degradation.

Proposed Solution

Extend the TARGET_OS gate to explicitly include darwin:

ifeq "$(TARGET_OS)" "linux"
SUBDIRS += zeroconf
PMCHECK=zeroconf.pmcheck
else ifeq "$(TARGET_OS)" "darwin"
SUBDIRS += zeroconf
PMCHECK=zeroconf.pmcheck
else
PMCHECK=no.zeroconf.pmcheck
endif

This is conservative — explicit opt-in for Darwin only, avoiding accidental enablement on untested platforms (AIX, FreeBSD).

CI verification

Add to both .github/workflows/macOS.yml and .cirrus.yml after installation:

test -d /var/lib/pcp/config/pmlogconf/zeroconf && echo "zeroconf configs installed" || echo "zeroconf NOT installed"

Additional considerations

  • The zeroconf.pmcheck script checks for $PCP_VAR_DIR/config/pmlogconf/zeroconf directory existence — works on macOS as-is.
  • On Linux, pcp-zeroconf also sets PMLOGGER_INTERVAL=10 (vs default 60s). Should the macOS PKG do the same?
  • The macOS postinstall doesn't currently start pmlogger or pmie via launchd. For zeroconf configs to have any effect, pmlogger needs to be running. This may need a parallel effort.

Metadata

Metadata

Assignees

Labels

macOSFor issues specific or related to macOS

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions