site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=K+grsNGgGtcs6yKfLBdt2861nsSBCBn1HKolagtoXXpe2VDs7RbMjUos67C9/mt1QmzmL/T5Z8rl/ZkjlFSBg3IHiIPVMmB+bAPCtPwKoG0U+t8A7/ni4cG1P7FPOrV+MmkYBm7becK0sP3YdizhRzhRlL3zmEokHh2OuaEGDQk= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=aiVOhNjL23xmDwwLdrEEmKARbddYM/FFGWMV6CjRXcySRY6yUQpsEcqC8K6du+nqj2sG4eWDN1Hd66DceBzXRYLIJyQisvYf8+2K8HNkASidxUyLyMWIryDKyYgUfk0u49KcumK7dDjbbE9GwnM8rtH3fxW3EIJ1v1aby5Hd8Zc= Thanks. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Hi, I am a born-again Mac programmer, who's spent the the last few years doing linux server development. A new project has fallen on my lap which requires gathering and analysis of quite a bit of system usage information on a per-process (task?) basis. I need to gather at least the following: CPU usage, memory usage (total allocated memory, resident memory, wired memory, page file usage), I/O information (bytes read/write, from/to disk or network devices). It would also be good to have other information such as graphics device access stats and audio device stats. I figured a good way to get started would be to look at the source for top, and I really hope there is an easier, softer way to go about this. top relies on sysctl to gather kernel process info, and iterates trough a process' thread info in order to gather things like CPU utilization data. If I have to go about it that way, I will, but was wondering if there is a more straight-forward approach. Also, the I/O statistics (network and disk) gathered by top are on a global basis, rather than on a per-process basis (it iterates through the different block devices and network interfaces to collect this data). Is accounting of these stats available per-process or per- thread? The impression I am getting is that some information is available via the kernel, other via the BSD subsystem, other via the IOKit APIs. I don't know how much overlap there is, or which is the best way to get to this information. Any help pointing me in the right direction would be greatly appreciated. This email sent to site_archiver@lists.apple.com