Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: anthony@aaii.oz.au (Anthony Baxter)
Subject: Determining %age CPU usage of a process.
Date: Mon, 22 Nov 1993 11:43:17 GMT	[thread overview]
Message-ID: <anthony.753968597@eden-valley> (raw)

Well, the port of 'top' to the alphas is almost done. The only teensy thing
missing is the percentage cpu calculation. 

'struct proc' contains a field:
        fixpt_t p_pctcpu;       /* %cpu for this process during p_time */

but as far as I can tell, this is never actually set by anything. 
I _know_ it must be possible to determine this, (ps does it, see below)
but how? and where is it stored?
               vvvv
USER       PID %CPU %MEM   VSZ  RSS TT  STAT STARTED       TIME COMMAND
root     19082 92.0  1.3 9.55M 840K p5  R    22:48:39   0:54.15 a.out

As to how ps gets its info, for each process it does 3 calls to table,
one TBL_UAREA, one TBL_ARGUMENTS, and one TBL_PROCINFO (this info from
trace-0.3)

Theres nothing in TBL_PROCINFO, nothing in TBL_ARGUMENTS, so it must 
be something in the user area - but what??

Anyone with access to DEC OSF/1 source for ps like to help me out here?
All I need is a hint - pretty please?

Its pretty much the only thing holding back 'top' from being finished.

Anthony
--
 anthony baxter                 australian artificial intelligence institute
email : anthony@aaii.oz.au         1 grattan st, carlton, australia 3053
    /\/\||                                 phone : +613 663 7922
  It's not denial. I'm just selective about the reality I accept. - Calvin 


             reply	other threads:[~1993-11-22 11:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-11-22 11:43 Anthony Baxter [this message]
1993-11-22 13:44 ` Determining %age CPU usage of a process Wilko Bulte
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox