Operating System - OpenVMS
1826554 Members
3924 Online
109695 Solutions
New Discussion

Re: how to see each process handle %time in cpu

 
SOLVED
Go to solution
edward wang_1
Frequent Advisor

how to see each process handle %time in cpu

when using monitor/system, just to see several
process's %time in cpu. how to see it like "ps aux" in UNIX.
16 REPLIES 16
Karl Rohwedder
Honored Contributor

Re: how to see each process handle %time in cpu

Isn't PS... more like SHOW SYSTEM or perhaps MONITOR PROCESS?

regards kalle
edward wang_1
Frequent Advisor

Re: how to see each process handle %time in cpu

hi karl
when show system and monitor process,can't see each process handle cpu %time.
thanks
Jan van den Ende
Honored Contributor

Re: how to see each process handle %time in cpu

Edward,

To begin with:
WELCOME to the VMS forum!

If I understand you correct, something similar to what you are asking is given by

$ MONITOT PROCESS/TOPCPU

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
edward wang_1
Frequent Advisor

Re: how to see each process handle %time in cpu

Hi jan
yes, that just to see top(10) process, I want to see any process
Kris Clippeleyr
Honored Contributor

Re: how to see each process handle %time in cpu

Edward,
Knowing nothing about U**x, nor the "ps -aux" command, and if I'm interpreting your question correct than SHOW SYSTEM is the command that I think comes closest to the U**x "ps -aux" command.
SHOW SYSTEM shows some info about all processes currently running on the system (and in the 6th column of the information displayed is the CPU time a process has consumed).
Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
Hein van den Heuvel
Honored Contributor

Re: how to see each process handle %time in cpu

Edward, using standard tools the 'SHOW SYSTEM' indicated is as close as you will get PS -AUX.
It will show accumulated CPU times in seconds, not a percentage.

There is a limited 'ps' avaibale in the optional GNV (GNU) package. See sample output, from a VMS 8.3 system, below.

There is no simple user/system display like VMSTAT either. For that check out MONI MODE.

For more detailed timeline based performance stats, google for +OpenVMS +T4

Also, it is relatively straightforward to 'roll your own' with the system service SYS$GETJPI.

What problem are you trying to solve?
Maybe there is a better way than 'ps -aux' under OpenVMS.

Regards,
Hein van den Heuvel
GHvdH Performance Consulting.



$ ps -aux
PID TTY TIME CMD
20400401 ? 0:19 (swapper)
20400405 ? 0:15 (dcl)
20400407 ? 0:02 csp
20400408 ? 0:00 configure
20400409 ? 0:00 usb$ucm_server
2040040A ? 0:05 lanacp
2040040C ? 0:00 fastpath_server
2040040D ? 0:00 ipcacp
2040040E ? 1:11 errfmt
2040040F ? 0:00 fileserv
Willem Grooters
Honored Contributor

Re: how to see each process handle %time in cpu

Percentage of what: all CPU power (including Idle), effectively used CPU cycles (excluding Idle)? Including or excluding non-user modes?

