Per-Process Thread, Socket & File Descriptor Inspection #12
Notifications
Due Date
No due date set.
Depends on
#11 Live Process Explorer & Resource Attribution Table
gronod/MacMonitor
Reference: gronod/MacMonitor#12
Reference in New Issue
Block a user
Resolved in Milestone 3. Implemented
MMProcessDetailInspector.h/.minspecting per-process thread states, CPU usage, open vnode file descriptors, and active sockets with TCP states. Verified with unit tests and integrated into Process Detail sheet. Merged intodevelop.Technical Implementation Plan & Code Solution
1. Process Drill-Down Architecture
To inspect individual threads, open files, and active sockets of a target process on demand:
proc_pidinfo(..., PROC_PIDLISTTHREADS)and queried viaPROC_PIDTHREADINFO.proc_pidinfo(..., PROC_PIDLISTFDS)and resolved to vnodes viaPROC_PIDFDVNODEPATHINFO.PROC_PIDFDSOCKETINFO.2. Objective-C Inspector (
MMProcessInspector.m)3. Swift UI Integration
4. Permission Boundary
If the target process belongs to
rootand MacMonitor is running under standard user credentials,proc_pidfdinfowill returnEPERMcleanly without crashing. The inspector catches and displays a "Permission Denied (Protected Process)" state.