Operating System - OpenVMS
1753808 Members
7708 Online
108805 Solutions
New Discussion

Re: how can i get all process names and topcpu using c?

 
likuair_1
Advisor

Re: how can i get all process names and topcpu using c?

i am using the system function to get system informations ,so i'm also testing sys$getsyi ,i know how to get the total memory of the system using SYI$_PHYSICALPAGES,but i wanted to get total free pages,in use pages just like
$show memory,can you help me?
Hein van den Heuvel
Honored Contributor

Re: how can i get all process names and topcpu using c?

likuair,

YOU can do this.

Check out the GETJPI call in the example.
Read it twice.
The GETSYI call is very much similar.
Read up! In the manuals, or: $ help system $GETSYI


As for the 20%.... 20% of what?
A single CPU? All cpu usage?
Since beginning of time? For an iteration?

YOU can do this. If you can not, then IMHO you have no business even asking the first question.
YOU can solve this in the program, or outside in EXCEL.
You'll just need 2 (or more) measurement in a loop. Take that CPU time (in centi-seconds) subtract the prior value, multiply by 100 and divide by the centiseconds between measurements.

IF you can not handle that, call LIB$SPAWN ("SHOW SYSTEM") or similar.

btw... For mere money I'll gladly hold your hand, or do this for you.

Enjoy!
Hein