Operating System - HP-UX
1834915 Members
2412 Online
110071 Solutions
New Discussion

calculate process cpu usage using pst_usercycles, pst_systemcycles, pst_interruptcycles fields

 

calculate process cpu usage using pst_usercycles, pst_systemcycles, pst_interruptcycles fields

Does anybody have a ready code to calculate percentage of CPU resource used by process in time interval by using pst_status.pst_usercycles, pst_status.pst_systemcycles, pst_status.pst_interruptcycles?

Thank you.
2 REPLIES 2
HGN
Honored Contributor

Re: calculate process cpu usage using pst_usercycles, pst_systemcycles, pst_interruptcycles fields

Hi

The following URL has info which maybe of some help I suppose

http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,5944,00.html

This has also a script to determine the numner of threads in a process.

Rgds

Gopi

Re: calculate process cpu usage using pst_usercycles, pst_systemcycles, pst_interruptcycles fields

Unfortunately the link shows only how to acess atomic fields in struct pst_status.
These I have been using for a while.
My problem is how to caclulate percentage of CPU resource used by process in interval (atomic value) whereas fields pst_status.pst_usercycles, pst_status.pst_systemcycles and pst_status.pst_interruptcycles are structures of 2 long fields each?