commit 18003b6b235fa2e16ffa8a1002ae9e513d55affc
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 16:09:35 2026 +1000
pcp-atop: updates after covscan analysis
various.c val2memstr(): MAXEBYTE8 equals LLONG_MAX so the check
"verifyval <= MAXEBYTE8" was always true (Coverity CID 504429),
making the OVFORMAT branch dead code (CID 504430). Since count_t
is signed long long, anything past MAXPBYTE is unconditionally
EBFORMAT. Remove MAXEBYTE8, MAXEBYTE, OVFORMAT, EBFORMAT_INT
(all unused after this simplification).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit a57d5edb48274c38bcb2ccac101c0939cf74d1ce
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 12:58:33 2026 +1000
pcp-atop: updates after code review - all fairly minor cleanups
commit 82f8c271dbbf743564360a88704be4b921221784
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 12:53:14 2026 +1000
pcp-atop: fix MEM avail to use KiB directly, not pages round-trip
The original fix (8a2b618b) converted the KiB value from PCP's
mem.util.available to pages in photosyst.c (KiB * 1024 / pagesize),
then showsys.c multiplied by pagesize to get bytes — a pointless
round-trip that lost precision on non-4K page systems.
All other memory metrics in pcp-atop store PCP's KiB value directly
and multiply by 1024 in the display routines to get bytes. Fix
availablemem to follow the same pattern:
photosyst.c: store the KiB value as-is (remove * 1024 / pagesize)
showsys.c: change * pagesize to * 1024
Audit of all pagesize uses in showsys.c confirms the remaining five
are genuine page-count metrics (sockstat tcp/udp mem, cgroup physpages,
NFS pagesmread/pagesmwrite) where * pagesize is correct.
Closes #2631
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 4f5ef53ced6ff14b056d83eb18d75dde262a18eb
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 11:46:32 2026 +1000
pcp-atop: derive default label set from labeldef[] instead of hardcoding
The fallback when no -P labels are specified was a hardcoded string
"CPU,CPL,MEM,SWP,DSK,NET,PRG,PRC" that would become stale if labels
were added to or removed from the labeldef[] table. Build the default
set by iterating the full table instead.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 75cd16de5e2280ff8f5a2382e773003e81acd572
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 08:49:43 2026 +1000
pcp-atop: bidirectional BindsTo between service and timer
The timer now also binds to atop.service. If someone explicitly stops
atop, the timer stops too — no midnight restart of a deliberately
stopped service. Combined with the service's BindsTo on the timer,
they always start and stop as a pair.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 7d57ba49bedba2d17192c6bda27b9648fb636902
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 08:48:34 2026 +1000
pcp-atop: BindsTo atop-daily.timer so the timer always starts with the service
Without the daily timer, atop runs indefinitely without archive rotation
or compression — a broken state. BindsTo= ensures the timer starts
whenever atop.service starts (and stops the service if the timer dies),
so 'systemctl start atop.service' is all that's needed. The Also= in
[Install] handles enable/disable pairing.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit fe1c6cc9304c48a87d7638f22a9a34bfd88b53f9
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 20:46:45 2026 +1000
pcp-atop: cancel inherited interval timer in volume rotation child
The rawarchive_compress_volume() callback forks a child to compress
completed data volumes with zstd. The child inherits the parent's
active ITIMER_REAL timer used for periodic sampling; the resulting
SIGALRM kills zstd before it can write any data, leaving a zero-byte
compressed file.
Cancel the timer with alarm(0) before exec, matching the fix applied
to sysstat's sadc for the same issue.
Signed-off-by: Nathan Scott <nathans@redhat.com>
commit 561183e3097db9c9aa30426e598c1805f68833af
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 20:17:22 2026 +1000
pcp-atop, pcp-summary: fix pcp(1) display of atop recording status
pcp-summary.sh: merge sadc and generic pmimport display into one loop.
All tools use the same pattern (tool-specific label, comma→space via
tr, fmt wrapping); sadc's dedicated section is replaced by a case
statement: sadc→"activity"/sadc-archive, atop→"labels"/archive,
*→"modules"/archive. Harmless for space-separated tools like collectl
since tr ',' ' ' is a no-op.
various.c: use ATOP_VERSION ("2.12.1") in pmiSetImportProgram instead
of PCP_VERSION so pcp(1) reports the upstream atop version pcp-atop
is based on, not the PCP package version.
atop.h: define ATOP_VERSION "2.12.1" (upstream sync point v2.12.1).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 53147733de8a9c8b9dfd5c6f37998d96eb44437c
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 20:00:39 2026 +1000
pcp-atop: fix context deadlock and atop-daily exit code
various.c: remove pmiSetZoneinfo(NULL) from rawwrite_open — when called
before setup_globals the live PMAPI context does not yet exist, so
__pmZoneinfo() (called by pmiSetZoneinfo) attempts to acquire the
contexts_lock via PMAPI while rawwrite_open's pmiStart (PMI_APPEND)
already holds it, causing EDEADLK. pmiSetZoneinfo is already called
in rawwrite_init_sidecar() which runs after setup_globals.
atop-daily.sh: add exit 0 at the end — the new date-based culling loop
ends with [ day -lt cutdate ] returning 1 (false = nothing to cull),
which became the script's exit code, causing ExecStartPre to fail.
The original find-based culling always returned 0.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 99b42ac2759d4027deaff2ccc665cfba0a3d47da
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 18:04:28 2026 +1000
pcp-atop: tie atop-daily.timer to atop.service enablement via Also=
Add Also=atop-daily.timer to atop.service [Install] so that
systemctl enable atop.service also enables atop-daily.timer, and
systemctl disable atop.service also disables it.
Upstream atop handles this via RPM postinstall scriptlets; we use the
unit-file mechanism so it works correctly regardless of install method.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 11cc505eb755f22bd96d6dee4b4d08778fe8ebc6
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 17:50:51 2026 +1000
pcp-atop: fix compression and culling in atop-daily
Two correctness fixes in atop-daily.sh:
Compression: remove background '&' from xz/zstd calls. When atop-daily
is invoked from ExecStartPre= in atop.service, systemd kills any remaining
background children when ExecStartPre exits, before ExecStart begins.
This left .tmp files uncompressed. Removing '&' makes compression
synchronous; for daily archives (typically small) this is fast. When
called from rawwrite_open via atop-daily --compress-only (in pcp-atop's
own cgroup), the same code runs and is not subject to being killed.
Culling: replace find -mtime with date-based filename parsing. The
compressed output files (*.meta.xz, *.0.zst) carry the compression time
as their mtime, not the archive date, so find -mtime kept archives longer
than LOGGENERATIONS. Parse the YYYYMMDD stamp from the filename and
compare against a cutoff date computed with 'date -d'.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 132de81bc99b376ab9ecc091ee39edd7721701f8
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 17:44:21 2026 +1000
pcp-atop: fix service ExecStart, sidecar name, qa/2007 lifecycle test
atop.service.in: remove '-h local:' from ExecStart — the '-h' flag
conflicts with atop option parsing (InfiniBand in atopsar) and is
unnecessary: without it pcp-atop connects to local pmcd by default
and falls back to PM_CONTEXT_LOCAL automatically if pmcd is down.
various.c: register sidecar as "atop" (not "pcp-atop") so
pmiSetImportProgram writes $PCP_IMPORT_DIR/atop and pmdapmimport
serves the instance as "atop", matching the installed symlink name.
qa/2007: complete lifecycle test for the atop service:
- saves/restores pre-test service state so the test is idempotent
- polls for pmimport state transitions (avoids races on slow hosts)
- checks $PCP_IMPORT_DIR/atop sidecar (pid, archive, args fields)
- verifies sidecar is removed on clean service stop
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit d841ab68f7a9e1325b6e9eb920f97898a8da4892
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 16:48:33 2026 +1000
pcp-atop: address coderabbit review findings
parseable.c: guard zero-length buffer in parseable_labels(); compute
remaining capacity without unsigned underflow by tracking used bytes
explicitly before each strncat call.
atop-daily.sh: fix LOGGENERATIONS off-by-one — find -mtime +N keeps
N+1 daily archives; use $((LOGGENERATIONS - 1)) to retain exactly N.
Guard LOGGENERATIONS=0 (keep forever) to avoid -mtime +-1 which is
invalid. Document 0 = keep forever in atop.conf.
Findings assessed as already correct or not applicable:
- atom.cp free: both rawwrite_put paths already call free(atom.cp)
- local fallback: already calls pmGetContextOptions/setup_origin
- hostname truncation: force-null-terminates at line 1782 already
- atop.h pmapi.h: already included at line 25
- atop-daily double-execution: not a double-execution; atop-daily
runs once via ExecStartPre when systemctl restart fires
- probe numval>0: "available" (not "active with traffic") is correct
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 165d40542fa6c8c761efa0584fac94da68a63632
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 15:58:58 2026 +1000
pcp-atop: clean atop transition — service renames, config path, daily script
Service files renamed for clean atop drop-in replacement:
pcp-atop.service.in -> atop.service.in
pcp-atop-daily.service.in -> atop-daily.service.in
pcp-atop-daily.timer.in -> atop-daily.timer.in
pcp-atop-daily.sh -> atop-daily.sh
installed binary: pcp-atop-daily -> atop-daily
Config file:
atop.conf.in replaced by plain atop.conf (no substitutions needed);
installs to PCP_SYSCONFIG_DIR/atop (/etc/sysconfig/atop) matching
upstream atop's config format and location exactly.
Archive path:
Default LOGPATH=/var/log/atop in atop.service and atop.conf matches
upstream atop convention. atop-daily.sh fallback updated from
PCP_LOG_DIR/atop to /var/log/atop.
atop-daily.service now restarts atop.service (not pcp-atop.service).
various.c: fork of atop-daily (was pcp-atop-daily) at startup updated.
pcp-summary.sh: use "labels" for pcp-atop args field (vs "modules" for
other tools, "activity" for sadc) matching pcp-atop -P label vocabulary.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 82ea7204665b74296fadf5a01bb3031e7920d474
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 15:11:38 2026 +1000
qa: add pcp-atop recording and pmimport lifecycle tests
2006: record 3 samples with pcp-atop -w, verify archive contains
hinv, kernel, and proc metrics; replay with -r.
2007: start pcp-atop.service, verify pmimport.* metrics appear while
running (pid, archive, args fields in sidecar), stop service, verify
metrics disappear and sidecar is removed on clean exit.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 29b5781afa2f062420f15182be1d76ec79cd795c
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 15:10:19 2026 +1000
pcp-atop: pmimport.args with full subsystem labels; probe optional PMDAs
Replace the ad-hoc "kernel,proc,nvidia,netatop" args categories in the
pmimport sidecar with real pcp-atop -P label vocabulary, giving sysadmins
a meaningful view of what a running pcp-atop recording service is capturing.
New probe infrastructure (probe_optional_metrics in photosyst.c):
After setup_photosyst() populates the systmetrics pmid array, do a
lightweight pmFetch of one representative metric per optional subsystem.
Any metric that resolves and returns numval > 0 sets the matching bit:
IBSTAT - infiniband PMDA: IB ports present
IPCSTAT - perfevent PMDA: IPC/cycle hardware counters
LLCSTAT - resctrl PMDA: LLC occupancy
NFSSTAT - NFS client mounts active
PSISTAT - kernel PSI pressure (kernel >= 4.20 + CONFIG_PSI)
LVMSTAT - LVM/device-mapper devices present
MDDSTAT - MD software-RAID devices present
New sidecar init (rawwrite_init_sidecar in various.c):
Called from atop.c after setup_globals() so all supportflags are known.
Builds args= from the -P label set (explicit if -P was given, otherwise
the default recording set CPU,CPL,MEM,SWP,PAG,DSK,NET,PRG,PRC), then
appends conditional labels: PSI, LVM, MDD, NFC+NFM, GPU, IFB, LLC, PRN.
parseable_labels() (parseable.c): new helper that returns the active -P
label list, or the default recording set when no -P flag was given.
Rename NETATOPBPF -> NETBPF throughout: pcp-atop only supports per-process
network stats via pmdabpf; the NETATOP and NETATOPD flags (upstream atop
kernel-module and daemon variants) are never set in pcp-atop.
GNUmakefile: gate build on TARGET_OS+HAVE_NCURSESW so pcp-atop is not
built on non-Linux platforms.
pcp-atop.1: add pmdaresctrl, pmdaperfevent, pmdapmimport to the optional
PMDA list and SEE ALSO; document pmimport registration in recording mode.
qa/1978.out: regenerate after CPUSCALE "-" display fix (scaling field now
shows "-" when archive lacks scaling metrics, was previously suppressed).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 44b8b4c543948726546477a8e8ccddc711699313
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 12:17:33 2026 +1000
pcp-atop: fix rawwrite_register ordering and CPUSCALE display
Two bugs:
rawwrite_register (called from setup_metrics inside setup_globals) returned
early because pmi_ctx was still -1 when rawwrite_open had not yet been
called. All metric groups were therefore unregistered, so rawwrite_put
staged nothing and every pmiWrite returned PMI_ERR_NODATA. Fix by calling
rawwrite_open before setup_globals so the PMI context is valid when each
metric group's setup_metrics triggers rawwrite_register. Fixes qa/1079,
qa/1089, and qa/1266.
sysprt_CPUSCALE and sysprt_CPUISCALE ignored the return value of
dofmt_cpuscale. After the backport changed the "nothing known" case from
returning NULL to returning " -", sysval_CPUSCALE started always
returning 1 (field always shown) instead of 0 (suppress). The static
"scaling ?" buffer was then shown instead of the intended "-". Fix by
using the return value from dofmt_cpuscale directly. The qa/1978 expected
output needs ./remake 1978 since the CPU scaling field now correctly shows
"-" instead of being suppressed for archives without scaling metrics.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 452a66c717365da42949781fd4b5abd5e4ee9b32
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 11:41:25 2026 +1000
pcp-atop: fix double-run of pcp-atop-daily in timer service
The daily service was running pcp-atop-daily explicitly then starting
pcp-atop.service whose ExecStartPre also runs pcp-atop-daily. The
second pass found leftover .tmp files from the first and launched
duplicate compressors against the same archive outputs.
Fix: the daily service simply restarts pcp-atop.service. The restart
seals yesterday's archive (pmiEnd on stop), then ExecStartPre runs
pcp-atop-daily exactly once: atomically renames prior-day files, forks
background compression, culls old archives, and exits. Recording
resumes on the new date-stamped archive while compression runs in
parallel.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit d1e9b50344f6b6ce66892f94d5ff3ede141cfc76
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 11:04:27 2026 +1000
pcp-atop: code build cleanups and comment fixes
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 01bbc1db1519b5de50375a36fc0963d31204aa8e
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:22:29 2026 +1000
pcp-atop: pcp-atop-daily.sh - no template, source pcp.env at runtime
Shell scripts in PCP source pcp.env to get PCP_LOG_DIR and other
path variables at runtime; no .in template substitution needed.
Rename pcp-atop-daily.in -> pcp-atop-daily.sh, source pcp.env,
use $PCP_LOG_DIR directly. GNUmakefile installs it as pcp-atop-daily
via $(INSTALL) without a generation step. Remove the script from
LDIRT since it is not a generated file.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit a5640737ba8e05b6a3a35760b4342e57c77507dd
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:13:01 2026 +1000
pcp-atop: update .gitignore for daily service files
commit 84676b2c1ef19691b7b098ee5f81fc24eee76d0f
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 09:54:55 2026 +1000
pcp-atop: address coderabbit review findings
atop.h: include <pcp/pmapi.h> directly so rawwrite_register/put
prototypes for pmID/pmDesc/pmResult are self-contained.
various.c:
- rawwrite_open: build pmiSetImportProgram module list from runtime
state (kernel always; proc/hotproc; nvidia/netatop if active).
Reuse host[] for modules after hostname is consumed into archpath.
Fork pcp-atop-daily --compress-only in background before opening
new archive: prior-day archives are compressed without blocking
recording; children persist in pcp-atop.service cgroup.
Add LOGVOLSIZE env var (k/m/g suffix) for mid-session volume
rotation with zstd callback; default 100m.
- rawwrite_register: store metric name in rawmetric_t so pmiGetHandle
uses the registered name, not pmIDStr() which returns numeric IDs.
- rawwrite_put: use ph->name for pmiGetHandle; free atom.cp after
pmiPutAtomValueHandle for PM_TYPE_STRING metrics.
- local fallback: run pmGetContextOptions/setup_origin after successful
PM_CONTEXT_LOCAL fallback, matching normal context init path.
- gethostname: force NUL termination in case of truncation.
- compress_volume_zstd: use execl() with absolute /usr/bin/zstd path
to avoid PATH hijacking; remove compress_archive/compress_file_async
(replaced by pcp-atop-daily script).
- LOGVOLSIZE env var: k/m/g suffix parser; default 100m fallback.
Rename pcp-atop-rotate.* to pcp-atop-daily.*:
pcp-atop-daily script: compress prior-day archives (atomic rename to
.tmp, background xz/.zst), cull old archives; --compress-only flag
skips culling for use from pcp-atop itself.
pcp-atop-daily.service: stop atop, run daily script, start atop.
pcp-atop-daily.timer: daily trigger.
LOGVOLSIZE=100m added to atop.conf.in and service Environment=.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 7bf35b26dd5018db213abbffacd4b1128d2fa554
Author: Nathan Scott <nathans@redhat.com>
Date: Sun Jun 28 13:35:30 2026 +1000
pcp-atop: update .gitignore for service files; drop legacy pmatop entry
commit 89c2638ad7b8c358f50898820c76b4609647dc63
Author: Nathan Scott <nathans@redhat.com>
Date: Sun Jun 28 13:33:22 2026 +1000
pcp-atop: add safe_strcpy compat macro; convert all pmstrncpy callsites
Upstream atop uses safe_strcpy(dst, src, n) while PCP provides
pmstrncpy(dst, n, src) with swapped argument order. Add a bridge macro
to atop.h so pcp-atop uses the same function name as upstream, making
future syncs easier:
#define safe_strcpy(dst, src, n) pmstrncpy((dst), (n), (src))
Convert all 16 pmstrncpy callsites in atop.c files to safe_strcpy with
the upstream argument order (dst, src, n).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 4e27737aeb27c075ca539ecf2691198ebd796554
Author: Nathan Scott <nathans@redhat.com>
Date: Sun Jun 28 13:29:54 2026 +1000
pcp-atop: backport additional upstream atop v2.10.0->v2.12.0 fixes
parseable.c (58c65a9): use %lld and cast to (long long) for time_t in
the parseable header snprintf, avoiding truncation on 64-bit systems
where time_t is 64-bit but %ld would be 32-bit on some platforms.
atop.h, various.c (17fa005): extend val2memstr() to support exabyte-
scale memory values (up to ~8 EB, the signed 64-bit limit) and rename
OVFORMAT from "!TILT!" to "OVFLOW" for clarity. Adds ONEEBYTE,
MAXEBYTE/MAXEBYTE8, EBFORMAT/EBFORMAT_INT macros and the corresponding
switch case. Also parenthesises the MAXKBYTE/MBYTE/GBYTE/TBYTE/PBYTE
macro expansions to prevent operator-precedence surprises.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 178e5a01b317777e3fed02bc2a4872236ef84968
Author: Nathan Scott <nathans@redhat.com>
Date: Sun Jun 28 13:18:26 2026 +1000
pcp-atop: backport upstream atop v2.10.0->v2.12.0 fixes
Backport portable fixes from upstream atop v2.10.0..v2.12.0 that apply
to the PCP fork. Changes that read /proc directly (CPU frequency path,
cgroups, raw log format) are omitted as pcp-atop uses pmFetch instead.
showsys.c (19e7bbe): guard InfiniBand busy% calculation against divide-
by-zero when the IB port rate is reported as zero.
showsys.c (8790b67): display '-' instead of '?' when CPU frequency
scaling information is unavailable, for consistency with other N/A fields.
showgeneric.c (97cbcbf): apply process state filters to threads as well.
When the user selects state 'R', also show processes whose main thread
is 'S' but have a running sub-thread. Match PID selection on tgid so
all threads of a process are shown, not just the main thread.
parseable.c (037a6d3): add network interface error/drop/fifo/compress/
carrier counters to -PNET parseable output, matching upstream.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 69370a33a03732ee9258c17040b4753ec6fb5b0a
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 15:59:31 2026 +1000
pcp-atop: use $(PCP_IMPORTLIB) macro in GNUmakefile
Replace the explicit -lpcp_import -lpcp_archive pair with the new
PCP_IMPORTLIB macro from builddefs.in.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit ba22f7166a2f88d9de544cf762684cb3f4d56438
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 15:49:30 2026 +1000
pcp-atop: systemd integration, local-context fallback, archive compression
Systemd service files (pcp-atop.service.in, pcp-atop-rotate.service.in,
pcp-atop-rotate.timer.in):
- pcp-atop.service runs pcp-atop with -h local: -w to write PCP archives
under PCP_LOG_DIR/atop at the configured interval. No dependency on
pmcd or the full pcp package -- uses only pcp-libs DSO PMDAs.
- pcp-atop-rotate.service/timer restart the service daily at midnight
to rotate to a fresh date-stamped archive.
- atop.conf.in: EnvironmentFile with LOGOPTS/LOGINTERVAL/LOGGENERATIONS/
LOGPATH overrides, installed to PCP_SYSCONF_DIR/atop/atop.conf.
various.c -- local context fallback:
When pmNewContext(PM_CONTEXT_HOST, "local:") fails (pmcd not running),
fall back to PM_CONTEXT_LOCAL after setting PCP_PMCDCONF_FILE and
PMNS_DEFAULT to point at local.conf and local.root (sysstat pattern).
This lets pcp-atop collect metrics from DSO PMDAs without pmcd.
various.c -- post-close archive compression:
compress_archive() runs after pmiEnd() in rawwrite_close(): xz for the
.meta file (high ratio, read once at open), zstd for each data volume
(fast decompression for pmval replay). Each compressor runs in a forked
child (compress_file_async) so rawwrite_close() returns immediately.
Same strategy as pcp-collectl.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 7c305e9cd070dbb69edfe72b4e6ebf5b51bdca0c
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 15:26:45 2026 +1000
pcp-atop: replace libpcp_gui archive recording with libpcp_import
The -w (write) recording mode previously launched an external pmlogger
process via libpcp_gui (pmRecordSetup/AddHost/Control). This required
libpcp_gui and pmlogger to be installed, preventing pcp-atop from living
in a pcp-libs-only subpackage.
Replace with a direct libpcp_import write path:
rawwrite_open() opens a pmiStart(PMI_APPEND) context before the
main collection loop, registers with pmdapmimport
via pmiSetImportProgram.
rawwrite_register() called from setup_metrics() for each metric group;
calls pmiAddMetric() for each metric, pre-allocates
a pmiGetHandle for aggregate (indom=PM_INDOM_NULL)
metrics, stores the full pmDesc in a rawmetric_t
keyed by pmid in a __pmHashCtl for O(1) lookup.
rawwrite_put() called from fetch_metrics() after every pmFetch;
uses pre-allocated handles + pmAtomValue (via
pmExtractValue with the real PM_TYPE_* from pmDesc)
for aggregate metrics; for instanced metrics it
acquires handles per-instance via pmiGetHandle
(internally cached by pmi).
rawwrite_flush() called once per interval from atop.c main loop;
commits staged values with pmiWrite().
rawwrite_close() called from cleanstop(); walks the hash to free
rawmetric_t records, then pmiEnd().
The main loop in atop.c now suppresses interactive display when
rawwriteflag is set, making -w mode a silent headless recorder.
GNUmakefile: drop libpcp_gui/LLDFLAGS, add -lpcp_import -lpcp_archive.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit ac79c4a87fac548ea01d8ef4ec8abfdf154df057
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 14:24:22 2026 +1000
pcp-atop: fix MEM avail field wrong by pagesize/1024 factor
mem.util.available is expressed in KiB, but sysprt_MEMAVAIL() in
showsys.c multiplies by pagesize treating the value as a page count,
yielding a result that is pagesize/1024 times too large (4x on 4 KiB
systems, 64x on 64 KiB systems).
All other mem.* fields are stored as page counts. Convert at populate
time to be consistent: multiply by 1024 to get bytes, divide by pagesize
to get pages.
Closes #2631
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 82b1f2d4cae796e061239031c15bfc01dac6f781
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 11:32:02 2026 +1000
pcp-summary: use local PMNS root and dso config in fallback to local-context
commit 21dae128aa83fbb9ef67fc281217895cb38586a2
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jul 1 11:30:23 2026 +1000
docs: fix typo in pmdaredis script re db_name
commit bda9a9b585d6f613e763f6e036d364da3e7eaad1
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 20:41:38 2026 +1000
libpcp: set PM_CTXFLAG_LAST_VOLUME before label check in __pmLogOpenAppend
After pmiSetVolumeSize() triggers a volume rotation, the new data
volume contains only the log label. On the next PMI_APPEND open,
__pmLogChkLabel() returns PM_ERR_NODATA for volumes whose size
equals the label size — but only when PM_CTXFLAG_LAST_VOLUME is
not set. The flag was being set after __pmLogChkLabel(), so a
label-only last volume was incorrectly rejected as empty, causing
all subsequent append-mode import tool invocations to fail.
Move ac_curvol and PM_CTXFLAG_LAST_VOLUME assignment before the
__pmLogChkLabel() call, matching the __pmLogOpen() read-path
convention.
Signed-off-by: Nathan Scott <nathans@redhat.com>
commit c496ff97c9a23abd80943c70b673ad16aa568ddf
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 16:51:33 2026 +1000
qa: fix pmimport filtering in test 024, thanks Ken
commit 0ac25d53dfacb31f6b5190cd3f5ccd9a45211b2d
Merge: b5035608 cf982e09
Author: Ken McDonell <kenj@kenj.id.au>
Date: Mon Jun 29 11:24:17 2026 +1000
Merge branch 'main' of ../pcp
commit b50356087d8e441b020d7bd970069c3562614b85
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:40:49 2026 +1000
build: update debian changelog to really close #1133063
commit 948d38f3870d563735e5b8b5515ac7c41c6a8aff
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:38:27 2026 +1000
man: remove internal tzname(3) reference from pmiSetZoneinfo description
commit fbac7f71b877518471b4b8baf2908427d5d6bb3d
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:37:45 2026 +1000
man, debian: add pmiSetZoneinfo to pmiSetTimezone(3); update packaging
pmiSetZoneinfo() had no man page. Extend pmisettimezone.3 to cover
both functions: pmiSetTimezone (POSIX tz string) and pmiSetZoneinfo
(Olson/tzdata name, NULL for auto-detect from local timezone).
Add pmiSetZoneinfo.3.gz to debian/libpcp4-dev.install so the symlink
created by the build system is packaged.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit f51db27e215b1ac1f058a0b976736eb8b708dbf2
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:33:59 2026 +1000
man, debian: add pmiSetImportProgram(3) man page
Documents pmiSetImportProgram(), including the sidecar file format,
the PMI_PROCESS flag interaction, the /run/pmimport default location,
and when to call it relative to pmiStart/pmiWrite/pmiEnd.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 1d142c683181670f173c45e917bb88a6d3b36d87
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:29:09 2026 +1000
qa: update expected output for test 1946, out-of-sync
commit ffc20447f35e0db5dfeaf7083a421193075cbcbf
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 29 10:25:52 2026 +1000
build: add libpcp_import into the libraries -L list
commit cf982e097e0584234d126633c371fb5bc7fb2ae9
Author: Ken McDonell <kenj@kenj.id.au>
Date: Mon Jun 29 08:16:10 2026 +1000
debian packaging: moving DSO PMDAs from pcp to libpcp4 broke the package upgrade path
Need Breaks: and Replaces: for libpcp4
commit cce1569eddd874f6b74c524baa56f6da8fde6bb4
Merge: bdd869f7 a0fce703
Author: Nathan Scott <nathans@redhat.com>
Date: Sun Jun 28 16:38:59 2026 +1000
Merge branch 'main' of github.com:performancecopilot/pcp
commit bdd869f7a9d9443f7c686186b6929b2347b9cfc0
Author: Nathan Scott <nathans@redhat.com>
Date: Sun Jun 28 13:08:19 2026 +1000
linux_proc: sanitise proc.psinfo.psargs in one pass (ANSI + control chars)
Replace the existing backward NUL-byte replacement loop in
refresh_proc_pidlist with a single forward-pass sanitise_cmdline()
function that handles all cases together:
- Trims trailing NUL bytes (inter-arg separators) without turning
them into trailing spaces.
- Replaces interior NUL bytes, CR, LF, TAB and all other C0 control
characters and DEL with space, matching upstream atop commit 298f8fb
(carriage return fix) and generalising to the full control-char set.
- Strips ANSI/VT100 escape sequences (CSI ESC[, OSC ESC], and plain
2-char ESC sequences) to prevent terminal injection attacks via
crafted argv[0] values. Protects every PCP consumer of
proc.psinfo.psargs, not just pcp-atop.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit a0fce7039b9e9510e35241573331c71798ff3d8b
Merge: a0f134c8 cf6c12e6
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 17:37:33 2026 +1000
Merge pull request #2638 from kmcdonell/wip
QA: small fixups and nvidia PMDA QA improvements
commit cf6c12e6e0ffddfd112c294807f7ae07927d5402
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 16:57:08 2026 +1000
1946: better trap handling
Thanks @coderabbitai.
commit 0c1489fd2cb3499baddfc40b6e3ec3ef8b33797d
Merge: dc12f46f 51a2e92c
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 16:39:27 2026 +1000
Merge branch 'main' into wip
commit 51a2e92c9c51992337934eb62745544cc51307a6
Merge: 980f461f a0f134c8
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 16:39:07 2026 +1000
Merge branch 'main' of https://github.com/performancecopilot/pcp
commit dc12f46fc5b1d82b5ff2d22d8b71afbba84d3fb6
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 16:34:49 2026 +1000
nvidia PMDA: mostly QA
- split qa/744 and qa/745 into multiple tests to provide
increased coverage, especially when a system-installed
libnvidia-ml.so is present ... adds qa/1944, qa/1945 and
qa/1946
- some additonal -Dappl1 diagnostics in the PMDA to cover
libnvidia-ml initialization debugging
commit 0ad888438832c2804f754a8affbaec7632fe3c62
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 15:58:50 2026 +1000
builddefs, import.h: add PCP_IMPORTLIB macro and PMI_VERSION defines
builddefs.in: add PCP_IMPORTLIB = -lpcp_import $(PCP_ARCHIVELIB) so
Makefiles that write PCP archives via libpcp_import can use a single
macro instead of spelling out both libraries.
import.h: add PMI_VERSION_2 and PMI_VERSION so callers can test the
ABI version at compile time, parallel to PMAPI_VERSION in pmapi.h.
PMI_VERSION_2 is the current ABI (nanosecond timestamps, pmiWriteNow,
pmiSetImportProgram).
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit a0f134c8d0794b0a32293fbf8eac341916051edf
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 11:37:52 2026 +1000
docs: update the readme and install docs to refer to ghcr.io now
commit 3d89eeeb1ec4379cbf54244969c3634b1403a880
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 11:34:35 2026 +1000
qa: add notrun guard to 518 in case pmimporters present
commit 016db86b274f9ab04de4d7ee974ff04aefd50098
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 11:29:58 2026 +1000
pcp-summary: fix inst() value extraction and remote-host fallback
Two bugs introduced by the pmimport metrics addition:
value=substr($0, index($0, $6)) is wrong when $6 (e.g. "0" or "8")
appears inside the instance ID token (e.g. inst [2824710 or "2824710"]).
index() finds the digit inside the ID rather than after the "value"
keyword, corrupting the value and all downstream join fields. Anchor
on the " value " separator instead: always unique in pminfo output.
Fixes qa/507 (pmie: 0: or) and qa/518 (garbled eval stats).
The local-context fallback (-Lf retry when pmcd is unreachable) must
not fire when a specific host was requested via -h / PCP_HOST; it
should only apply when the default local pmcd is down. Add the
[ -z "$PCP_HOST" ] guard. Fixes qa/830 showing local data for an
unreachable remote host.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 5c42113661f0b7a2becf5cbad3911400f3e87d4c
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 11:13:42 2026 +1000
qa: add to _filter_optional_pmda_instances
commit 17542eb79d1653022dc68290336074468f16856e
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 27 11:09:03 2026 +1000
qa: remake test 1693 output to match v2 libpcp_import ABI
commit 82f21f872ffb6e94c0a6943b1a3e5f62b2dcbc1a
Merge: 774bf103 980f461f
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 06:55:04 2026 +1000
Merge branch 'main' into wip
commit 980f461fa4c7146323cd7d0fcd8ba228475028dc
Merge: c5783ecc 2e42fbb7
Author: Ken McDonell <kenj@kenj.id.au>
Date: Sat Jun 27 06:54:49 2026 +1000
Merge branch 'main' of https://github.com/performancecopilot/pcp
commit 2e42fbb7da11140a38a48dc0633740eaf1ad79c4
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 20:36:59 2026 +1000
qa: update 369.out for pmiWriteNow perl binding
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit b94e18afe61761be1c96215b22ca799f84101c89
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 18:32:05 2026 +1000
qa: update 1418.out for pmiWriteNow perl binding
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit f2905b5a8bbddb5a51e7e583cab912a22078e785
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 18:01:35 2026 +1000
perl api: add pmiWriteNow() binding to LogImport.xs
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 4454ba5d15b52ee09be79a7fc8abb11e4fc1e93c
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 17:28:06 2026 +1000
libpcp_import, python api, pmrep: add pmiWriteNow(); fix epoch timestamp writes
pmiWrite(sec=0) was repurposed as a "use current time" sentinel, but this
breaks any archive with Unix epoch timestamps (e.g. QA synthetic archives
starting at 00:00:00 1970). Separate the two concerns cleanly:
- pmiWrite() now always uses the supplied sec/nsec timestamp verbatim;
sec=0 writes a record at Unix epoch, not wall-clock time.
- pmiWriteNow() is a new function that writes a record timestamped with
the current wall-clock time.
Update all callers:
- Python pmiWrite(0) (integer zero, no nsec) now calls pmiWriteNow()
so existing "use current time" idiom still works from Python.
- pmrep: pass microsecond*1000 as nsec (was usec) and sec=0 now
correctly writes the archive sample at epoch instead of current time.
- qa/src/check_import.c, check_import.perl: pmiWrite(0,0) -> pmiWriteNow()
- Perl LogImport: export pmiWriteNow in @EXPORT list.
- pylint: replace manual if/clamp with max() builtin.
Also update qa/1623.out_v{2,3}: collectl2pcp now writes more metrics per
record (from earlier subsystem handler additions), changing archive sizes.
man/man3/pmiwrite.3, debian/libpcp4-dev.install: document pmiWriteNow.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 6cbca29aaa90abffa2651397d07e5af519f4db3c
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 15:56:18 2026 +1000
collectl2pcp, qa: fix pmiWrite() callers for nsec API and sec=0 semantics
pmiWrite() changed its second parameter from microseconds (internally
multiplied by 1000) to nanoseconds (used directly), and the sentinel for
"use current time" changed from sec<0 to sec==0. Update all affected
callers:
collectl2pcp/timestamp.c: mseconds*1000 -> mseconds*1000000 (usec->nsec)
qa/src/batch_import.perl: pmiBatchWrite(0,...) -> pmiBatchWrite(1,...)
to avoid sec=0 triggering wall-clock time instead of epoch
qa/src/test_pmi.python: pmiWrite(0) -> pmiWrite(1) for same reason;
pmiWrite(sec, usec=123456) -> pmiWrite(sec, nsec=123456000)
qa/src/check_import.python: useconds (1e6 scale) -> nseconds (1e9 scale)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 774bf10388c74dc5b525f288fe954abfd17c4244
Author: Ken McDonell <kenj@kenj.id.au>
Date: Fri Jun 26 15:57:28 2026 +1000
qa: remakes for changes in nvidia PMDA metadata and pmlogrewrite rules
commit 66d397bfda5c0f6541dd94c1182a54a6c496f590
Author: Ken McDonell <kenj@kenj.id.au>
Date: Fri Jun 26 15:46:26 2026 +1000
qa/archives/GNUmakefile: mk.common should not be installed executable
Found by lintian.
commit 2a6e248b9b2fc71b545a721c5c78cc670c0251a2
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 15:46:06 2026 +1000
python api: update pmi.py for pmiWrite nanosecond API
Rename usec -> nsec parameter in pmiWrite() and switch from pmiWrite2()
to pmiWrite() with nanosecond precision, matching the current
libpcp_import API. Also clamp nsec to zero after all conversion paths
to guard against a negative fractional part from modf() on pre-epoch
timestamps.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 500405300bd5fd5458fcc66d2cad45d0392aaa63
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 15:05:35 2026 +1000
pmdapmimport: fix PMIMPORT_MAX accounting and atol() pid parsing
Stale sidecar files left by crashed daemons were consuming slots in the
PMIMPORT_MAX tool limit before the pid liveness check could filter them
out, silently dropping live tools when many stale files accumulated.
Move the limit guard to after both paths (mtime-unchanged recheck and
fresh parse) have determined whether the tool is active.
Also replace atol() with strtol() for pid= parsing: atol() returns 0
silently on malformed input, which would bypass the __pmProcessExists
liveness check for any corrupted sidecar file.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 5a723d954112886317900c337cbcb8556d4c1b76
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 20 17:42:03 2026 +1000
pmdapmimport, pcp-summary: add pmimport.* metrics for import tools
Introduce a generic pmimport.{archive,version,args} metric set with an
instance domain with each instance an active import tool identified by
name.
pmdapmimport scans PCP_IMPORT_DIR on each fetch; each file is a status
file written by an import tool containing key=value lines:
pid= process ID (long-running daemons only, via PMI_PROCESS flag)
version= tool version string
args= tool-specific arguments
archive= current archive base path
Mapping to:
pmimport.archive current archive base path
pmimport.version tool version string
pmimport.args tool-specific argument string
Add PMI_PROCESS flag (0x4) to pmiStart(): long-running import daemons
pass this flag to write their pid= to the status file and have it
removed on clean exit via pmiEnd(). One-shot tools (e.g. sadc invoked
by sa1) omit the flag so the status file persists between invocations.
pmdapmimport reads pid= and uses __pmProcessExists() to skip stale
status files left by daemons that exited uncleanly.
pmi_context gains a flags:16 bitfield (alongside the existing state:16)
to carry PMI_PROCESS across the lifetime of a context.
pcp-summary(1) displays sysstat/sadc with custom formatting; any other
active import tool is shown generically with aligned tool/modules/archive
lines, so new importers appear automatically without script changes.
The PMDA is included in local.conf so it is available in both live pmcd
mode and local context mode (pminfo -L), enabling pcp-summary and other
tools to report import tool status without requiring pmcd.
Signed-off-by: Nathan Scott <nathans@redhat.com>
commit da0aa47c34ca2c2052295050d6123bd3f5ef8102
Author: Nathan Scott <nathans@redhat.com>
Date: Sat Jun 20 17:45:11 2026 +1000
linux, collectl2pcp: add missing subsystem handlers and cpu frequency metric
linux PMDA: add hinv.cpu.frequency_scaling.current (item 10 in
CLUSTER_SYSFS_DEVICES) reading /sys/devices/system/cpu/*/cpufreq/
scaling_cur_freq per CPU. The existing freq.scale field already holds
this value from refresh_sysfs_frequency_scaling_cur_freq(); we simply
expose it as a new instant metric alongside the existing .min/.max.
collectl2pcp: add handlers for subsystems that had no coverage:
sock - network.sockstat.* from /proc/net/sockstat
fs-ds - vfs.dentry.count from /proc/sys/fs/dentry-state
fs-is - vfs.inodes.count from /proc/sys/fs/inode-nr
fs-fnr - vfs.files.count from /proc/sys/fs/file-nr
buddy - mem.buddyinfo.total from /proc/buddyinfo (per zone)
nfsc- - nfs.client.calls from /proc/net/rpc/nfs
nfss- - nfs.server.calls from /proc/net/rpc/nfsd
numai - mem.numa.util.* from /sys/devices/system/node/nodeN/meminfo
Test data: qa/collectl/subsys_test.raw.gz (1.9KB, 3 samples) collected
using collectl -s sibm to exercise all new handlers.
Signed-off-by: Nathan Scott <nathans@redhat.com>
commit 5fecb9b40984ad4ea54dd622c437a7145b179d1c
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 13:43:21 2026 +1000
build: resolve macos issue relating to unwanted systemd files
commit 1b213c50444c0f25b57ff9cb813892241180d204
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 13:18:38 2026 +1000
libpcp: fix __pmLogFreeLabel double-free and leak in __pmLogOpenAppend
After assigning the meta label to lcp->label via struct copy, label's
hostname/timezone/zoneinfo pointer fields alias lcp->label's. A
subsequent __pmLogChkLabel call that returns before __pmLogLoadLabel
overwrites those fields (e.g. on a short read) would leave label still
holding the aliased pointers; the __pmLogFreeLabel on the error path
would then free the strings that lcp->label still references, causing a
double-free when logFreeMeta() runs. Zero label immediately after the
assignment so lcp->label exclusively owns the strings.
Also add the missing __pmLogFreeLabel for the data-volume label on the
success path; the hostname/timezone/zoneinfo allocated by the final
__pmLogChkLabel call were leaked on every successful open-for-append.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit ab69c21c9e08002e0e7fc86088ad8b7809d1ad0e
Author: Nathan Scott <nathans@redhat.com>
Date: Fri Jun 26 10:03:51 2026 +1000
python api: update overlooked python PMI interface
Make use of the clean v2 ABI interfaces now instead of the
old and moldy v1 patchwork quilt.
commit 3d1a65db69e686ce0687f299ef18ef520f665309
Merge: 705b3bcd 93efeeea
Author: Nathan Scott <nathans@redhat.com>
Date: Thu Jun 25 15:26:26 2026 +1000
Merge branch 'main' of github.com:performancecopilot/pcp
commit 705b3bcd2dd64e577a0dcb9b93753a31db71c367
Merge: 32564943 bcc22027
Author: Nathan Scott <nathans@redhat.com>
Date: Thu Jun 25 15:26:03 2026 +1000
Merge branch 'dso-pmdas-help'
commit 32564943d06fb61fe3eb0a594fa58266c8942c2b
Merge: c2e523f2 4496d69a
Author: Nathan Scott <nathans@redhat.com>
Date: Thu Jun 25 15:24:54 2026 +1000
Merge branch 'preserve-import1-abi'
commit c2e523f272738b21092b0d7646ab13da00675096
Author: Nathan Scott <nathans@redhat.com>
Date: Thu Jun 25 15:21:26 2026 +1000
docs: refine "labels" reference in log-append header comment
commit bcc22027dd74849f3996d1f403e808fbd84f6136
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 20:39:02 2026 +1000
pcp-libs: include DSO PMDA .so and help files for local context
Clients using PM_CONTEXT_LOCAL need both the PMDA shared libraries and
their compiled help files (.dir, .pag) to work standalone without the
main pcp package.
For RPM: derive the DSO PMDA directory list from local.conf (same source
used for the .so files) and extend basic_manifest to also pull the
compiled help files into pcp-libs-files.
For Debian: add glob patterns to libpcp4.install to capture all PMDA
.so and compiled help files under usr/lib/pcp/pmdas/.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 4496d69af8e88f376860e9f06c8772e5b6b9e04f
Author: Nathan Scott <nathans@redhat.com>
Date: Thu Jun 25 12:01:15 2026 +1000
libpcp_import: introduce ABI v2 while continuing to ship ABI v1
Following up on Ken's feedback on recent changes, we're going to
handle libpcp_import the same way we did the libpcp.so.4 switch.
This allows us to completely retire the non-Y2038 safe interface
and also means we don't need to reintroduce the HighRes pmResult
interface.
All of the new import interfaces in this release are now forming
the v2 ABI while a snapshot of the last releases interfaces will
remain in the libpcp_import1 shared library.
commit c5783ecc9742def3053bc241534c51921144ee24
Author: Ken McDonell <kenj@kenj.id.au>
Date: Thu Jun 25 08:15:10 2026 +1000
common.filter: add amdgpu to optional pmdas to cull for qa/031 & qa/257
commit 93efeeea356ec684165774bf8b908023bb630393
Merge: ab250a7b bcd79e94
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 21:14:40 2026 +1000
Merge pull request #2634 from kmcdonell/wip
QA fixups and convert Nvidia PMDA to extraunits
commit bcd79e9451c2187d32639655c4936f85083bf5ea
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 17:57:32 2026 +1000
src/pmdas/nvidia/rewrite.conf: fix power units
Thanks @coderabbitai.
commit ab250a7b62651a389b6da087582fbd49d4475316
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 17:54:38 2026 +1000
pcp-summary: fix pmie primary instance detection
The awk code used BEGIN { primary=0 } which left primary as a numeric
zero when no id=0 ("primary") pmie instance existed. Any pmie instance
whose third join field happened to be the string "0" (e.g. from an archive
where the irix namespace maps pmie metrics to zero-valued PMIDs) would
falsely match $3 == primary, producing incorrect "primary engine: 0" output
or hiding non-primary instances.
Fix by initialising primary to "" and guarding both $3 == primary
comparisons with primary != "" so they only fire when an id=0 instance
has actually been seen. Update qa/507.out to reflect the corrected
output for the pcpcmd archive.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit fbf39978f3ea34aced3d1a4f3f8866ad19b9a882
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 17:53:21 2026 +1000
qa/group: add local (group) for test 1675
commit 97ee94370a723087c49af3a5a3448f32692fd051
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 17:52:11 2026 +1000
qa/1675: rework archive iterartion
commit ad58a579f90f81f6332a9f87a98b92388243de98
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 17:38:25 2026 +1000
qa/1559 and qa/1670: rework archive iteration
commit aabd29c3eec108fbd6097abc87d913c0ac1c3148
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 16:16:28 2026 +1000
libpcp_import: prevent use-after-free on an error path (covscan)
commit 47d1b9b16c0ab8cfd60f07dc06fd39796de3ad09
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 15:16:56 2026 +1000
pmdards, qa: rds modules use psutil module which is not always available
commit 1edbb6f655240f6da4264bbe6f84a7950874e58f
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 15:16:26 2026 +1000
build: add top-level gitignore for git worktrees
commit c90d32654e1e3b05792a0dd4b5d31b4944d214f6
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 11:43:42 2026 +1000
libpcp_import: fix two segfaults in pmiStart and check_indom
pmiStart: realloc() does not zero the new slot, so fields added to
pmi_context by recent commits (max_volume_bytes, on_volume_rotate,
tool_name) were uninitialised. A non-zero garbage max_volume_bytes
caused _pmi_put_result() to call on_volume_rotate through a garbage
function pointer, segfaulting callers such as collectl2pcp (qa/536).
check_indom: addindom() stores direct pointers from the pmi_context
indom name array into the hash. A subsequent pmiAddInstance() realloc()
can move that array, leaving dangling pointers in the hash. On the next
write, __pmLogGetInDom() returns these stale namelist pointers, and the
strcmp() in pmaDeltaInDom() crashes. Fix by passing __pmDupLogInDom()
copies (with PMLID_INSTLIST|PMLID_NAMELIST|PMLID_NAMES) to the hash so
it owns stable independent copies of the name strings.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 79dfe4be7ef2f4057dbb27050902c28239c547e0
Author: Nathan Scott <nathans@redhat.com>
Date: Wed Jun 24 11:25:34 2026 +1000
pmdadb2: address coderabbit review of Db2 v12 fixes
Rename db2.instance.platform to db2.instance.build_level to match what
is actually reported: BLD_LEVEL from SYSIBMADM.ENV_INST_INFO is a build
identifier that encodes architecture, not a platform descriptor. Update
pmlogconf.summary to reference the new metric name.
Replace 'SELECT COUNT(*) ... FETCH FIRST 1 ROW ONLY' with
'SELECT 1 ... FETCH FIRST 1 ROW ONLY WITH UR' in db2_register_user_tables.
COUNT(*) processes all matching rows before returning even with FETCH FIRST,
inflating ROWS_READ and TABLE_SCANS counters on the tables the PMDA is
trying to report. SELECT 1 WITH UR accesses a single row with uncommitted
read, stops immediately, and avoids lock contention.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
commit 951ebc2bf43ba1577333d9d3c0413d65454fbd1b
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 07:20:13 2026 +1000
assorted: pander to (different!) awk on macOS
Throughout the known (GNU) awk universe, this works:
awk 'END { f = "/foo"; print >"/tmp" f }' </dev/null
but on macOS this produces a "awk: syntax error"
However, this works for all versions of awk:
awk 'END { f = "/foo"; print >("/tmp" f) }' </dev/null
modified: qa/1633
modified: qa/1674
modified: qa/671
modified: qa/681
modified: qa/new
modified: qa/new-dup
modified: qa/new-grind
modified: qa/src/mv-me
modified: src/ctl-tools/ctl-tools.sh
commit f99906afd739f5d3677e7d4033cfc3145d19d6be
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 07:00:56 2026 +1000
src/pmdas/nvidia/rewrite.conf: (new) add, missed in previous commit
commit 2b5c9d14c019807d04ebad169183fdd6288ff093
Author: Ken McDonell <kenj@kenj.id.au>
Date: Wed Jun 24 06:50:16 2026 +1000
nvidia PMDA: metadata changes to use extra units
For power and temperature.
+ pmlogrewrite rules and qa for this
+ updated recipe for recreating qa/archives/nvidiagpu archive
commit d4941899e872b71c4ba4f1f3ea4e0aa814ef073a
Author: Jan Kurik <jkurik@redhat.com>
Date: Tue Jun 23 21:59:14 2026 +0200
Fix db2.table metrics by registering tables on the PMDA connection
MON_GET_TABLE only lists tables after the monitoring connection has
accessed them, so db2.table.* was always empty despite application
activity. Probe user tables from SYSCAT on connect, reconnect, and
before table refreshes so per-table counters are populated. Also remove
the stub db2.table.deadlocks metric, which is not available in
MON_GET_TABLE and was misleading when hardcoded to zero.
commit a0e1e35ab40c5458a9e70b007f15ac19816f0282
Author: Jan Kurik <jkurik@redhat.com>
Date: Tue Jun 16 21:03:11 2026 +0200
Reworked number of passed parameters
To make pylint happy, the number of parameters passed to
db2_refresh_instanced() has been reworked.
commit f8f891404aae8343ec6b6e36bfa5fe2c25857d86
Author: Jan Kurik <jkurik@redhat.com>
Date: Tue Jun 16 17:18:10 2026 +0200
pmdadb2: fix Db2 v12 MON_* column and view compatibility
Update SQL for Db2 12 (TBSP_NAME, ACT_COMPLETED_TOTAL,
SYSIBMADM.ENV_INST_INFO, transaction log byte fields), report zero for
unavailable per-table deadlocks, and only drop connections on
communication failures.
commit 1c256b85970681fc1df422035aabe0a2e8da7d3f
Merge: 451e5366 9bceddfb
Author: Nathan Scott <nathans@redhat.com>
Date: Tue Jun 23 14:48:59 2026 +1000
Merge branch 'main' into pmi-append-mode
commit 451e5366e4f57c373da73e08d9ab0776f7967a39
Author: Nathan Scott <nathans@redhat.com>
Date: Tue Jun 23 08:52:30 2026 +1000
libpcp_import: build, docs, qa and comments updates on code review
commit 9bceddfbadff601341cbb74995542feead19366b
Merge: e9bbdb8b 1ac9652b
Author: Ken McDonell <kenj@kenj.id.au>
Date: Tue Jun 23 10:57:37 2026 +1000
Merge pull request #2629 from kmcdonell/wip
QA updates, retire some PMDAs, small extra units related changes
commit a6c5e2ef897d4be5c0dc2a86996602790cd717e7
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 22 11:58:49 2026 +1000
pcp.pmi, LogImport: add wrappers for pmiSetZoneinfo and pmiSetImportProgram
Add Python ctypes declarations and method implementations for the two
new single-context pmiSet* APIs added on this branch:
pmiSetZoneinfo(zoneinfo) - set Olson timezone from zoneinfo string
pmiSetImportProgram(tool, ...) - register import program with pmdapmimport
Add Perl XS declarations for the same two functions. pmiSetVolumeSize
is omitted from Perl as its callback argument has no natural XS mapping.
Signed-off-by: Nathan Scott <nathans@redhat.com>
commit e379b2ec1ff17127e7ad212aad08960e6d40038e
Author: Nathan Scott <nathans@redhat.com>
Date: Mon Jun 22 10:57:36 2026 +1000
libpcp_import: add pmiSetImportProgram() for import tool registration
pmiSetImportProgram(tool, version, args, archive) writes tool identity
to PCP_IMPORT_DIR/{tool} so pmdapmimport can serve pmimport.* metrics.
PCP_IMPORT_DIR is a new pcp.conf variable (configure --with-importdir,
default /run/pmimport) that is created root:root 0755 by packaging.
The file is opened with O_NOFOLLOW|O_CLOEXEC to prevent symlink
substitution and fd leakage; O_TRUNC handles restart after unclean exit.
pmiEnd() removes the file on clean archive close so pmimport.* metrics
accurately reflect which tools are currently recording.
Signed-off-by: Nathan Scott <nathans@redhat.com>
There are 4 open security issues in bookworm.
You can find information about how to handle these issues in the security team's documentation.