When does ECTG come along? I've got high-level notes on the various z 
architecture levels but the "extract-CPU-time facility" is not in my notes.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Greg Dyck
Sent: Wednesday, December 21, 2016 12:19 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: COBOL inline CPU timer

On 12/21/2016 10:46 AM, Paul Gilmartin wrote:
> How does ECTG do that?  Is there information in control registers supporting 
> it?
>
> Does it work likewise on systems other than z/OS, such as Linux?  VM guests?

The high level answer is that ECTG atomically fetches 8 bytes of storage from 
one location, PSADTSAV for z/OS, and subtracts the current CPU timer value from 
it and loads 8 bytes from a second location, TCBTTIME for z/OS, and loads a 
third value, which is the type of processor (GCP, zIIP, zAAP) for z/OS.  Using 
these atomically obtained values the current CPU time can then be calculated.  
The calculations are *not* something to be attempted in application code as 
proper adjustments have to be made if all CP types do not run at the same speed.

If appropriate information was saved at dispatch time by other operating 
systems then ECTG could be used there as well.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to