home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / top / README < prev    next >
Text File  |  1992-02-01  |  6KB  |  105 lines

  1. This file contains a few comments about "top", version 2.5
  2.  
  3. "top" is a program that will give continual reports about the state of the
  4. system, including a list of the top cpu using processes.  It requires read
  5. access to the memory files "/dev/kmem" and "/dev/mem" as well as the system
  6. image "/vmunix".  Some installations have these files protected from general
  7. access.  These sites would have to install this program in the same way that
  8. programs such as "ps" are installed.
  9.  
  10. CAVEAT:  version 2 of top has internal commands that kill and renice
  11. processes.  DO NOT INSTALL TOP AS A SETUID PROGRAM, or you will open up a
  12. big security hole since top makes no process ownership checks on its own.
  13. Note that it is still safe to install top as a set group-id program, since
  14. group-id has no bearing on who can renice or send signals to what processes.
  15.  
  16. There are a few things that need to be checked before compiling the program:
  17.  
  18. The most important item is the internal hash table size.  This size is
  19. defined in the program with the preprocessor variable "Table_size".  This
  20. constant MUST be larger than the number of lines in the file /etc/passwd.
  21. It is advisable that this number be about twice the number of lines, and
  22. that it be a prime number (since it dictates the size of the hash table).
  23. Make sure this is checked before compilation.  Its definition exists in
  24. the file "top.local.h", but it is also settable in the Makefile.
  25.  
  26. Several other things are set in "top.local.h", including the file names
  27. used for certain system files ("/vmunix", "/dev/kmem", etc.).  Although I
  28. don't expect those to vary much, they are put there for convenience.
  29. Another parameter in this file is "LoadMax".  This is a rational number
  30. that defines what load average is considered "busy".  When the actual load
  31. is higher than this figure, "top" provides more visual feedback to insure
  32. the user that it is still running.  There is a more detailed explanation of
  33. this in "top.local.h".  Finally, there is the parameter "Nominal_TOPN".
  34. This will be discussed in the next paragraph.
  35.  
  36. There are two preprocessor variables that are defined at compile time by
  37. the makefile.  These are "Default_TOPN" and "Default_DELAY".  Their values
  38. are the defaults used for the top number of processes to be displayed and
  39. the number of seconds to delay between displays, respectively.  They are
  40. set by the Makefile variables "TOPN" and "DELAY", respectively.  These
  41. constants are preset as follows:  TOPN=10, DELAY=5.  These can be
  42. overridden by either changing the Makefile or by specifying the change on
  43. the make command line (with something like "make TOPN=15").  Version 2 of
  44. top understands an "infinite" value for the number of processes to
  45. display.  Such a value indicates that top should display as much as will
  46. fill the screen.  To specify a Default_TOPN of infinity, set TOPN equal
  47. to -1.  Version 2 also understands the difference between an intelligent
  48. terminal and a dumb terminal (such as a hardcopy device or a file).
  49. Typically, a default of infinity would not be desirable on a dumb
  50. terminal, so the value of "Nominal_TOPN" is used when (1) Default_TOPN is
  51. infinity and (2) the output device is a dumb terminal or a file.  The
  52. value for this preprocessor variable is set in "top.local.h" and can also
  53. be set from the "make" command line.  In the distribution, it is set to 18.
  54.  
  55. By default, the makefile will make a "top" for one of the following
  56. systems:  Berkeley 4.2, Sun Unix (versions 1.1 through 3.x), Pyramid Unix,
  57. Unix on a Symmetrics machine.  With a small change, the makefile can also
  58. make a top that will run on Sun Unix version 4.0 and higher.  Note that
  59. information about virtual memory usage is not readily available under 4.0,
  60. thus it will not show up on the display.  Version 1 of top fully supported
  61. Berkeley 4.1 Unix.  This support has waned in version 2, and is not
  62. guaranteed to even work.  If you really must give it a try, you can change
  63. the makefile variable "CFLAGS" to make a 4.1 "top".  Instructions for
  64. doing this can be found in "Makefile".
  65.  
  66. The file "bzero.c" contains a function that will zero a block of memory on
  67. a VAX.  This is only needed for Berkeley 4.1, since 4.2 has a bzero
  68. defined in the C run time library.  If you are strange enough to be
  69. running 4.1 on something besides a VAX, you will have to replace this
  70. routine with one that will work on your machine.  If you don't know a
  71. quick way to do it, then writing a simple loop will suffice.  "Bzero"
  72. takes two arguments:  a pointer to the buffer to zero, and the number of
  73. bytes to zero.
  74.  
  75. There are also several parameters in the makefile that control
  76. installation.  These should be altered to suit the desires and needs of
  77. individual sites.
  78.  
  79. Version 2 now supports standard 4.2 and Sun, Pyramid, and Symmetrics
  80. architectures.  I attempted to add sufficient changes to make top work on
  81. a Masscomp, but found the number of required changes to be overwhelming.
  82. Feel free to alter top to make it run on whatever funny architecture you
  83. have.  I also encourage you to send those changes back to me at the
  84. address below.  But, if the number of changes is high, I will be reluctant
  85. to include the changes in the next version of top.  As an example, there
  86. were only 10 modifications required for the Sun version (and all changes
  87. were trivial), and just 4 changes were needed for the Pyramid.
  88.  
  89. If you make any kind of change to "top" that you feel would be beneficial
  90. to others who use this program, or if you find and fix a bug, please send
  91. me the change.
  92.  
  93. Enjoy!
  94.  
  95.                                 William LeFebvre
  96.                 Department of Computer Science
  97.                 Rice University
  98.                                 ARPANet address: <phil@Rice.edu>
  99.  
  100.                 U.S. Mail address:
  101.                     William LeFebvre
  102.                     P.O. Box 1892
  103.                     Department of Computer Science
  104.                     Houston, TX  77251
  105.