Repository navigation
feat(linux): tasksmack-helper reads other users' FD counts and I/O bytes for the Processes table (#2728) - #2938
Merged
Merged
Conversation
…tes for the Processes table (#2728) Protocol v4 adds a batched ReadProcessCounters request: one round trip for every process whose handle count or /proc/[pid]/io the probe was refused. The helper checks each target's start time, counts /proc/[pid]/fd and parses /proc/[pid]/io with the parser LinuxProcessProbe now shares (ProcIoParser.h), leaving out a target that has gone or been reused. BrokeredProcessProbe asks only while a helper session is already held (callIfIdle, 1 s timeout), never prompts, and stops asking after an ErrorReply from an older helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2728) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgradwohl
enabled auto-merge (squash)
October 25, 2026 15:24
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
… read (#2728) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgradwohl
disabled auto-merge
October 25, 2026 19:31
mgradwohl
enabled auto-merge (squash)
October 25, 2026 19:31
…ounters-2728 # Conflicts: # tasksmack.md
mgradwohl
disabled auto-merge
October 25, 2026 21:38
mgradwohl
enabled auto-merge (squash)
October 25, 2026 21:39
This was referenced Oct 25, 2026
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.
Description
Part of #2728 (Linux helper coverage): with the helper held, the Processes table's Handles/FDs, I/O Read and I/O Write now fill in for other users' processes. Until now they stayed blank because
/proc/[pid]/fdand/proc/[pid]/iorefuse a non-root reader.ReadProcessCountersrequest (39) andProcessCountersResult(56). One round trip carries every target, capped atMAX_COUNTER_TARGETS(16384). Each entry has a flags byte (bit 1 = handle count read, bit 2 = I/O read); any other bit is refused.ProcessCountersRead.hopens/proc/[pid], checks the start time, counts FDs withProcFdScan, and parsesiowithProcIoParser.h. That parser is now shared withLinuxProcessProbe, which drops its own copy. A target that has gone or been reused is left out of the reply.Readers::processCounters/handleProcessCounters. A helper without the reader answersErrorReply. A reader that throws or finds nothing leaves out just that target.BrokeredProcessProbe::enumerate()sends onecallIfIdlebatch (1 s timeout), and only for processes whose counts were refused. It only asks a helper that is already running, so it never prompts. After anErrorReply(an older helper) it stops asking.tools/helper-handshake.pyknows v4's Hello; docs updated in tasksmack.md and the FAQ.PR Size
🔴 Large (~610 added / 76 removed across 42 files). Most of it is tests, the 20 regenerated one-byte-version corpus seeds, and the protocol's encode/decode boilerplate. The behavior change is the helper reader plus the probe's single batch.
Type of Change
Checklist
clang-tidyand addressed any warningsclang-formaton my changespre-commit run --all-filesor installed pre-commit hooksTesting
cmake --build --preset debug -j 4 TASKSMACK_REQUIRE_DISPLAY=1 TASKSMACK_REQUIRE_SDBUS=1 xvfb-run -a env -u WAYLAND_DISPLAY ctest --preset debug -j 4 # all passNew tests:
BrokerProtocolTest: round trip, target cap, and refused flag bits.BrokerRequestMappingTest: no reader, a throw, nullopt.BrokeredProcessActionsTest: the probe fills refused counters, and stops after an ErrorReply.ProcessCountersReadTestandProcIoParserTest.PkexecBrokerTest.TheHelperReadsProcessCountersAndLeavesOutAStaleTarget: the real helper binary over its socketpair.WSL's kernel has no task I/O accounting (
/proc/self/iois missing). The I/O assertions therefore expectioReadexactly when/proc/self/ioexists, so they hold on both kinds of kernel.Additional Notes
v0.10.0 work, so no backport. The rest of #2728's Linux list (network attribution, hidepid listing, service actions, the title bar's text) follows in separate PRs.
🤖 Generated with Claude Code