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

lawrencedo99 at gmail.com lawrencedo99 at gmail.com
Mon Jun 6 03:46:36 EDT 2016


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...



More information about the Info-vax mailing list