I am writing a small utility to get statistics for each process on Mac OS X. It starts the processes that it checks.
One of the features that I really want to enable is Instant Net and Disk IO; Unfortunately, the only way I found to really get this information is to use the application as a DTrace consumer for certain PIDs. I say, unfortunately, because when DTrace becomes active, the system becomes noticeably slower, and turning on DTrace requires my utility to run as root (which seems excessive, given that my process requires checking all the processes that it creates).
Indeed, DTrace simply transfers information very hard, which, it seems to me, should exist elsewhere in the kernel. There is a Mac OS utility called iStatMenus that provides this information (and without corresponding system performance) in such a way that I think that there are some means to achieve what I want; I tried to contact them to find out if they mind sharing, but have not yet received an answer.
So, is there a minimal way to get Net and Disk performance counters for a given PID on Mac OS X? (That is, without calling DTrace)
source share