If you want a full view, MONITOR is the closest you can get, but for momentary snapshots, you'll have to do the calculation yourself.
For a full view, you'd better monitor over extended periods: have MONITOR run in recording mode and analyze the output playing the recorded data back, or write a program to read the data file - Or use a toolkit like T4, which you can use to do the
calculations (and much more: correlate data - which is a huge advantage) (And: it's free).

Willem Grooters
OpenVMS Developer & System Manager
Jess Goodman
Esteemed Contributor
Solution

Re: how to see each process handle %time in cpu

I have attached a .ZIP file containing source and VAX/ALPHA binaries for my SSYS program which is a SHOW SYSTEM alternative.

Here is what the SSYS program output for one process looks like:

list of processes found on node AX99 at 14-NOV-2007 18:15:44
pid process state login time %cpu pflt/sec bio/sec dio/sec
654EF89C GOODMAN LEF Is 0 00:27:03 17.74 0.068 0.606 0.040

Details:
SHOW SYSTEM alternative that displays CPU use as a percentage, and direct/buffered I/Os and pagefaults in per-second rates. The time interval used for calculating this is each process's connect time.

The process display can be affected by using these qualifiers:

/CLUSTER or /NODE[=nodename] selects system(s); default = current node.

/[NO]INTERACTIVE /[NO]BATCH /[NO]NETWORK /[NO]OTHER - selects based on process mode. If more then one is used then all or none of them must be negated.

/[NO]SUBPROCESS - selects or rejects (/NO) subprocesses.

/[NO]PROCESS=name - selects or rejects (/NO)based on process name. Name can contain "*" or "%" wildcards or be the "" null string.

/[NO]USERNAME=name - selects or rejects (/NO) based on the user name. Wildcard characters allowed but if none a trailing "*" is assumed (same as SHOW USER). Note user name is not in the output display.

/BEFORE=time /SINCE=time - selects based on the process login time. Time is any valid absolute, delta, or combination time and can use keywords TODAY, TOMORROW, YESTERDAY, or BOOTTIME (of this node).

/CPU=(MIN=rate,MAX=rate) selects based on how much CPU, in % of one cpu, process has used since the process logged in. Use an integer from 0 to 100 for the rate. MIN or MAX or both can be specified.

/INSWAP - By default for an out-swapped process only the PID, process name, state, and mode flags are displayed because its login time can not be retrieved. /INSWAP forces the process to swap in so all data is retrieved.

/[NO]MISSING - For processes in MWAIT state (which includes MUTEX and all the RW* states), or an out-swap state(without /INSWAP) a display line shows only the PID, process name, state, and mode flags. Using /MISSING filters any such partial line out. /MISSING is the default if /BEFORE, /SINCE or /CPU was used since we do not know the process login time required to make the selection, in which case /NOMISSING can be used to display the partial lines anyway.

/NOHEADING can be used to suppress the heading lines that preceed each node's group of processes.

This uses VMS system services to return the process info. SYS$GETJPIW is called in a loop after (depending on qualifiers) setting up filters to control which processes SYS$GETJPIW returns using SYS$PROCESS_SCAN.
I have one, but it's personal.
Jess Goodman
Esteemed Contributor

Re: how to see each process handle %time in cpu

Sorry, here's the .ZIP attachment.
I have one, but it's personal.
edward wang_1
Frequent Advisor

Re: how to see each process handle %time in cpu

Hi up all

I am very thanks you help. this is my first ask question in here and got many peoples to help me,I am so thanks. I hope DEC VMS more growing and more stronging.

Hi Jess
I can't download your attached s/w for test.
John Gillings
Honored Contributor

Re: how to see each process handle %time in cpu

edward,

The trouble with trying to show CPU usage as a percentage is - percentage of what? the last second, minute, hour, day, since boot etc... Suppose we choose "second" we need to sample the cumulative CPU usage for each process at time T, then again at T+1 second, calculate the differences and calculate percentages. Even that's not as easy as it sounds, becuase it takes a finite time to take those samples, so we can't be sure the collections are consistent (indeed, we can be fairly certain that they're NOT). The upshot is if you do this across ALL processes across the system the sum of the individual percentages is unlikely to add up to 100.

But wait! What if there's more than 1 CPU? Do we express it as % of a single CPU or percentage of total available CPUs? What if we've got hyper threading enabled? Then the total available CPU is effectively variable.

So, given the inherent ambiguity and uncertainty, does it make sense to try and express CPU consumption as a percentage? What are you really trying to achieve?
A crucible of informative mistakes
edward wang_1
Frequent Advisor

Re: how to see each process handle %time in cpu

Hi

I want to get a result like (Jess's show)follow
Here is what the SSYS program output for one process looks like:

list of processes found on node AX99 at 14-NOV-2007 18:15:44
pid process state login time %cpu pflt/sec bio/sec dio/sec
654EF89C GOODMAN LEF Is 0 00:27:03 17.74 0.068 0.606 0.040

thanks all of you, but I can't download Jess's s/w for test
Willem Grooters
Honored Contributor

Re: how to see each process handle %time in cpu

Download is easy.
* save the attachement from ITRC as-is on a PC (or MAC, or whatever system you have)
* if not on VMS: FTP the file (BINARY) to the VMS box to unzip it there.

Unzipping the file on a non-vms system and binary FTP the files to VMS may render files unusable, therefore, it s not recommended.
It might be, however, if the file is a real stream-of-bytes without internal structural data.
having said that: you may be able to FTP the image you need (.EXE) to VMS (in binary mode, this is essential!) and run it - eventually changing file and record attributes to match:

Record format: Fixed length 512 byte records
Record attributes: None
RMS attributes: None

Lucily the image activator is not very critical to the format.

If you want to follow the safe road:
* get the UNZIP utiliy for VMS. It resides on any freeware distribution CD. If you can do so from the VMS box (using SWB/Mozilla) access http://h71000.www7.hp.com/freeware/freeware80/000tools/alpha_images/ for Alpha, http://h71000.www7.hp.com/freeware/freeware80/000tools/ia64_images/ for Itanium and http://h71000.www7.hp.com/freeware/freeware80/000tools/vax_images/ for VAX and download the executable straight where you want it to be.
Otherwise, download it to another system and FTP (binary) the exe to VMS, again, this may work (since .EXE is simply a stream of bytes and does not hold strcutural information.
* $ UNZIP :== $UNZIP.EXE where is deice:[directry] where UNZIP is located.
* unzip . It will unzip the content to the current directory (unless you specify -d . See $ UNZIP (without anything else) that should give you a list if options.

HTH

WG
Willem Grooters
OpenVMS Developer & System Manager
Jess Goodman
Esteemed Contributor

Re: how to see each process handle %time in cpu

Edward,

If you still can't download the attachment email me at mylastname@mycompany.com.

If you have a Fortran compiler I can just email you the source files. Or I can FTP the .ZIP file to you if you have an FTP server - let me know the address and account info. If neither of the above I'll set up a temporary account for you here so you can FTP to me and pull down the file.

Jess Goodman
AccuWeather, Inc.
I have one, but it's personal.
edward wang_1
Frequent Advisor

Re: how to see each process handle %time in cpu

Hi jess

I have send mail for you, but rejected, so you can send mail for me first. email address:13311129195@m165.com
thanks.
BTW: I haven't Fortran complier.
Hein van den Heuvel
Honored Contributor

Re: how to see each process handle %time in cpu

Jess/Edward,

With OpenVMS 8.3 (8.2?) JPIDEF defines itemcodes for KRNLTIM, EXECTIM, SUPRTIM and USERTIM (no IDLETIM :-) :-).

Using those might be a nice addition to your tool towards a unix like usr/sys cpu used.

Hein.