Description of field names of process table needed (46 Views)
Reply
Honored Contributor
Ralph Grothe
Posts: 2,631
Registered: ‎04-09-2000
Message 1 of 2 (46 Views)

Description of field names of process table needed

[ Edited ]

Hi system gurus, C hackers et al.,

I want to stat the process table of our HP-UX 11.00 boxes.

To this end one would usually use the Unix command "ps".
Unfortunately not even the output but also the invocation differs from one Unix vendor to another (e.g. SysV vs. BSD).

As I have to look after various Unix breeds (e.g. HP-UX, AIX, Solaris, Irix, Linux) I was looking for a common interface, and was happy to find on CPAN the module Proc::ProcessTable.

Unfortunately the POD of this module is annoyingly terse, and all it says about the fields is that they depend on the underlying Unix version.

I need an explanation of those field names to be able to interpret the stats.
I already read the ps manpage several times, but the fields mentioned there are just a fraction of those supported by Proc::ProcessTable, and those mentioned slightly differ in their names.

Maybe these explanations can be found in the relevant C header files, but since I'm not (real) a C hacker I don't quite no which to look up (maybe <unistd.h>?)

I also haven't looked at the implementation of Proc::ProcessTable yet (because I fear to get lost in the C-lib function calls)

So I guess there are a few C hackers visiting this forum who surely can tell me what is hidden in these fields.

Here is the dump of the fields method call from Proc::ProcessTable:

$ perl -MProc::ProcessTable -e 'map {print "$_\n"} sort Proc::ProcessTable->new->fields'
addr
cdir
cmd
cpticks
cptickstotal
cpu
dsize
egid
euid
flag
fname
fss
gid
highestfd
interruptcycles
ioch
iosize
lwpid
majorfaults
maxrss
minorfaults
mmsize
msgrcv
msgsnd
nice
nsignals
nswap
pctcpu
pgrp
pid
ppid
pri
procnum
rdir
rssize
schedpolicy
shmsize
sid
ssize
start
state
stime
suid
systemcycles
text
ticksleft
time
tsize
ttynum
ucomm
uid
uid
usercycles
usize
utime
vdsize
viosize
vmmsize
vshmsize
vssize
vtsize
vusize
wchan

N.b. I can of course unravel many of the fields by their mnemonic names (e.g. uid, gid etc are obvious)
What I'm curious about are the many subtle differences between the various *size fields, as I believe that these may bear some performance relevant info.

TIA
Ralph

 

 

P.S.This thread has been moved from HP-UX>System Administration to HP-UX > languages- HP Forums Moderator

Madness, thy name is system administration
Please use plain text.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 2 (46 Views)

Re: Description of field names of process table needed

Hi Ralph:

A key header file you might want to look at is '/usr/include/sys/pstat.h'. Take a look too at the pstat() interface.

You might find some use in using 'ps' with the UNIX95 option armed. The "classic" example from this forum is the one to rank a process list by the largest memory user:

# UNIX95= ps -e -o "user,vsz,pid,ppid,args"|sort -rnk2|more

The point here is that you can create your own custom output when the UNIX95 variable is set. Note the blank after the UNIX95 variable before the 'ps'. Thus the variable is set only for the duration of the command line.

Regards!

...JRF...
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation