FAQ revision 1.1 1 1.1 christos TOP
2 1.1 christos Version 3.8beta1
3 1.1 christos
4 1.1 christos William LeFebvre
5 1.1 christos with much help from others
6 1.1 christos
7 1.1 christos Frequently Asked Questions and their Answers
8 1.1 christos
9 1.1 christos
10 1.1 christos
11 1.1 christos GENERAL
12 1.1 christos
13 1.1 christos 1. What is top?
14 1.1 christos
15 1.1 christos Top provies the user with a regularly updated display showing
16 1.1 christos information about the system and its top cpu-using processes. Think
17 1.1 christos of it as a full-screen "ps" output that gets updated at regular
18 1.1 christos intervals.
19 1.1 christos
20 1.1 christos 2. Where do I get the latest version of top?
21 1.1 christos
22 1.1 christos The official site for top is "ftp.unixtop.org" in the directory
23 1.1 christos "/pub/top". Top is also a SourceForge project, and the most recent
24 1.1 christos releases are available on any of the SourceForge mirrors. The
25 1.1 christos SourceForge project page is at
26 1.1 christos http://sourceforge.net/projects/unixtop.
27 1.1 christos
28 1.1 christos 3. Is there a web page for top?
29 1.1 christos
30 1.1 christos Yes. Point your browser at http://www.unixtop.org. It includes all
31 1.1 christos documentation, a nice interactive display which describes the various
32 1.1 christos components of the output of top, web-based retrieval of the package,
33 1.1 christos year 2000 information, and other neat stuff.
34 1.1 christos
35 1.1 christos 4. Is there a mailing list or on-line bulletin board for top?
36 1.1 christos
37 1.1 christos There is a mailing list used for general announcements regarding top,
38 1.1 christos including new releases. This mailing list is available to sourceforge
39 1.1 christos members and can be accessed from the unixtop sourceforge project
40 1.1 christos page. Visit SourceForge and search for the project "unixtop", then
41 1.1 christos click on "mailing lists". There are also on-line forums available
42 1.1 christos through SourceForge where members can post questions and comments.
43 1.1 christos
44 1.1 christos 5. What about Year 2000 compliance?
45 1.1 christos
46 1.1 christos Top did not experience any problems with the transition to the year
47 1.1 christos 2000. A full statement concerning top and the year 2000 can be found
48 1.1 christos in the file "Y2K" included with the distribution.
49 1.1 christos
50 1.1 christos 6. Will there be another major release of top? Will there be a top
51 1.1 christos version 4?
52 1.1 christos
53 1.1 christos I have some great ideas for the next major release of top, and I very
54 1.1 christos much want to make those ideas a reality. What I don't have much of
55 1.1 christos these days is free time. But I will keep poking at it and I hope to
56 1.1 christos have top version 4.0 ready by the fall of 2006.
57 1.1 christos
58 1.1 christos 7. Does top really support multi-processor systems?
59 1.1 christos
60 1.1 christos On platforms that support multiple processors, top is able to detect
61 1.1 christos and correctly summarize the information about those processors. What
62 1.1 christos top does not do is break down the cpu states summary (the third line
63 1.1 christos of the display) by cpu. Instead it collects the cpu state information
64 1.1 christos from all processors and combines them in to a single line. Some
65 1.1 christos vendors include a modified version of top that presents this
66 1.1 christos information for each cpu. Top 3.7 may have this functionality but it
67 1.1 christos is not present in the standard top 3.6 release.
68 1.1 christos
69 1.1 christos 8. Is top under CVS control? Can I access the sources via SourceForge
70 1.1 christos CVS or Subversion?
71 1.1 christos
72 1.1 christos I maintain top using subversion, not CVS. Although I utilize my own
73 1.1 christos private subversion repository, it is regularly mirrored in to the
74 1.1 christos SourceForge Subversion repository. You can access the SourceForge
75 1.1 christos repository here: https://svn.unixtop.org/unixtop/top-3.
76 1.1 christos
77 1.1 christos
78 1.1 christos COMPILING
79 1.1 christos
80 1.1 christos 9. We just upgraded our operating system to a new version and top broke.
81 1.1 christos What should we do?
82 1.1 christos
83 1.1 christos Recompile it. Top is very sensitive to changes in internal kernel
84 1.1 christos data structures. It is not uncommon for a new version of the
85 1.1 christos operating system to include changes to kernel data structures.
86 1.1 christos
87 1.1 christos
88 1.1 christos RUNNING
89 1.1 christos
90 1.1 christos 10. I just finished compiling top and it works fine for root, but when I
91 1.1 christos try to run it as a regular user it either complains about files it
92 1.1 christos can't open or it doesn't display all the information it should. Did I
93 1.1 christos do something wrong?
94 1.1 christos
95 1.1 christos Well, you're just not done. On many operating systems today, access
96 1.1 christos to many of the kernel memory devices and other system files is
97 1.1 christos restricted to either root or a particular group. The configure script
98 1.1 christos figures this out (usually) and makes sure that the "install" rule in
99 1.1 christos the Makefile will install top so that anyone can run it successfully.
100 1.1 christos However, you have to *install* it first. Do this with the command
101 1.1 christos "make install".
102 1.1 christos
103 1.1 christos 11. Top is (not) displaying idle processes and I don't (do) want it to.
104 1.1 christos
105 1.1 christos This default has only changed about a dozen times, and I finally got
106 1.1 christos tired of people whining about it. Go read the manual page for the
107 1.1 christos current version and pay special attention to the description of the
108 1.1 christos "TOP" environment variable.
109 1.1 christos
110 1.1 christos 12. We have so much memory in our machine that the memory status display
111 1.1 christos (the fourth line) ends up being longer than 80 characters. This
112 1.1 christos completely messes up top's output. Is there a patch?
113 1.1 christos
114 1.1 christos Most modules have been changed to use new memory formatting functions
115 1.1 christos which will display large values in terms of megabytes instead of
116 1.1 christos kilobytes. This should fix all occurences of this problem. Also note
117 1.1 christos that newer versions of top can use columns beyond 79, and understand
118 1.1 christos window resizes. So you can always make your window wider.
119 1.1 christos
120 1.1 christos 13. I tried to compile top with gcc and it doesn't work. I get
121 1.1 christos compilation errors in the include files, or I get an executable that
122 1.1 christos dumps core, or top displays incorrect numbers in some of the
123 1.1 christos displays. What's wrong?
124 1.1 christos
125 1.1 christos Gnu CC likes very much to use its own include files. Not being a gcc
126 1.1 christos expert, I can't explain why it does this. But I can tell you that if
127 1.1 christos you upgrade your operating system (say from Solaris 2.6 to Solaris
128 1.1 christos 2.7) after installing gcc, then the include files that gcc uses will
129 1.1 christos be incorrect, especially those found in the "sys" directory. Your
130 1.1 christos choices are: (1) rebuild and reinstall the "standard" include files
131 1.1 christos for gcc (look for scripts in the distribution called "fixincludes"
132 1.1 christos and "fixinc.svr4"), (2) compile machine.c with
133 1.1 christos "CFLAGS=-I/usr/include" then make the rest of the object files
134 1.1 christos normally, or (3) use a different compiler.
135 1.1 christos
136 1.1 christos 14. The cpu state percentages are all wrong, indicating that my machine
137 1.1 christos is using 95% system time when it is clearly idle. What's wrong?
138 1.1 christos
139 1.1 christos This can happen if you compiled with gcc using the wrong include
140 1.1 christos files. See the previous question.
141 1.1 christos
142 1.1 christos
143 1.1 christos FREEBSD PROBLEMS
144 1.1 christos
145 1.1 christos 15. This version of top does not show individual threads with the "t" or
146 1.1 christos "H" commands. Instead it says "command not available." Why?
147 1.1 christos
148 1.1 christos Previous versions of top attempted to support the display of
149 1.1 christos individual threads under FreeBSD through the use of the "t" command.
150 1.1 christos However, the FreeBSD kernel does not supply sufficient or correct
151 1.1 christos information on the individual threads within a process. So the data
152 1.1 christos that was being displayed was incorrect and misleading. Therefore, top
153 1.1 christos version 3.8 disables the use of this command to prevent the display
154 1.1 christos of incorrect information. FreeBSD 8.0 will correctly report
155 1.1 christos per-thread information and top version 3.8 supports the use of the
156 1.1 christos "t" command for version 8.0.
157 1.1 christos
158 1.1 christos 16. The "f" command (to display full command lines for the processes)
159 1.1 christos does not work and instead says "command not available". Why?
160 1.1 christos
161 1.1 christos The current version of top is able to use sysctl to retrieve almost
162 1.1 christos all of the information it needs without having to open /dev/kmem. The
163 1.1 christos one piece of information not available via sysctl is the full command
164 1.1 christos line of each argument. If you run top as a regular user and it cannot
165 1.1 christos open /dev/kmem (in other words, it is not installed set-gid to the
166 1.1 christos kmem group) then it will disable the "f" command. Make sure the top
167 1.1 christos binary is installed with a group ownership of "kmem" and with the
168 1.1 christos set-gid bit on if you want the "f" command to work properly.
169 1.1 christos
170 1.1 christos
171 1.1 christos MACOSX PROBLEMS
172 1.1 christos
173 1.1 christos 17. I tried to configure top on my Mac OSX system and I got an error
174 1.1 christos claiming "macosx not supported". What up?
175 1.1 christos
176 1.1 christos Since I don't have full time root access to a Mac OSX system I cannot
177 1.1 christos provide effective support for the platform. MacOSX uses Mach, and it
178 1.1 christos is very difficult to extract accurate system and process information
179 1.1 christos from the system. It takes a lot of trial and error, along with root
180 1.1 christos access. I have included the most up-to-date version of the macosx
181 1.1 christos module in the distribution, but I do not claim that it works. If you
182 1.1 christos want to try to use it, you can configure with "./configure
183 1.1 christos --with-module=macosx".
184 1.1 christos
185 1.1 christos
186 1.1 christos SUNOS PROBLEMS
187 1.1 christos
188 1.1 christos 18. I tried compiling top under SunOS version 4.1.x and it got compile
189 1.1 christos time errors or run time errors. Is there a patch?
190 1.1 christos
191 1.1 christos If you try compiling top in a "System V environment" under SunOS
192 1.1 christos (that is, /usr/5bin is before /usr/bin on your path) then the
193 1.1 christos compilation may fail. This is mostly due to the fact that top thinks
194 1.1 christos its being compiled on a System V machine when it really isn't. The
195 1.1 christos only solution is to put /usr/bin and /usr/ucb before /usr/5bin on
196 1.1 christos your path and try again.
197 1.1 christos
198 1.1 christos
199 1.1 christos SOLARIS PROBLEMS
200 1.1 christos
201 1.1 christos
202 1.1 christos NOTE: the most common source of problems with top under Solaris is
203 1.1 christos the result of compiling it with the wrong front end. Make sure that
204 1.1 christos /usr/ucb is not on your path before attempting to compile top under
205 1.1 christos Solaris.
206 1.1 christos
207 1.1 christos 19. Is there somewhere I can get a pre-compiled package?
208 1.1 christos
209 1.1 christos Yes. Although I don't provide pre-compiled binaries, you can get a
210 1.1 christos Sun-style package from www.sunfreeware.com.
211 1.1 christos
212 1.1 christos 20. Under Solaris 2, when I type "make", the system says "language
213 1.1 christos optional software package not installed." What's going on?
214 1.1 christos
215 1.1 christos You tried to compile with /usr/ucb/cc. Make sure /usr/ucb is not on
216 1.1 christos your path. Furthermore, you do not have a Sun compiler installed on
217 1.1 christos your system. You need a compiler to make top. Either Sun's C compiler
218 1.1 christos or the Gnu C compiler will work fine.
219 1.1 christos
220 1.1 christos 21. Under Solaris 2, when I run top as root it only shows root processes,
221 1.1 christos or it only shows processes with a PID less than 1000. It refuses to
222 1.1 christos show anything else. What do I do?
223 1.1 christos
224 1.1 christos You probably compiled it with /usr/ucb/cc instead of the real C
225 1.1 christos compiler. /usr/ucb/cc is a cc front end that compiles programs in BSD
226 1.1 christos source-level compatability mode. You do not want that. Make sure that
227 1.1 christos /usr/ucb is not on your path and try compiling top again.
228 1.1 christos
229 1.1 christos 22. Under Solaris 2, I compiled top using what I am sure is the correct
230 1.1 christos compiler but when I try to run it it complains about missing dynamic
231 1.1 christos libraries. What is wrong?
232 1.1 christos
233 1.1 christos Check to see if you have LD_LIBRARY_PATH defined in your shell. If
234 1.1 christos you do, make sure that /usr/ucblib is not on the path anywhere. Then
235 1.1 christos try compiling top again.
236 1.1 christos
237 1.1 christos 23. Under Solaris 2, when I try to run top it complains that it can't
238 1.1 christos open the library "libucb.so.1". So I changed the LIBS line in
239 1.1 christos m_sunos5.c to include -R/usr/ucblib to make sure that the dynamic
240 1.1 christos linker will look there when top runs. I figured this was just an
241 1.1 christos oversight. Was I right?
242 1.1 christos
243 1.1 christos No, you were not right. As distributed, top requires no alterations
244 1.1 christos for successful compilation and operations under any release of
245 1.1 christos Solaris 2. You probably compiled top with /usr/ucb/cc instead of the
246 1.1 christos real C compiler. See FAQ 22 for more details.
247 1.1 christos
248 1.1 christos 24. On my 64-bit system some processes show up with incorrect information
249 1.1 christos (such as zero memory).
250 1.1 christos
251 1.1 christos If you are running a 64-bit system, then you need to make sure that
252 1.1 christos you are running the 64-bit top binary. Top's configure script
253 1.1 christos attempts to detect 64-bit systems, and will automatically generate
254 1.1 christos both 32-bit and 64-bit binaries on such systems. If you use or
255 1.1 christos install the 32-bit binary on a 64-bit system top will still run but
256 1.1 christos will not produce the correct results. This will also happen if you
257 1.1 christos configure your distribution on a 32-bit system then compile with that
258 1.1 christos configuration on a 64-bit system. You must configure and compile on
259 1.1 christos the same system. For Sparc systems the 32-bit binary will be created
260 1.1 christos in the subdirectory "sparcv7" and the 64-bit binary will be created
261 1.1 christos in the subdirectory "sparcv9". For Intel systems the directories will
262 1.1 christos be "i386" (32-bit) and "amd64" (64-bit). In all cases a copy of
263 1.1 christos /usr/lib/isaexec is made in the main directory and called "top". This
264 1.1 christos program will choose the correct binary to run from one of these
265 1.1 christos subdirectories. See isaexec(3c) for more details.
266 1.1 christos
267 1.1 christos 25. Can I install both 32-bit and 64-bit binaries on a central file
268 1.1 christos server and have machines which mount it automatically use the correct
269 1.1 christos one?
270 1.1 christos
271 1.1 christos Yes. If you configure and compile on a 64-bit system, top's configure
272 1.1 christos script and makefile will automatically create both 32-bit and 64-bit
273 1.1 christos binaries. The "install" rule in the makefile will install these
274 1.1 christos binaries in subdirectories of /usr/local/bin appropriate to the
275 1.1 christos architecture (sparcv7/sparcv9 or i386/amd64) then create a copy of
276 1.1 christos /usr/lib/isaexec named "top" in /usr/local/bin to ensure that the
277 1.1 christos appropriate is run when a user types "top". If you make sure that you
278 1.1 christos configure and compile on a 64-bit system, then "make install" will do
279 1.1 christos the right thing.
280 1.1 christos
281 1.1 christos 26. This version of top show less available swap space than previous
282 1.1 christos versions. Why does it no longer match the output of the swap summary
283 1.1 christos produced with "swap -s"?
284 1.1 christos
285 1.1 christos Starting with version 3.6 of top, the amount of swap space reported
286 1.1 christos by top has been changed to reflect only disk-based swap space. The
287 1.1 christos swap summary produced with "swap -s" also includes memory-based swap
288 1.1 christos space. This changed was made for several reasons. It makes the
289 1.1 christos display under Solaris more like those of other operating systems. The
290 1.1 christos display is more what users expect (except those used to previous
291 1.1 christos versions of top). Most importantly, "swap -s" gets its data via an
292 1.1 christos undocumented system interface. Now that top no longer displays that
293 1.1 christos data it can use publically documented and maintained system
294 1.1 christos interfaces to retrieve its data.
295 1.1 christos
296 1.1 christos
297 1.1 christos SVR4-DERIVED PROBLEMS
298 1.1 christos
299 1.1 christos 27. When I run top on my SVR4-derived operating system, it displays all
300 1.1 christos the system information at the top but does not display any process
301 1.1 christos information (or only displays process information for my own
302 1.1 christos processes). Yet when I run it as root, everything works fine. What's
303 1.1 christos wrong?
304 1.1 christos
305 1.1 christos Your system probably uses the pseudo file system "/proc", which is by
306 1.1 christos default only accessible by root. Top needs to be installed setuid
307 1.1 christos root on such systems if it is going to function correctly for normal
308 1.1 christos users.
309 1.1 christos
310 1.1 christos
311 1.1 christos SVR42 PROBLEMS
312 1.1 christos
313 1.1 christos 28. The memory display doesn't work right. Why?
314 1.1 christos
315 1.1 christos This is a known bug with the svr42 module. The problem has been
316 1.1 christos traced down to a potential bug in the "mem" driver. The author of the
317 1.1 christos svr42 module is working on a fix.
318 1.1 christos
319 1.1 christos
320 1.1 christos STILL STUCK
321 1.1 christos
322 1.1 christos 29. I'm still stuck. To whom do I report problems with top?
323 1.1 christos
324 1.1 christos The most common problems are caused by top's sensitivity to internal
325 1.1 christos kernel data structures. So make sure that you are using the right
326 1.1 christos include files, and make sure that you test out top on the same
327 1.1 christos machine where you compiled it. Sun's BSD Source Compatability Mode is
328 1.1 christos also a common culprit. Make sure you aren't using either /usr/ucb/cc
329 1.1 christos or any of the libraries in /usr/ucblib. Finally, make sure you are
330 1.1 christos using the correct module. If there does not appear to be one
331 1.1 christos appropriate for your computer, then top probably will not work on
332 1.1 christos your system.
333 1.1 christos
334 1.1 christos If after reading all of this file and checking everything you can you
335 1.1 christos are still stuck, then please use SourceForge to submit a support
336 1.1 christos request or a bug. Top is supported by the SourceForge project named
337 1.1 christos "unixtop". On SourceForge you will find defect tracking, a mailing
338 1.1 christos list, and on-line forums. You can also contact the author through
339 1.1 christos SourceForge.
340 1.1 christos
341