Repository navigation
WIP: procps P2b — pgrep/pkill/top/vmstat/watch/namei/killall (Refs #1127, #1462) - #1477
Merged
Merged
Conversation
…killall surface Oracle-source-first pass over the procps family (contracts derived from procps-v4.0.4 pgrep.c/vmstat.c/watch.c/top.c, util-linux 2.39.3 namei.c, and the psmisc killall man page contract): - pgrep/pkill: full selector set (-u/-U/-G/-P/-s/-F/-L/-O/-A/-n/-o, -v and -w for pgrep, -e/-q for pkill, -SIGNAL spellings via a shared procps_select.h engine mirroring select_procs(); pidfile validation; upstream usage errors and exit codes (2), the >15-char pattern warning, pkill -c printing the matched count. - vmstat: rewritten to the vmstat.c report (headers, since-boot row, delay/count, -y), -s sum_format, -d/-D disk modes, -p partition, -m header, -S unit conversion, -t timestamps, -f handled during option processing. - watch: -c is --color (count moved to long-only --count), fractional -n with the 0.1s clamp and WATCH_INTERVAL, -e/-g/-q exit semantics, upstream exit codes (child status no longer propagated), -x exec mode, -d permanent highlighting, "Every %.1fs:" header. - namei: -m/-o/-v/-x/-n/-Z and -l layered on the pinned #1237 dialect; junctions report as mount points; a missing component exits 1. - killall: exact-name default kept, plus -i/-l/-r/-s/-u/-v/-w/-y/-o and -SIGNAL spellings; per-name "no process found" reporting. - top: fractional -d, procps -o field names with +/- direction, -O field list, -E/-e memory scales, -1 per-CPU lines, real paging file swap figures, -p clashes with -u/-U; legacy long spellings kept as invisible aliases. - utils: per-process account/group/session/creation-time/thread/image queries backing the selectors. - i18n: MANUAL_MESSAGES top custom_help synced with the new text. - tests: unit coverage for the new options in all seven applets; watch's pinned child-status expectation corrected to the upstream contract (status only propagates under -e). Refs #1127 Refs #1462
…1 per-CPU lines per_cpu_usages passed class 1 to NtQuerySystemInformation. Class 1 is SystemProcessorInformation -- a single small record -- so the returned byte count divided by sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) yielded zero processors, the per-CPU vector came back empty, and the header silently fell back to the aggregate %Cpu(s) line even with -1. Class 8 is SystemProcessorPerformanceInformation, the per-logical- processor array the function actually reads. GNU contract: procps top's do_cpus prints one line per processor when CPUs are not combined, labeled with the eachcpu format "%%Cp%c%-3d:" (src/top/top_nls.c:517; loop in src/top/top.c do_cpus) -- i.e. %Cpu0, %Cpu1, ... The unit pin top.top_single_cpu encodes exactly that and was the one red test in the x64 ctest run (3518/3519 passed). Refs #1127
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft PR for the P2b procps cluster (deliver-and-done; do not merge from this PR without collector review).
Implements the missing procps-family surface oracle-source-first, per the contracts in procps-v4.0.4 (pgrep.c, vmstat.c, watch.c, top/top.c), util-linux 2.39.3 (namei.c), and the psmisc killall(1) contract:
src/commands/procps_select.h) mirroringselect_procs()— selectors -u/-U/-G/-P/-s/-F/-L/-O/-A, -n/-o reductions with upstream tie rules, -v inversion, -w thread listing, pidfile validation, -SIGNAL spellings, upstream usage errors/exit codes, the >15-character pattern warning. One audit claim was falsified against the oracle testsuite (pgrep name matching is NOT anchored upstream; the existing unanchored search was already correct).Cannot be built locally (MSVC-only repo, Linux VM) — CI (x64+arm64 build + ctest + differential) is the first gate. Full per-applet detail, oracle citations, and every unverified/approximated mapping are in REPORT.md on this branch's workdir copy (delivered with the cluster report).
Refs #1127
Refs #1462