feat: expand procfs with real data and per-PID entries#167
Merged
Conversation
…-PID status Replace hardcoded /proc/meminfo with real frame allocator data by adding memory_stats() to frame_allocator.rs. Add four new procfs entries: - /proc/stat: kernel activity counters (syscalls, interrupts, context switches, forks, execs, CoW faults) from the tracing framework - /proc/cowinfo: copy-on-write statistics (faults, pages copied, sole-owner optimizations) - /proc/mounts: mounted filesystem listing from VFS - /proc/[pid]/status: per-process info (name, state, parent, children, fd count, memory usage) with dynamic PID path resolution The per-PID support uses on-demand synthesis rather than static registration, with careful lock ordering (PROCFS lock released before acquiring process manager lock) to prevent deadlocks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
/proc/meminfoto report real memory from frame allocator instead of hardcoded 1GB/512MB/proc/statwith live kernel activity counters (syscalls, interrupts, context switches, forks, execs, CoW faults)/proc/cowinfowith copy-on-write statistics/proc/mountswith mounted filesystem listing/proc/[pid]/statuswith per-process info (name, state, parent, children, fd count, memory usage)FdTable::open_fd_count()helper for per-process fd reportingframe_allocator::memory_stats()for real memory statisticsTest plan
cat /proc/meminfoshows real memory valuescat /proc/statshows kernel counterscat /proc/cowinfoshows CoW statisticscat /proc/mountsshows mounted filesystemscat /proc/1/statusshows init process info🤖 Generated with Claude Code