Re: How to retrieve process kernel time and user time?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com -- Terry Hi All, u_quad_t p_uticks; /* Statclock hits in user mode. */ u_quad_t p_sticks; /* Statclock hits in system mode. */ Thanks in advance! Regards, Manish _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/tlambert%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Resource utilization information is kept in Mach. It is only copied over to BSD for the purposes of rusage(), and then only when the process exits. You are looking in the wrong place for the accounting information. Typically, at this point, we recommend that you do not use Mach calls, since this can change from software update to software update. Instead, popen() the "top" command, which is able to put its output in a machine-parsable form. If we change anything top relies on, we tend to notice it immediately and fix top at the same time, so this will insulate you from kernel structure andd algorithm changes (with the bonus of being portable to older versions of the OS without modifications). On Apr 15, 2008, at 11:09 PM, Manish Chaturvedi wrote: I am trying to get the Kernel time and User time of the process using following variables of the structure extern_proc but for every process I am getting a “Big ZERO” corresponding to these values, does that mean no process have spend even a millisecond in Kernel mode and User mode ? Is it the right way to get the Kernel time/CPU time and User time for a process (Except using ps )? What is the jiffy value in seconds on Mac because if I get values I will have to convert it in seconds. This email sent to tlambert@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert