Operating System - OpenVMS

Re: Process Uptime

Go to solution
Regular Advisor

Process Uptime

Hi all,
is there a way to check the process uptime?

With "Show System" command I'll see only CPU time, but not the up time of the single process.

./ Lucas
Volker Halle
Honored Contributor

Re: Process Uptime

$ SHOW PROC/ACC/ID= will show you the 'Connect time:'. This is the process uptime.


will show you the process creation time. You can easily calcuate the uptime with F$DELTA_TIME, if you're running on a recent version of OpenVMS.

$ write sys$output f$delta_time(f$getjpi("","LOGINTIM"),F$CVTIME(,"ABSOLUTE"))

Regular Advisor

Re: Process Uptime

volker, you are the man! :)
SHOW PROC/ACC/ID=20230756 works fine!

./ Lucas
Jon Pinkley
Honored Contributor

Re: Process Uptime

You didn't ask this, but sometimes is it useful to know how long an image has been running. This only works if image accounting is enabled, and there is no $getjpi access to the info, so you will need SDA or a privileged program to get the information.

$! with appropriate privs
$ analyze/system
SDA> set process/id= ! the target PID
SDA> examine/time ctl$gq_istart

There are also CTL$Gx_I* cells that have snapshot values of the CPU time, DirIO, BufIO, etc. at the time the image started. When the image accounting record is written, the delta values are what is written. In other words, CTL$GL_ICPUTIM contains the process CPU time when the image was activated; it doesn't get updated by the HWCLK interrupt. I am not sure about the workingset peak CTL$GL_IWSPEAK, as it isn't obvious to me how a snapshot at image activation time would be meaningful to the image, but the working set size changes much less frequently than the CPU time, so I would guess that both process and image peaks are maintained when the workingset is increased.

These are some of the image accounting related cells in the process control region.


I wish these cell were updated regardless of whether image accounting was enabled, and that there was $GETJPI access to them.

it depends
Jess Goodman
Esteemed Contributor

Re: Process Uptime

If you're looking for a SHOW SYSTEM like utility but with output that shows each process's uptime, you might wannt to try my SSYS program. Attached is a .ZIP file containing sources and VAX/ALPHA binaries.

list of processes found on node AX99 at 17-JUL-2008 21:37:19
pid process state login time %cpu pflt/sec bio/sec dio/sec
78A8916A GOODMAN CUR 2 I 7 06:27:14 0.02 0.126 0.237 0.210
78AE25BD _TNA135: LEF I 0 09:17:46 0.02 0.207 0.205 0.078
I have one, but it's personal.
Regular Advisor

Re: Process Uptime

Jess, thanks for your utility.
But i got some problem to use it.

%DCL-W-ACTIMAGE, error activating image SYS$LOGIN:SSYS.EXE
-CLI-E-IMGNAME, image file DSA0:[SMSC]ssys.exe;1
-IMGACT-F-NOT_I64, image is not an HP OpenVMS Industry Standard 64 image

I'm running OpenVMS V8.3-1H1 on HP rx2660 (1.59GHz/6.0MB)

May I recompile it?? However I don't know how! :(
./ Lucas
Duncan Morris
Honored Contributor

Re: Process Uptime

Jess did indicate that the ZIP files contained only ALPHA and VAX binaries.

It would appear that you are trying to run it on an itanium platform.

The zip files contains the source files, but you will need a FORTRAN compiler if you want to recompile the program for itanium.

Regular Advisor

Re: Process Uptime

You are right Duncan, I execute it on wrong machine!!! ^_^
On Alpha server works fine....

Ok I'll use SHOW PROC/ACC/ID= command on itanium and ssys on alpha!

Thanks to all!
./ Lucas