[dtrace-discuss] timewarping with walltimestamp
Robert Harris
Robert.Harris at Sun.COM
Fri Dec 21 03:10:24 PST 2007
On 21 Dec 2007, at 00:50, Mike Gerdts wrote:
> If a D program wishes to determine the runtime of a program that may
> have started before the D program did, would it adding up the
> microstate times be a good way to get the actual run time?
Yes, but we keep track of the microstate data on a per-LWP basis.
When the kernel wants to know the usage of a process, it sums
the usage of the running LWPs, using mstate_aggr_state(), and
adds that to the cumulative total for LWPs that have died
(held in the proc_t's p_acct[] ).
If you want to track the process's cumulative usage as it dies
then you could perform the calculation from within proc_exit(),
e.g. at the call to exacct_commit_proc(), where the process
has but one LWP. Alternatively, you could enable the
extended accounting subsystem.
Robert
More information about the dtrace-discuss
mailing list