Operating System - OpenVMS
1748140 Members
3618 Online
108758 Solutions
New Discussion юеВ

Re: Obtaining "Maximum Observed Processes:"

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

Obtaining "Maximum Observed Processes:"

One of the lines in the Autogen report is "Maximum Observed Processes:". I wanted to use this value in a report I'm creating so I looked through AUTOGEN.COM. I can find the line where the above info gets displayed, but can't find how it's obtained.

How can I programmatically get the value for "Maximum Observed Processes:"?

TIA
14 REPLIES 14
Duncan Morris
Honored Contributor
Solution

Re: Obtaining "Maximum Observed Processes:"

Jack,

"AUTOGEN collects feedback during the SAVPARAMS phase by executing
the image SYS$SYSTEM:AGEN$FEEDBACK.EXE. AUTOGEN writes feedback
information to the file SYS$SYSTEM:AGEN$FEEDBACK.DAT. This file
is then read during the GETDATA phase."

So, not done by DCL.

You could try parsing output from SDA

SDA> clue mem /stat

depending upon your o/s version. See attched example.

Volker, or others, may have simpler shortcuts to the specific global cell holding the information.

Duncan
Hoff
Honored Contributor

Re: Obtaining "Maximum Observed Processes:"

The easiest way here is a tool or local process that performs periodic polling (your own code or potentially via MONITOR /RECORD data possibly related to T4 use or otherwise configured), though you can interpolate this value based on the system accounting or auditing data. By counting login and logout activity.
Jon Pinkley
Honored Contributor

Re: Obtaining "Maximum Observed Processes:"

Jack,

The system cell that tracks this is pms$gl_proccntmax, but it does not account for the NULL or SWAPPER "processes". So you must add 2 to get the value that AGEN reports.

AGEN$FEEDBACK.DAT has a record PROCESSES_PEAK that has the value that will be reported as "Maximum Observed Processes:" in SYS$SYSTEM:AGEN$PARAMS.REPORT

OT$ search SYS$SYSTEM:AGEN$PARAMS.REPORT "Maximum Observed Processes:"
Maximum Observed Processes: 145
OOT$ search sys$system:agen$feedback.dat proc
PROCESSES_PEAK = 145
MAXPROCESSCNT_CUR = 962
OT$ analyze/system

OpenVMS (TM) system analyzer

SDA> eval @pms$gl_proccntmax + 2
Hex = 00000000.00000091 Decimal = 145 DYN$C_NET_NODE_IDS
SDA>
it depends
Shilpa K
Valued Contributor

Re: Obtaining "Maximum Observed Processes:"

Hi Jack,

I ran the agen$feedback.exe image mentioned by Duncan Morris manually:

$ run SYS$SYSTEM:AGEN$FEEDBAK.EXE

It generated a file SYS$SYSROOT:[SYSEXE]AGEN$FEEDBACK.DAT

The parameter "PROCESSES_PEAK" in the file SYS$SYSROOT:[SYSEXE]AGEN$FEEDBACK.DAT contains the value reported by the autogen utility for "Maximum Observed Processes".

I have copied below the code that I used for reading the PROCESSES_PEAK:

$ search SYS$SYSROOT:[SYSEXE]AGEN$FEEDBACK.DAT PROCESSES_PEAK -
/output=sys$scratch:PROCESSES_PEAK.OUT/nowarning/nolog
$ if f$message($STATUS, "SEVERITY") .eqs. "%S"
$ then
$ open/read input sys$scratch:PROCESSES_PEAK.OUT
$ read input PROCESSES_PEAK
$ close input
$ endif
$!
$ delete/noconfirm sys$scratch:PROCESSES_PEAK.OUT;*
$ PROCESSES_PEAK = f$element(1,"=",PROCESSES_PEAK)
$!
$ show symbol PROCESSES_PEAK

OpenVMS System Manager's manual says the AGEN$FEEDBAK.EXE image can be run manually.

Regards,
Shilpa
Jon Pinkley
Honored Contributor

