Skip to content

feat: expand procfs with real data and per-PID entries#167

Merged
ryanbreen merged 1 commit intomainfrom
feat/procfs-expansion
Feb 7, 2026
Merged

feat: expand procfs with real data and per-PID entries#167
ryanbreen merged 1 commit intomainfrom
feat/procfs-expansion

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Fix /proc/meminfo to report real memory from frame allocator instead of hardcoded 1GB/512MB
  • Add /proc/stat with live kernel activity counters (syscalls, interrupts, context switches, forks, execs, CoW faults)
  • Add /proc/cowinfo with copy-on-write statistics
  • Add /proc/mounts with mounted filesystem listing
  • Add /proc/[pid]/status with per-process info (name, state, parent, children, fd count, memory usage)
  • Add FdTable::open_fd_count() helper for per-process fd reporting
  • Add frame_allocator::memory_stats() for real memory statistics

Test plan

  • ARM64 kernel builds cleanly (zero warnings)
  • x86_64 kernel builds cleanly (zero warnings)
  • cat /proc/meminfo shows real memory values
  • cat /proc/stat shows kernel counters
  • cat /proc/cowinfo shows CoW statistics
  • cat /proc/mounts shows mounted filesystems
  • cat /proc/1/status shows init process info
  • Boot tests pass on both architectures

🤖 Generated with Claude Code

…-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>
@ryanbreen ryanbreen merged commit bc60dda into main Feb 7, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant