site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Wed, 12 Dec 2007, Terry Lambert wrote: Steve _______________________________________________ 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... I understand people wanting to write their own performance tools, but people who do this also need to understand that doing so will likely tie them to the same constraints Apple has with regard to using SPIs and unstable interfaces. What I need to do is the capability, while a process is running, is to determine the total CPU time used by that process and any of its children, _while the children are still running_. Obviously I can easily determine the CPU time used by each child while it is running by summing up the thread times and the terminated thread times, but there does not appear to be a way to determine, for each still-running child, what the CPU time used by that child's own terminated children is. In short, I need to calculate the total CPU used by a process while it is running, including all children and children of children (and so on), both terminated and still running. This is critical for my application. Is there any way to do this at all? I don't care if the method is version specific or not. On Tiger, I do a sysctl() to get the kinfo_proc structure for all processes of interest, and use a kvm_read(kinfo_proc.kp_eproc.e_paddr) to get the p_stats structure of interest. This doesn't appear to be possible anymore on Leopard, and from what I read, may not point to valid data even if I could get at it. This email sent to site_archiver@lists.apple.com