Subject: new kmem-ps suite for Linux 0.99.14
From: [email-masked] (Rick Sladkey)
Date: 1 Dec 1993 00:41:47 +0200
Newsgroups: comp.os.linux.announce

I have uploaded a new version of the kmem-ps suite of programs updated
for Linux 0.99.14 to sunsite.  The name of the file is:

sunsite.unc.edu:/pub/Linux/Incoming/kmem-ps-0.99.14.tar.gz

Here is the NEWS file.
-----
This is the kmem-ps suite of programs updated for Linux 0.99.14.
The programs included are: ps, fstat, fuser, free, memmap, tload,
top, w, uptime, clrprof, and kprof.  Branko Lankester wrote almost
all of the programs.  I am making this interim release with his
permission.

You should probably be using the proc-ps suite instead because the
procfs support code is updated automatically with each new kernel
release.  When you use kmem-ps, there is a good chance it will need
a minor update when a new kernel is released.

Here is a short feature comparison:

feature           kmem-ps       proc-ps
-------           -------       -------
speed             fast          slow
elegance          weak          strong
convenience       poor          excellent
kernel bloat      none          some

However, if you (like me) are irrationally attracted to the kmem-ps,
then this package is for you.

In addition to the minor updating needed for Linux 0.99.14 (about 10 lines
of code), I added two major new features and made some other minor changes.

* I have "bitten the bullet" and extended the tty fields to 7 characters
wide.  Now tty names are printed in their entirety and they are computed
dynamically instead of being compiled into ps.  This means if you want
to call your serial ports /dev/tty00, etc., ps will use that name.  It
also means that ttys don't need to be named /dev/ttyXX and /dev/console
is no longer magic.  The only down-side is that room for the command line
has been reduced by 5 characters.

* I added a new tree-like output format using the option `f' (for forest).
For example, here is the output of `ps fx' as I write this.

  PID TTY     STAT  TIME COMMAND
   59 tty1    Is    0:00 -bash (bash)
   71 tty1    I+    0:03  \_ kermit
  308 tty1    I+    0:03      \_ kermit
   60 tty2    Is    0:03 -bash (bash)
  296 tty2    T     0:02  \_ vile ps.1
  305 tty2    S+    0:57  \_ vile NEWS
  313 tty2    R+    0:00      \_ ps fx
  314 tty2    Z+    0:00      \_ <defunct>
   61 tty3    Is+   0:00 -bash (bash)
   77 tty2    I     0:00 xinit /home/jrs/.xinitrc --
   79 ?       I     0:49  \_ X :0
   81 tty2    I     0:00  \_ sh /home/jrs/.xinitrc
   86 tty2    I     0:04      \_ olvwm
   99 tty2    I     0:00          \_ xterm -name XTerm2 -geometry 80x32
  100 ttyp1   Is+   0:00          |   \_ bash
  121 tty2    I     0:00          \_ xterm -name XTerm3 -geometry 80x32
  122 ttyp2   Is+   0:00              \_ bash
   98 ?       I     0:36 emacs

The new option works with any of the other output formats as well.
The sorting presents an interesting programming problem.  My method
of assembling the processes into a forest of trees uses an efficient
O(n log n) algorithm.  I experimented with several presentation
formats and stumbled across this one.  I think it conveys a great
deal of extra information with a minimum of clutter.

Other new features:

* The package now conforms to the draft filesystem standards.  For example,
the program `ps' now goes in `/bin' and most of the others go in `/usr/bin'.

* I changed the presentation of `top' quite a bit.  I think you'll like it.

* I added a quick help summary for all those inscrutable options with `ps H'.

usage: ps 0acefhHjlmnprsStuUvwxXy [t tty] [pid[,pid]...]

j -- job control format, l -- long format, m -- memory format,
s -- signal format, u -- user format, v -- virtual memory format,
X -- register format, y -- syscall format, default -- short format

0 -- include task zero, a -- include processes for all users
c -- print only command name, e -- show env vars, f -- print forest of procs
h -- suppress the header, n -- print the user and wchan fields numerically
p -- print counts in pages, r -- restrict listing to runnable processes
S -- summarize usage for children in CPU time and page fault fields
t tty -- show all proccesses with TTY as their controlling terminal
w -- wide: 132, ww -- 264, www -- unlimited, default -- screen width or 80
x -- include processes without a controlling terminal
U [SYSTEM-PATH [SWAP-PATH]] -- update ps database

STATUS key: R -- running, S -- sleeping, I -- idle, D -- uninterruptible,
Z -- zombie, T -- stopped, P -- paging, W -- swapped out, < -- high priority,
N -- niced, X -- debugged, x -- traced, s -- session leader, + -- foreground

SIGNAL key: P -- pending, B -- blocked, I -- ignored, C -- caught

* I am experimenting with a new signal format that looks like:

                                     V      
                                     T W    
              Q T   KUSUPAT CCSTTT XXAPI    
            HIUIRIBFISESILE HOTSTT CFLRN P  
            UNILAOUPLRGRPRR LNOTIOIPSROC W  
            PTTLPTSEL1V2EMM DTPPNUOUZMFH R  
  UID   PID 12345678901234567890123456789012 STAT  TTY       TIME COMMAND
    0    79 CC.C. .C.CC I C . . II.CC . . .  I     ?         0:49 X :0

This makes it a lot easier to see which signals are which.

* Several minor bug fixes.

Rick Sladkey <[email-masked]>

--
Mail submissions for comp.os.linux.announce to: [email-masked]
PLEASE remember Keywords: and a short description of the software.