home *** CD-ROM | disk | FTP | other *** search
- Cputt - CPU Top Ten monitor for SUNOS 4.1.1
- ===========================================
-
- DISCLAIMER:
-
- This software has no warranty whatsoever, explicit or implicit.
- The author and his employer shall not be held responsible for any
- damage, direct or indirect, resulting from the use of this
- software. That being said, feel free to use it, its a useful
- little utility.
-
- PURPOSE:
-
- Cputt is a cpu monitoring utility which gives you a continuous
- update of the top ten cpu-using processes on your system.
-
- IMPLEMENTATION:
-
- Cputt takes two snapshots of the kernel process table, sleeping
- for a user supplied number of seconds in between the two
- snapshots. It calculates cpu usage for each process over that
- interval and prints out the results. Execution continues for a
- user supplied number of iterations.
-
- USAGE:
-
- Cputt should be invoked with two arguments as follows:
-
- cputt <length of interval> <number of iterations>
-
- Cputt prints a sorted list of cpu intensive processes as follows:
-
- PID USER CPU MEM COMMANDS <active processes> <ptable size>
-
- INSTALLATION:
-
- Cputt should compile on any system running SUNOS 4.1.1. Check
- the #define values in cputt.h before compiling. The only one
- you need to change is MAXUSERS which should be two times the
- number of /etc/passwd entries on your machine. Just type
- 'make' to compile, 'make install' to install. You must be root
- to install Cputt. The default destination is /usr/etc.
-
- SUGGESTION:
-
- Cputt becomes more and more processor intensive as the length of the
- interval between process table lookups decreases. Thus a first
- arguement of less than 5 is probably not real useful. I usually
- invoke it with one of the following:
-
- cputt 5 100 - for short term monitoring of cpu usage
- cputt 10 1000 - for long term monitoring of cpu usage
-
- ACKNOWLEDGEMENTS:
-
- The idea for Cputt came from Larry Schuler, a friend and co-worker.
- The implementation for Cputt was largely dependent on J. Robert Ward's
- 'sps' utility. I used Robert's source code to learn how to make the
- appropriate system calls for interrogating the kernel process table.
- The rest of the alogorithm and implementation are my own.
-
- IMPROVEMENTS:
-
- I've used all the shortcuts I know to make Cputt as trim as possible.
- Floating point arithmetic is kept to a bare minimum. Internal data
- structures are allocated dynamically based on the changing status of
- the process table. Command arguements for each process are kept in
- core instead of being re-evaluated at each iteration. The sort table
- contains only active processes and no extraneous information. The
- kernel reads account for the bulk of Cputt's processing overhead and
- I'm unaware of anyway to alleviate this cost. If anyone has any well
- considered suggestions about how I can improve the implemenation and
- performance of Cputt, I would like to hear them.
-
- COPYRIGHT:
-
- Feel free to distribute Cputt to any interested parties. Please
- provide a copy of this README with any distribution.
-
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- Greg Vesper Code 520.9
- Goddard Space Flight Center
- vesper@kong.gsfc.nasa.gov
- Greenbelt, Maryland
-
- "As He died to make men holy, let us live to make men free.
- While God is marching on.."
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-