Re: Obtaining "Maximum Observed Processes:"

Just FYI, the value displayed for "Maximum Processes" by

SDA> clue mem/stat

is the "unadjusted" value of pms$gl_proccntmax, and is two less than what AGEN$FEEDBACK.DAT has for "PROCESSES_PEAK".

Not real significant, but if you are wondering why they don't agree, the reason is that AGEN$FEEDBACK adds 2 to account for the two process that are never created, the NULL process and the SWAPPER.

Jon
it depends
Shilpa K
Valued Contributor

Re: Obtaining "Maximum Observed Processes:"

Sorry, I had wrongly reported the image name. The correct image:

SYS$SYSTEM:AGEN$FEEDBACK.EXE

Regards,
Shilpa
Jack Trachtman
Super Advisor

Re: Obtaining "Maximum Observed Processes:"

Thanks all - I always enjoy learning something new about VMS.

I've decided to use Jon's info w/the PIPE cmd to get the info. Something along the lines of:

pipe (write sys$output "eval @pms$gl_proccntmax + 2" ; write sys$output "exit" ) | ana/sys | search sys$pipe "Decimal = " | (read sys$pipe x ; def/job jack &X )
John Gillings
Honored Contributor

Re: Obtaining "Maximum Observed Processes:"

Jack,

I'm not sure what language you intend to use "programmatically". If you're prepared to hard code an address (possibly version dependent), this can be done directly from DCL without the need for privilege. (Both SDA and AUTOGEN mechanisms suggested require privilege).

This is a fairly general hack applicable to many system cells, as most are protected USER READ.

First determine the value of the symbol PMS$GL_PROCCNTMAX (this will need privilege, but it's once only for a particular version of OpenVMS - this is the virtual address of the cell you're interested in:

$ ANALYZE/SYSTEM
SDA> EVALUATE PMS$GL_PROCCNTMAX
Hex = FFFFFFFF.9D00EE10 Decimal = -1660883440 PMS$GL_PROCCNTMAX

(this is for OpenVMS V8.3-1H1)

Define a DCL Symbol with this value:

$ PMS$GL_PROCCNTMAX=%X9D00EE10

Note the value displayed by SDA is a sign extended 32 bit value, so just use the low 32 bits. Since it's in system space, the address is the same across all processes. It's also a compile time constant, so it will only change if the underlying system images change, which means a new version, or fairly serious patch.

Now, you can read the cell at that address using an FAO hack:

$ proccntmax= F$CVUI(0,32,F$FAO("!AD",4,PMS$GL_PROCCNTMAX))

This is the uncorrected value, so you may want to add 2.

A trick to write DCL which works for several different versions of OpenVMS... collect the different values for versions you want to support and define them like this:

$ PMS_PCM_IA64V831H1=%X9D00EE10
$ PMS_PCM_AlphaV732=%X81008BD8
$ PMS_PCM_AlphaV83=%X81C08FD0
$ Sym="PMS_PCM_"+F$GETSYI("ARCH_NAME")+F$GETSYI("VERSION")-"."-"-"
$ IF F$TYPE('Sym')
$ THEN
$ proccntmax= F$CVUI(0,32,F$FAO("!AD",4,'Sym'))
$ ELSE
$ WRITE SYS$OUTPUT "Unsupported version ''Sym'"
$ ENDIF


For a compiled programming language, you may be able to declare PMS$GL_PROCCNTMAX as an external image and link against the system base image. This will also be version dependent.
A crucible of informative mistakes
Steve Reece_3
Trusted Contributor

Re: Obtaining "Maximum Observed Processes:"

If you want a portable and supported route (rather than poking around in Autogen and data structures that may or may not change in the future), you could always use F$GETJPI lexical calls to establish process numbers.
Repeated calls to it for a PID until it returns a blank, at which point you've passed through all of the processes on the system.
It may not be as efficient as using autogen's feedback, but it is a supported method of getting such data.

Steve