From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,8ec5c0b0c889b39f,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-11-22 04:35:03 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!newsserver.jvnc.net!yale.edu!spool.mu.edu!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!munnari.oz.au!yarra-glen.aaii.oz.au!anthony From: anthony@aaii.oz.au (Anthony Baxter) Subject: Determining %age CPU usage of a process. Message-ID: Sender: usenet@yarra-glen.aaii.oz.au (Network News) Organization: Australian Artificial Intelligence Institute Date: Mon, 22 Nov 1993 11:43:17 GMT 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