On 12/05/2013 01:26 PM, Daniil Lunev wrote:
508  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#508>/*
509  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#509>
  * Given the old percent cpu and a time delta in nanoseconds,
510  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#510>
  * return the new decayed percent cpu:  pct * exp(-tau),
511  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#511>
  * where 'tau' is the time delta multiplied by a decay factor.
512  <http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#512> 
 * We have chosen the decay factor (cpu_decay_factor inparam.c  
<http://src.illumos.org/source/s?path=param.c&project=illumos-gate>)
513  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#513>
  * to make the decay over five seconds be approximately 20%.
514  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#514>
  *
515  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#515>
  * 'pct' is a 32-bit scaled integer <= 1
516  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#516>
  * The binary point is to the right of the high-order bit
517  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#517>
  * of the 32-bit word.
518  
<http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/os/msacct.c#518>
  */

According to the commentary  t_pctcpu seems not to be very precise.

For most purposes I found, t_pctcpu is sufficient. But I'd suggest trying it out and seeing if it fits what you need instead of relying on the comment.

Maybe I missed this from an earlier email, but we would be able to provide more guidance if we knew what you're trying to accomplish.

But even with this param we haven't a mechanism for estimating, say,
"cpu usage" of the functions (mean, what part of the cpu usage a
function takes), except dtrace that can not be used from the kernel.

--Daniil Lunev



Per function metrics such as what you're describing are not something one should expect a general purpose OS to provide by default. If you're looking at time deltas between states or events, micro-state accounting might help you. If you're doing source analysis, then DTrace is likely what you're looking for.

Rafael







-------------------------------------------
illumos-discuss
Archives: https://www.listbox.com/member/archive/182180/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182180/21175430-2e6923be
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=21175430&id_secret=21175430-6a77cda4
Powered by Listbox: http://www.listbox.com

Reply via email to