[Info-vax] High resolution per-process CPU consumption statistics

Mark Daniel mark.daniel at wasd.vsm.com.au
Tue Mar 24 13:19:05 EDT 2020


On 24/3/20 4:08 pm, Bob Gezelter wrote:
> On Monday, March 23, 2020 at 8:02:22 PM UTC-4, Mark Daniel wrote:
>> Would like to be able to measure process CPU consumed during specified
>> continuous sections of processing.  Only interested in CPU-intensive
>> sections so USER mode consumed relevant.  Imagine inserting calls at the
>> beginning and ending of those sections with a magic number representing
>> CPU consumption/delta/whatever made available.
>>
>> As some of these CPU-intensive code sections are short duration the
>> granularity needs to be quite fine.  The likes of JPI$_CPUTIM and
>> LIB$STAT_TIMER (10mS) seem unsuitable.
>>
>> Prepared for non- USER mode code.  This is only for ad hoc developmental
>> insight and not general use.  Needs to accommodate Alpha and/or Itanium
>> (and/or x86-64 :-)
>>
>> And, of course, any other suggestion.
>>
>> As always, TIA.
> 
> Mark,
> 
> SYS$GETTIME_PREC will get you the full precision of the system clock on Itanium.  Unfortunately, this is elapsed time, not CPU time. One has to be careful, but it gives a upper bound on the lower bound of how long a compute section takes (because of irreproducible interference effects).

Yes and yes.  And if using the C-RTL also the clock_..() functions.  And 
why a per-process accounting accumulator would be better.  Really only 
interested in USER mode processing.

While so-many-per-time-unit is a familiar metric it would be just as 
useful to know, out of a total of this much processing, this proportion 
was spent doing that.

Thanks Bob.

> GETJPI is documented as limited to 10 ms tics.
> 
> - Bob Gezelter, http://www.rlgsc.com




More information about the Info-vax mailing list