xref: /netbsd-src/external/bsd/top/dist/README (revision 10dd2532a5fc0a73e461275cb9fca28fc3013d32)
1*10dd2532Schristos                             TOP
2*10dd2532Schristos                       Version 3.8beta1
3*10dd2532Schristos
4*10dd2532Schristos                       William LeFebvre
5*10dd2532Schristos		     and a cast of dozens
6*10dd2532Schristos
7*10dd2532Schristos
8*10dd2532SchristosIf you do not want to read this entire file, then at least read
9*10dd2532Schristosthe section at the end entitled "KNOWN PROBLEMS".
10*10dd2532Schristos
11*10dd2532SchristosIf you are having any problems getting top to work, please read the
12*10dd2532Schristosfile "FAQ" *before* contacting me.  Thank you.
13*10dd2532Schristos
14*10dd2532Schristos"top" is a program that will give continual reports about the state of
15*10dd2532Schristosthe system, including a list of the top cpu using processes.  Version 3
16*10dd2532Schristosof "top" has three primary design goals: provide an accurate snapshot of
17*10dd2532Schristosthe system and process state, not be one of the top processes itself, be
18*10dd2532Schristosas portable as possible.
19*10dd2532Schristos
20*10dd2532SchristosVersion 3 has many bug fixes from version 2.5, and it has also been
21*10dd2532Schristosreorganized in a major way to make it easy to port to other platforms.
22*10dd2532SchristosAll system dependent code is now contained in one file.
23*10dd2532Schristos
24*10dd2532SchristosStarting with version 3.6, top includes a "configure" script generated
25*10dd2532Schristosby Gnu's autoconf.  This script MUST be run before attempting to
26*10dd2532Schristoscompile top.  It will explore the system and generate approriate
27*10dd2532Schristoscontents for Makefile, config.h, and top.1.
28*10dd2532Schristos
29*10dd2532SchristosOn some systems, top requires read access to the memory files
30*10dd2532Schristos"/dev/kmem" and "/dev/mem" as well as the system's kernel image.  Most
31*10dd2532Schristosinstallations have these files protected from general access.  These
32*10dd2532Schristossites would have to install this program in the same way that programs
33*10dd2532Schristossuch as "ps" are installed.  On most systems with a /proc file system,
34*10dd2532Schristostop will try to read everything it can from /proc, but may need extra
35*10dd2532Schristospermissions to do so.  The configure script will determine the
36*10dd2532Schristospermissions needed by the top binary, and a "make install" as root
37*10dd2532Schristoswill get the binary installed correctly.  Sometimes this requires that
38*10dd2532Schristosthe binary be installed with set-group-id privileges and, in rare
39*10dd2532Schristoscases, set-user-id to root.
40*10dd2532Schristos
41*10dd2532SchristosCAVEAT: version 3 of top has internal commands that kill and renice
42*10dd2532Schristosprocesses.  Although I have taken steps to insure that top makes
43*10dd2532Schristosappropriate checks with these commands, I cannot guarantee that these
44*10dd2532Schristosinternal commands are totally secure.  IF YOU INSTALL top SET-USER-ID
45*10dd2532SchristosTO ROOT, YOU DO SO AT YOUR OWN RISK!  I realize that some operating
46*10dd2532Schristossystems will require top to run setuid root, and I will do everything
47*10dd2532SchristosI can to make sure that top is a secure setuid program.
48*10dd2532Schristos
49*10dd2532SchristosSystem support now takes the form of "modules".  Adding support for a
50*10dd2532Schristosdifferent architecture requires only adding a module.  These modules
51*10dd2532Schristosare contained in the subdirectory "machine".  The "configure" script
52*10dd2532Schristosautomatically determines which module is approproate.  However, it may
53*10dd2532Schristosnot be able to determine what the correct module is.  This can happen
54*10dd2532Schristoseither because it doesn't know about the system or there is no module
55*10dd2532Schristosto support the system.  In the former case, if you know which module
56*10dd2532Schristosto use, you can force "configure" to choose a particular module with
57*10dd2532Schristosthe option "--with-module".  For example, if you want to force the use
58*10dd2532Schristosof the svr4 module (which appears as "machine/m_svr4.c") then use
59*10dd2532Schristos"configure --with-module=svr4" to generate the correct Makefile.  See
60*10dd2532Schristosthe file "Porting" for a description of how to write your own module.
61*10dd2532Schristos
62*10dd2532SchristosTo compile and install "top", read the file "INSTALL" and follow the
63*10dd2532Schristosdirections and advice contained therein.
64*10dd2532Schristos
65*10dd2532SchristosIf you make any kind of change to "top" that you feel would be
66*10dd2532Schristosbeneficial to others who use this program, or if you find and fix a bug,
67*10dd2532Schristosplease send me the change.
68*10dd2532Schristos
69*10dd2532SchristosBe sure to read the FAQ enclosed with the distrubution.  It contains
70*10dd2532Schristosanswers to the most commonly asked questions about the configuration,
71*10dd2532Schristosinstallation, and operation of top.
72*10dd2532Schristos
73*10dd2532SchristosCOLOR
74*10dd2532Schristos
75*10dd2532SchristosVersion 3.6 incorporated the idea of using ANSI color sequences to
76*10dd2532Schristosenhance information on the screen.  By default, no color is used.  But
77*10dd2532Schristosyou can configure the use of color through the environment variable
78*10dd2532SchristosTOPCOLORS (or, for compatibility, TOPCOLOURS).  The interface is
79*10dd2532Schristosidentical to the one first implemented by chris@spang.uk.eu.org, but
80*10dd2532Schristosthe implementation is entirely different.  The option -C can be used
81*10dd2532Schristosto diable the feature entirely.
82*10dd2532Schristos
83*10dd2532SchristosAny information at the top of the screen can be enhanced with color.
84*10dd2532SchristosHowever, due to implementation difficulties, the per-process area
85*10dd2532Schristoscannot be color-enhanced.  A complete description of color support can
86*10dd2532Schristosbe found in the man page.  References for ANSI color codes can be
87*10dd2532Schristosfound all over the Internet, but if you want a handy reference, look
88*10dd2532Schristosin color.h.
89*10dd2532Schristos
90*10dd2532Schristos
91*10dd2532SchristosAVAILABILITY
92*10dd2532Schristos
93*10dd2532SchristosNote that top is now a sourceforge project!  Its project name is
94*10dd2532Schristos"unixtop" and you can access its project page here:
95*10dd2532Schristos
96*10dd2532Schristoshttp://sourceforge.net/projects/unixtop
97*10dd2532Schristos
98*10dd2532SchristosOn the project page you can find more information and access the
99*10dd2532Schristosofficial bug and feature request trackers.  If you find a bug,
100*10dd2532Schristoswant to request a feature, or need help, please submit a request
101*10dd2532Schristosto the appropriate tracker on sourceforge.  Thank you.
102*10dd2532Schristos
103*10dd2532SchristosSubversion access is also provided by Sourceforge.  If Subversion is
104*10dd2532Schristosinstalled on your system you can check out the project with the
105*10dd2532Schristosfollowing command:
106*10dd2532Schristos
107*10dd2532Schristos	svn co https://svn.sourceforge.net/svnroot/unixtop unixtop
108*10dd2532Schristos
109*10dd2532SchristosThere is also a web site dedicated to the project, and it is here:
110*10dd2532Schristos
111*10dd2532Schristoshttp://www.unixtop.org
112*10dd2532Schristos
113*10dd2532SchristosThe latest version of "top" is available as a download through
114*10dd2532Schristossourceforge.  Start here to access the downloadable files:
115*10dd2532Schristos
116*10dd2532Schristoshttp://sourceforge.net/project/showfiles.php?group_id=72892
117*10dd2532Schristos
118*10dd2532Schristos
119*10dd2532SchristosKNOWN PROBLEMS:
120*10dd2532Schristos
121*10dd2532SchristosGnu CC
122*10dd2532Schristos
123*10dd2532SchristosCompiling via Gnu CC continued to be the source of most of the
124*10dd2532Schristosquestions I receive.  By far the most common mistake made by those
125*10dd2532Schristosattempting to compile top with Gnu CC is out of date include files.
126*10dd2532SchristosWhen the operating system is upgraded, the include files that are part
127*10dd2532Schristosof the gcc package MUST also be updated.  Gcc maintains its own
128*10dd2532Schristosinclude files.  Even a minor OS upgrade can involve changes to some of
129*10dd2532Schristosthe kernel's internal data structures, which are defined in include
130*10dd2532Schristosfiles in "sys".  Top is very sensitive to these changes.  If you are
131*10dd2532Schristoscompiling with gcc and experience any sort of strange problems, please
132*10dd2532Schristosmake sure the include files you are using are up to date BEFORE
133*10dd2532Schristossending me a bug report.  Look in the gcc source distribution for the
134*10dd2532Schristosshell script "fixincludes".
135*10dd2532Schristos
136*10dd2532SchristosMacOS X
137*10dd2532Schristos
138*10dd2532SchristosSince I don't have full time root access to a MacOS X system I cannot
139*10dd2532Schristosprovide effective support for the platform.  MacOS X uses Mach, and it
140*10dd2532Schristosis very difficult to extract accurate system and process information
141*10dd2532Schristosfrom the system.  It takes a lot of trial and error, along with root
142*10dd2532Schristosaccess.  I have included the most up-to-date version of the macosx module
143*10dd2532Schristosin the distribution, but I do not claim that it works.  If you want to
144*10dd2532Schristostry to use it, you can configure with "./configure --with-module=macosx".
145*10dd2532Schristos
146*10dd2532SchristosHP/UX 10.10
147*10dd2532Schristos
148*10dd2532SchristosIn their infinite wisdom, the folks at HP have decided that mere mortals
149*10dd2532Schristossuch as you and I don't need to know what the kernel's proc structure looks
150*10dd2532Schristoslike.  To that end, they have removed all useful content from the include
151*10dd2532Schristosfile <sys/proc.h> in version 10.10.  As a result, top will not compile
152*10dd2532Schristosunder 10.10.  What HP is trying to accomplish with this move is to force
153*10dd2532Schristosiconoclasts such as myself to use "pstat" for collecting all process
154*10dd2532Schristosinformation.  I have no immediate solution for this problem, but hope to
155*10dd2532Schristosobtain a sufficiently complete definition of "struct proc" at some point in
156*10dd2532Schristosthe near future.  Stay tuned.
157*10dd2532Schristos
158*10dd2532Schristos
159*10dd2532SchristosGRATITUDE
160*10dd2532Schristos
161*10dd2532SchristosMy perpetual thanks to all the people who have helped me support top
162*10dd2532Schristoson so many platforms.  Without these people, top would not be what it
163*10dd2532Schristosis.  Here is a partial list of contributors and other individuals.
164*10dd2532Schristos
165*10dd2532Schristos	Robert Boucher, Marc Cohen, David Cutter, Casper Dik,
166*10dd2532Schristos	Charles Hedrick, Andrew Herbert, Jeff Janvrin, Torsten Kasch,
167*10dd2532Schristos	Petri Kutvonen, William L. Jones, Tim Pugh, Steve Scherf,
168*10dd2532Schristos	Phillip Wu
169*10dd2532Schristos
170*10dd2532Schristos(My apologies if I missed anyone.)
171*10dd2532Schristos
172*10dd2532Schristos
173*10dd2532SchristosLICENSE
174*10dd2532Schristos
175*10dd2532SchristosTop is distributed free of charge under the same terms as the BSD
176*10dd2532Schristoslicense.  For an official statement, please refer to the file "LICENSE"
177*10dd2532Schristoswhich should be included with the source distribution.
178*10dd2532Schristos
179*10dd2532Schristos
180*10dd2532SchristosAUTHOR
181*10dd2532Schristos
182*10dd2532SchristosIf you wish to contact me, please send a message to the sourceforge
183*10dd2532Schristosusername "wnl".
184*10dd2532Schristos
185*10dd2532Schristos		William LeFebvre
186*10dd2532Schristos
187*10dd2532Schristos		U.S. Mail address:
188*10dd2532Schristos		    William LeFebvre
189*10dd2532Schristos		    11585 Jones Bridge Road
190*10dd2532Schristos		    Suite 420 PMB 139
191*10dd2532Schristos		    Alpharetta, GA  30202
192