[Info-vax] How to obtain percentage of a given CPU consumed by a process

Paul Sture nospam at sture.ch
Mon Jun 6 07:33:58 EDT 2016


On 2016-06-06, johnwallace4 at yahoo.co.uk <johnwallace4 at yahoo.co.uk> wrote:
> On Monday, 6 June 2016 08:46:37 UTC+1, lawren... at gmail.com  wrote:
>> On Sunday, June 5, 2016 at 8:56:35 PM UTC+12, johnwa... at yahoo.co.uk wrote:
>> > I can't remember whether the approach I'd use can be done just with
>> > non-priv code...
>> 
>> It was non-privileged code, that much I can remember. :)
>> 
>> It had to do with the fact that CPU accumulation was done in a 100Hz
>> interrupt routine that simply incremented a counter in the PCB of the
>> current process. My code was running for just short of 10ms each
>> time, before doing something that triggered a reschedule (might have
>> been a $QIOW or a $HIBER, I can’t remember now). Only that
>> “something” completed very quickly, putting my process back to being
>> runnable again.
>> 
>> I think I was actually consuming about 75% of the CPU on that
>> VAX-11/750, without it showing up.
>> 
>> I never tried the same trick again, so I have no idea if it would
>> still work on later hardware or versions of VMS...
>
> That's basically the trick I was thinking of.
>
> Lots of OSes (not just VMS) calculate their performance/accounting
> data based on periodic sampling of which processes are 'current'.
> The current processes are then 'charged' for the whole interval.
> Most of the time this approach is plenty good enough. However...
>
> A process which somehow arranges to not be 'current' when the
> sampling is done, but eats CPU the rest of the time, can give a
> devloper, sysadmin, etc, a bit of a headache.

A full shadow copy exhibits behaviour like that.  You know the system
is running slowly from response times but the shadow copy doesn't show
up in the usual places.

> Not specific to VAX, not specific to VMS.
>
> Don't tell anyone :)

Mum's the word.

-- 
There are two hard things in computer science, and they are cache invalidation,
naming, and off-by-one errors.



More information about the Info-vax mailing list