site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hi all, 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 conducted some dialog with this list on this subject back in January 2007, but now that Leopard is here I have some additional questions. I have written a batch processing engine. Imagine the situation where a daemon launches a shell script on behalf of another user. We have no control over what that shell does; all we know is the name of the shell and its script content. However, we need to know periodically, while the top-level shell is still running, what its CPU total usage is so that we can report back to the user on the progress of the job, and can perhaps enforce a CPU time limit. All I know about the running shell is the PID of the top-level process; by doing a sysctl(CTL_KERN, KERN_PROC, KERN_PROC_ALL) I can trace through the process relationships and work out the total resource consumption, but only if I can get the CPU used by terminated children of an arbitrary PID via the proc->p_stats->p_cru fields. Right now (on Tiger) I am doing a kvm_read() to get this information, but in Leopard this is no longer possible I assume. I'd appreciate some pointers about how I might get at the p_cru info on Leopard. TIA, This email sent to site_archiver@lists.apple.com
participants (1)
-
Steve Thompson