Path: utzoo!attcan!uunet!husc6!bbn!uwmcsd1!marque!gryphon!crash!jeh From: jeh@crash.cts.com (Jamie Hanrahan) Newsgroups: comp.os.vms Subject: Re: update for SHOMOD.COM Summary: two warnings Keywords: performance data collection v5 Message-ID: <3016@crash.cts.com> Date: 25 May 88 00:30:21 GMT References: <8805240321.AA00906@ucbvax.Berkeley.EDU> Reply-To: jeh@crash.CTS.COM (Jamie Hanrahan) Organization: Crash TS, El Cajon, CA Lines: 28 The referenced article contains DCL "code" which obtains the system idle time, which is in fact the CPU-time counter in the null process's PHD.) Two comments. First, be aware that the NULL process "executes" in kernel mode. Code that is getting NULL's cpu time is probably also getting the processor-mode clock-tick counters from the six-longword vector at PMS$GL_KERNEL. (The longwords contain the Kernel, Exec, Supv, User, Interrupt-stack, and Compatibility-mode time, in that order.) Since NULL executes in kernel mode, its time is reflected in the kernel-mode counter. If you're looking to generate information a la the MONITOR MODES display, you should subtract NULL's CPU time from the value you get from the kernel- mode counter; what's left is the true kernel-mode time. Second, this changes in V5. The vestiges of the NULL process still exist, but it is never scheduled to run. A new structure, the per-CPU database (CPU$), includes eight longwords in which the times are kept (K, E, S, U, I, C, spinlock busy-wait, and idle time). There is a vector which contains the addresses of all of the per-CPU data bases in the system; a proper performance-data-collector should scan the vector, look at each CPU$ structure, and add up the results, after acquiring an appropriate spinlock -- HWCLK looks like a good choice. I don't know the name of the global longword that points to the vector, but I should be able to find out. Within the CPU data base, the fields you want are CPU$L_KERNEL for the seven-longword array, followed by CPU$L_NULLCPU for the idle time. (The one follows the other now, but I wouldn't count on that forever.) I don't know if any of the times "overlap" the way kernel and null used to.