Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Leopard and kvm_open*()



Hi all,

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,

Steve


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.