Operating System - HP-UX
1753798 Members
7678 Online
108805 Solutions
New Discussion юеВ

Re: CPU precentage by pid

 
SOLVED
Go to solution
ciwoo
Occasional Contributor

CPU precentage by pid

I want to get a process CPU precentage by its pid with c language in hp-ux,
this function like "double GetCPUbypid(int pid)" with c lanuage? I appreciate your answer!!!
thanks.
I
2 REPLIES 2
Laurent Menase
Honored Contributor
Solution

Re: CPU precentage by pid

is it the overall percentage like

total cpu time used divide by (realtime cpu time used * nbcpu)?

or instantaneous between 2 samples?

in any case the times can be get with
pstat_getproc()


you have pst_pctcpu in pst_status result of pstat_getproc().

If you want to get it by thread use pstat_getlwp()
ciwoo
Occasional Contributor

Re: CPU precentage by pid

TKS