Changes revision 24139
1Thu Aug 29 1996 - wnl (3.4) 2 Replaced modules (from Tim Pugh): next 32, next40. 3 Fixed bug in username.c: hashing negative uids. 4 5Thu Aug 22 1996 - wnl (3.4beta3) 6 Patched modules: ultrix4, sunos4, sunos5, utek, decosf1, irix5. 7 Added modules: next40, next32. 8 Fixed procstates update bug in display.c. 9 Fixed divide by zero bug in utils.c. 10 Fixed bad number in layout.h 11 Minor fixes to Configure. 12 Complete overhaul of FAQ. 13 14Tue Feb 13 1996 - wnl (3.4beta3) 15 Added convex module from Warren Vosper (originally written by 16 William Jones). 17 18Tue Feb 13 1996 - wnl (3.4beta2) 19 Fixed format_k in utils.c to calculate K and M values correctly. 20 Added check for gigabyte values ('G'). Changed sumamry_format 21 in display.c to use format_k where appropriate. 22 Changed creation of distribution tar file to place everything in 23 a top level directory. 24 25Tue Jan 30 1996 - wnl (3.4beta2) 26 Added m_aix41 module. Added new tag type to module comments: 27 TERMCAP, which defined the library to use for a termcap library. 28 If no TERMCAP tag is found in the module's initial comment, then 29 Configure will default to "-ltermcap". AIX needs this since it 30 put all the termcap routines in libcurses(!) 31 32 Added m_bsdos2 (found lingering in my mailbox). 33 Updated m_svr4 to include support for NCR multiprocessors. 34 Fixed small bug in utils.c 35 36Thu Jan 25 1996 - wnl (3.4beta1) 37 Fixed m_sunos5 invocation of gettimeofday to include "NULL" as 38 second argument. This provides compatability with the Posix- 39 compliant template provided with SunOS 5.5, but doesn't hurt 40 previous versions since they do bother with a template for that 41 function. 42 43 Made changes (recommended by net users) to hpux10, ultrix4, 44 netbsd10, aux3 (replaced aux31). Added module for linux. 45 46Fri Oct 10 1995 - wnl (3.4beta1) 47 Added user-contributed modules for SCO Unix, IRIX 5, HP/UX 10, 48 Pyramid DC/OSX. Changed Configure so that it runs in environments 49 whose c-shells have no 'eval'(!). Added support for multiple sort 50 ordering methods via the -o switch. This option requires support 51 from the machine dependent module: such support was added to 52 sunos5 (thus sunos54) and sunos4. 53 54 display.c: Changed CPU states display line to shorten the leading 55 tag if the data won't fit in the current width. Fixed a divide-by- 56 zero bug that affected ultrasparc servers (and potentially other 57 systems). 58 59 m_sunos5.c: Now asks the system for the correct pagesize rather than 60 assuming it is 4K. 61 62Thu Mar 2 1995 - wnl (3.3 RELEASE) 63 Added module netbsd10 and renamed netbsd to netbsd08. Changed 64 Configure so that it does not use an initial default module name. 65 Made other compatability fixes to Configure. Added comments to 66 decosf1 concerning optimizer bug. Other documentation changes. 67 Added use of "prime.c" to Configure script. 68 69Tue Feb 7 1995 - wnl (3.3beta6) 70 Still one more beta.... 71 Fixes for sunos5 2.4 gcc core dump (it was an alignment problem). 72 Fixed and improvements for decosf1 (including use of format_k 73 for proper SIZE column formatting). Added modules freebsd20 and 74 ncr3000. 75 76Thu Feb 2 1995 - wnl (3.3beta5) 77 One more beta.... 78 Fixed a few bugs in the sunos5 port pertaining to casting and 79 very large memory counts. Added "ifndef HAVE_GETOPT" to getopt.c 80 to provide for conditional compilation of the getopt function. 81 Those systems that have getopt in libc can add -DHAVE_GETOPT to 82 the CFLAGS line in the module to prevent the function from being 83 compiled. Added sunos54 module to accomodate SunOS 5.4 84 peculiarities. Added module for aux3.1. 85 86Wed Jan 4 1995 - wnl (3.3beta4) 87 This is really taking too long......sigh. 88 Fixed SIGWINCH handling once and for all. It now remembers the 89 number of processes you want displayed even thru window resizes. 90 Fixed buffer conflict in utils.c (itoa and itoa7). 91 Lots of small improvements to the various modules were made over 92 the past month: too numberous to list here. SunOS 5 module made 93 more secure thru use of seteuid calls (other SVR4 modules should 94 be modified similarly). One final MP fix to sunos5, too. Module 95 for decosf1 was modified to accomodate V3.0. 96 97Mon Apr 18 1994 - wnl (3.3beta3) 98 I think I finally got a sunos5 module that will work on MP 99 machines. Fixed cpu states figure in osmp41a so that 100 percentages never exceed 100%. Added shell script "install" 101 since Unix vendors can't seem to make up their minds on what 102 options they want to use for the one that comes with the OS. 103 Added netbsd modules from Christos. Fixed lots of other little 104 things over the past few months that I have long since forgotten. 105 106Wed Dec 15 1993 - wnl (3.3beta2) 107 Added module patches from various users: hpux9, sunos5. 108 Fixed bug with batch mode (screen_width wasn't getting set). 109 Changes to accomodate 64 bit machines. 110 Fixed some bugs in command parsing ("renice 19 " did something 111 unexpected). 112 113Mon Aug 30 1993 - wnl (3.3beta) 114 Added lots of little patches from various users. 115 Added routines to utils.c for intelligent formatting of kilobytes 116 and time. These are intended to be used in the modules when 117 formatting a process line. Added code to "summary_format" in 118 display.c to do intelligent formatting of memory quantities. 119 Redid display.c to allow for varying line widths and dynamic 120 reallocation of the screen buffer. 121 Added a SIGWINCH handler to top.c! 122 Added a constant, MAX_COLS, to top.h which defines the absolute 123 widest line we will ever allow. Changed allocations of "char fmt" 124 in all machine modules to use this constant rather than an abitrary 125 number. 126 127Fri Aug 13 1993 - wnl (3.3) 128 Changed return value definition of time-related functions in top.c, 129 display.c, and m_ultrix4.c to time_t (stuart@coral.cs.jcu.edu.au). 130 Fixed bug in display.c: line_update when start != 0. 131 132Wed Aug 4 1993 - wnl (3.2 release) 133 Changes to Configure from Paul Vixie. Added modules for hpux9 and 134 bsd386. 135 136Tue Jul 13 1993 - wnl (3.1 release) 137 More small changes and minor bug fixes. Brought bsd44 up to date 138 and added a module for svr4.2. Changed shar packaging to use Rich 139 Salz's cshar stuff. 140 141Wed Jul 7 1993 - wnl (3.1BETA) 142 More changes and bug fixes to Configure. Applied some other 143 minor bug fixes and suggestions from the beta testers. Added 144 the "metatop" shell script and the "installmeta" rule to the 145 Makefile to make handling multiple machine models and OS versions 146 easier. Added INSTALL and FAQ files. 147 148Tue May 18 1993 - wnl (3.1BETA) 149 Changed Configure to be compatible with most SVR4 environments 150 (differing output from "ls -lg"). Also changed Configure, 151 Makefile.X, etc., to look for module files in the subdirectory 152 "machine" (thanks to Christos Zoulas). 153 154Tue Apr 20 1993 - wnl (3.1BETA) 155 Changed both occurences of "ls -1" in Configure to "ls". This 156 SHOULD produce the same result, and has the advantage that it 157 doesn't produce an error on a system 5 machine. Integrated other 158 changes recommended in the first round of beta testing. 159 160Wed Mar 10 1993 - wnl (3.1BETA) 161 MAJOR CHANGE: I have added a required function to all machine 162 dependent modules, called proc_owner. It takes a pid as an argument 163 and returns the uid of the process's owner. Such capability is 164 necessary for top to run securely as a set-uid program, something 165 that is needed for SVR4 implementations to read /proc. I have 166 retrofitted all modules except dgux with this function, but was 167 not able to test most of them. Top should now run securely as 168 a setuid program. Added 386bsd and sunos5 modules. Added sunos4mp 169 module for MP Suns. 170 171Sat Feb 20 1993 - wnl (3.1ALPHA) 172 Modified top.c and commands.c to compile correctly on System V 173 derived Unixes (especially SVR4), but in a way that doesn't rely 174 on an oracle-like declaration (that is, I don't use "ifdef SYSV"). 175 Fixed some bugs in "Configure" and "getans". Added inspection of 176 env variable "TOP" for options, and made -I default to showing 177 idle processes. Added "u" command to change username restriction 178 on the fly. Created shell script "suntop" for poor multi-version 179 SunOS folks (like myself). 180 181Wed Jun 3 1992 - wnl (3.0) 182 "max_topn" wasn't being used everywhere it was supposed to be 183 in top.c. Many cosmetic changes, including copyright notices in 184 all the .c files. Version number is now handled by version.c and 185 reflects the current patchlevel (which is initially set to 0). 186 Changed Configure and Makefile to allow configurable variables for 187 certain commands: shell, cc, awk, install. Updated README and 188 Porting. Ready to release to the world! 189 190Mon May 18 1992 - wnl (2.9BETA) 191 Added modules provided by Christos Zoulas. Replaced screen.c 192 with one modified by Christos and that will appropriately select 193 and handle the sgtty, termio, or termios system. Integrated many 194 other changes recommended by Christos. Fixed (I hope) the "-b" 195 batch mode display bug. Had to change loadavg to load_avg to avoid 196 a conflict with 4.4BSD. 197 198Mon Apr 27 1992 - wnl (2.8BETA) 199 Added modules provided by Daniel Trinkle. Added patchlevel.h, 200 but the patch level is not yet reflected in the version number. 201 Cleaned up m_sunos4.c a little. 202 203Wed Apr 22 1992 - wnl (2.8BETA) 204 Major internal reorganization. All of the system dependent stuff 205 is now really and truly separated from everything else. The 206 system dependent functions are contained in a separate .c file 207 called a "module". The Configure script knows how to find and 208 set up these modules, but the human installer still needs to tell 209 Configure which module to use (no automagic determination of 210 machine type---sorry). Added -U option to specify one user's 211 processes, but there is no corresponding command...yet. Other 212 changes and improvements too numerous to mention here. Currently 213 there are only two modules: sunos4 and umax. But after this beta 214 release is sent around, I expect more to be written. I just hope 215 that the machine-dependent abstractions don't need to change in 216 the process. 217 218Thu Mar 26 1992 - wnl (2.7BETA) 219 Beta release with minimal architecture support. Updated README 220 and added a first cut at a Porting guide. Added ioctl TIOCGWINSZ 221 code from top2.5+ (courtesy of David MacKenzie). I didn't even 222 try porting the Ultrix support since I don't have access to an 223 Ultrix machine. 224 225Fri Oct 11 1991 - wnl (2.6) 226 This version was not widely released. It contained many changes. 227 Here are the major ones: 228 229 Put in Vixie's idle process hack. 230 231 Enhanced type field in new_message to handle delayed messages. 232 233 Changed u_process to automatically adjust for varying lines of 234 output. Management of screenbuf should now be completely contained 235 in display.c. Removed now extraneous code from CMD_number[12] 236 portion of command switch in top.c. This was the stuff that dealt 237 with zeroing out lines in screenbuf. 238 239 Finally made it all work correctly on a 386i. Problems I had to 240 overcome: kvm_nlist doesn't return 0 on success as advertised (it 241 returns 1 instead); the results of a kvm_nlist are different 242 (n_type can be zero even for a symbol that exists). 243 244 Serious rearrangement for processor dependent stuff. All nlists 245 are now in separate files with the suffix ".nlist". Most machine 246 specific code is in "machine.c" surrounded by appropriate ifdefs--- 247 the goal is to eventually have all machine specific code in this 248 file. Managed to find a way to detect SunOS 4.x at compile-time: 249 this is contained in the include file "sun.h". Completely changed 250 the memory display line for SunOS 4.x---it now displays a far 251 more appropriate report. 252 253 Created the shell script "Configure" to aid in the configuration 254 step. 255 256 Fixed a bug in init_termcap: it will now tolerate an environment 257 which does not have TERM defined (thanks to Sam Horrocks for 258 pointing this out). 259 260Tue Aug 9 1988 - wnl (2.5) 261 Added changes to make top work under version 4.0 of the Sun 262 operating system. Changes were provided by Scott Alexander of the 263 University of Pennsylvania. Thanks! Compile with "-Dsunos4" to 264 get them. Virtual memory statistics are not readily accessible 265 under 4.0, so they don't show up in the output. 266 267Thu Jul 31 1987 - wnl (2.4) 268 Fixed a problem with the 4.0 Pyramid code. The label "cp_time" 269 doesn't exist in the 4.0 kernel anymore. I think the code Carl 270 sent me wants "percpu" instead. That is what I am using and it 271 appears to work. 375 code is still untested (at least by me). 272 Also picked a great deal of lint out of the source. Lint now only 273 complains about a very few nitpicky things (there are far too many 274 calls to "printf" to put a "(void)" in front of!), at least under 275 SunOS. 276 277Tue Jul 28 1987 - wnl (2.4a) 278 Added changes for a Symmetrics Computer Systems s/375 machine. 279 Changes were provided by Paul Vixie. Thanks! According to Mr. 280 Vixie: "These changes were not made at, by, or for SCS proper. 281 SCS would probably be interested in them, but so far only the 282 users' group has them. They were made in February, 1987, to 283 version 2.1 of the program, by Paul Vixie 284 (dual!ptsfa!vixie!paul@ucbvax.Berkeley.EDU)." His changes were 285 integrated into version 2.3 to make version 2.4. 286 287 The SCS peculiarities are summarized in Changes.scs. 288 289Tue Jun 9 1987 - wnl (2.3 for real) 290 Changed the includes for the extra code Carl sent me to only 291 compile on Version 4.0 Pyramid machines. This makes top still 292 compilable on pre-4.0 Pyramids. Specifically, this code is only 293 compiled when both "pyr" and "CPUFOUND" are defined. 294 295Wed Jun 3 1987 - wnl (2.3 with Pyramid additions) 296 It's been a month and I still haven't done anything about 297 distributing this version. However, Carl Gutekunst from Pyramid 298 has sent me some extra patches for some of the Pyramid code. I 299 just added those and will make them part of 2.3. This fixes the 300 following Pyramid problems: adds the inclusion of <sys/systm.h>, 301 uses the correct size for getting the kernel value _ccpu (this bug 302 affected the Vax version as well), sums the elements of the percpu 303 array to calculate a cp_time value (for OSx 4.0). 304 305Fri May 1 1987 - wnl (2.3) 306 I have finally finished all the changes for better support of 307 oddbal terminals. Added the low-level routine "clear_eol" which 308 makes handling terminals without "ce" easy: it uses spaces 309 instead. All direct uses of "clear_line" outside of screen.c have 310 been changed to use this primitive. A terminal with "os" is now 311 handled in such that all situations that need overwriting are 312 completely avoided (including several commands). This required 313 some changes to the way commands are translated into action (in 314 "top.c"). Made several important changes to display.c to prevent 315 overflowing of any of the fields. Specifically, more than 99 316 total processes and a cpu state that reaches 100%. Had to make a 317 small change to two casts in top.c, because the Sun 3.2 compiler 318 was giving warnings on them. Added the "-q" option which lets 319 root run top at a nice of -20 (in case he thinks he really needs it). 320 321Tue Dec 30 1986 - wnl (2.2) 322 I think I fixed a bug reported by Julian Onions at Nottingham. 323 Occasionally, top will core dump when the sprintf in either 324 i_process or u_process overflows due to an exceptionally 325 unrealistic time value. I think it highly unlikely that top can 326 get a bad proc structure (although I suppose it is possible), but 327 the process time is read from the user structure, and that can 328 sometimes be part garbage. So, "get_ucpu" checks the value it 329 returns to make sure its formatted form will not overflow the 330 sprintf. If this doesn't fix the bug, then more drastic measures 331 will be necessary. I plan to make this version the official 332 "top 2.2". [[ This version was never distributed very widely. ]] 333 334Tue Dec 2 1986 - wnl (2.2c) 335 Added to top.c the notion of a "failed command". When a command 336 produces a message (on the message line), an update does not 337 follow it. Before, the message was written and a new display was 338 shown---purposefully not overwriting the message. But the 339 improvements to handle overstriking terminals and terminals 340 without "ce" clear the screen before every display, which would 341 erase the message. Now, the message is displayed and top waits 342 another full time interval before updating the display. This 343 works much better all around. 344 345Mon Nov 24 1986 - wnl (2.2b) 346 Created a new file, utils.c, and made appropriate changes to 347 Makefile. This new file holds all utility functions that can and 348 may be used by more than one "module". Improved i_memory and 349 u_memory (display.c) so that screen updates for the values 350 displayed are only changed when necessary. Also made the line 351 look better: the last fixes made for a rather ugly display. 352 Added the locally defined constant "LoadMax" and added code to 353 top.c to send the cursor home after a space command is entered if 354 the load average is higher than "LoadMax". This provides visual 355 feedback on loaded systems. 356 357Mon Nov 3 1986 - wnl (2.2a) 358 Widened the format for memory usage so that it can display 5 359 digits. This makes that line look a little ugly---maybe I'll fix 360 that later. Screen handling now understands "os" and a missing 361 "ce". It treats them identically: clear the screen between each 362 display. Screen handling code now uses "cd" when appropriate 363 (i.e.: when user has shortened the screen). Made i_loadave clear 364 then screen and took out most of the explicit calls to "clear" in 365 top.c. This method is cleaner, especially in conjunction with 366 "os" handling. Added preprocessor variable "RANDOM_PW" for 367 systems that access the passwd file randomly (Sun's yp and 4.3). 368 With "RANDOM_PW" set, "getpwuid" is used instead of "getpwnam", 369 but uid->username mappings are still hashed internally (because 370 that is still faster than going to disk). 371 372Mon Oct 6 1986 - wnl (2.1) 373 A bug with the kill command was pointed out by "dciem!tim"--- 374 specifying a signal by name did not work correctly. This bug has 375 been fixed with a simple change to commands.c. Another bug made 376 the cpu state percentages incorrect the first time they were 377 displayed. This bug has also been fixed (changed top.c). 378 379Thu Sep 4 1986 - wnl (2.0, at last) 380 This is the version that will (hopefully) get released to the 381 world as top 2.0. 382 Added the "r" and "k" commands for renice and kill, respectively. 383 This required adding a way to handle system call errors, and the 384 addition of the "e" command. Help screen and manual page were 385 changed to reflect this change. Changed all "#ifdef SUN" directives 386 to "#ifdef sun", and changed all "#ifdef PYRAMID" directives to 387 "#ifdef pyr". As much as I hate those choices of preprocessor 388 names (they too easily conflict with real variable names), it does 389 make automatic compilation possible---people don't have to change 390 the Makefile anymore for specific machines. The manual page was 391 changed to automatically incorporate the defaults as set in the 392 Makefile (including an infinite value for TOPN) and the way the 393 manual page is generated by the Makefile was changed to make 394 maintenance of this information automatic. 395 396Mon Jul 28 1986 - wnl (still pre 2.0) 397 Real close now. I put in a new definition for the macro "pagetok" 398 that does an explicit shift of a constant expression involving 399 PGSHIFT. Appropriate checks are made if PGSHIFT is to small. 400 "pagetok" is now used exclusively everywhere to convert kernel 401 clicks to kilobytes. I added a full blown interactive mode with 402 the ability to change some of the runtime parameters (how many to 403 display, time delay, etc.) while top is running. I also 404 incorporated a few ideas from the net: control characters in the 405 command name are replaced with '?'; the '-S' option makes the 406 swapper and pager visible; options have been added to control the 407 number of displays produced (this makes it easier to make 408 performance snapshots with top). I have also added the notion of 409 "infinite" values for number of processes and number of displays. 410 I fixed a long-standing bug in the uid to username mapping code 411 that was only aggravated on the pyramids: it was an ill-defined 412 expression (akin to i = i++). I tweaked the proc_compar routine 413 for qsort slightly so that stopped processes were more likely to 414 show up. Manual page was updated to reflect all changes 415 noticeable to the user. 416 417Tue Jul 1 1986 - wnl (pre 2.0 -- 1.9999?) 418 In the process of major revamping on the way to version 2.0. 419 I have completely done away with curses by adding my own screen 420 management routines in a separate file (screen.c). The rationale 421 for this is that top knows a whole lot more about what is and is 422 not redundant on the screen and can compare simple integer values 423 where curses would have to compare strings. This has turned out 424 to be a very big win speed-wise. The proc_compar routine for 425 sorting has been rewritten to include several more keys. I 426 decided this was necessary when I noticed that the "top" process 427 itself kept disappearing off the top 10 list on a Sun-3. All the 428 processes had the same percentage (0%) and the sort wasn't really 429 doing anything worthwhile. I changed the expression that computes 430 memory usage to use the ctob macro instead of just assuming that 431 pages were 512 bytes. More work still needs to be done before 432 this version is usable. I changed options-processing to use 433 getopt and added appropriate incantations to the Makefile. 434 435Wed Feb 20 1985 - wnl (still 1.8) 436 Put in the ifdef FOUR_ONE statements to make top still compilable 437 on a 4.1 system. Apparently, there are some users out there that 438 need this functionality. Oh well. I don't guarantee any of it, 439 since I can't test it. Made appropriate changes to README and 440 final installation related changes to Makefile. 441 442Sat Feb 2 1985 - wnl (1.8) 443 Removed all the ifdef FOUR_TWO statements and made "top" into a 444 4.2 only program. If someone really wants to still run it on 4.1, 445 then they can do all the work. We don't have a 4.1 machine 446 anymore, so I don't even know if the thing still works under 4.1. 447 Cleaned up the Makefile and the README. Added installation rules 448 to the Makefile, as requested by several sites. Fixed a very 449 obscure divide-by-zero bug. Added a second "key" to the qsort 450 comparison function (proc_compar) so that comparisons are based on 451 cpu ticks if the percentages are equal (provided by Jonathon 452 Feiber at Sun). 453 454Tue Dec 11 1984 - wnl (1.7) 455 Added the virtual and real memory status line to the header area 456 (provided by Jonathon Feiber at Sun) 457 458Tue Nov 20 1984 - wnl (1.6) 459 Added an "exit" if sbrk's fail. Added changes from Jonathon 460 Feiber at Sun: ifdef SUN to make top work on Suns (they don't use 461 doubles in the proc structure), register declarations, check for 462 getting a user structure that has disappeared since the proc array 463 was read (it used to die, now it just shows the process as swapped). 464 465Tue Nov 13 1984 - wnl (1.5) 466 If the number of displayable processes ("active_procs") was less 467 than the number of requested processes ("topn"), top would 468 segmentation fault. This bug has been fixed. Thanks to Prentiss 469 Riddle at ut-sally for pointing out the existence of this bug. 470 471Tue Oct 23 1984 - wnl (1.4) 472 Finally fixed the hash table bug that caused processes owned by 473 root to sometimes appear with either no name or a different name 474 that had UID 0 (such as "operator"). Removed all the ifdef DEBUG 475 blocks to make top ready for distribution to the real world. 476 477Sun Apr 8 1984 - wnl (still 1.3) 478 Made some slight changes to the display format. It now looks more 479 aesthetically pleasing. Added some preprocessor constants so that 480 the two defaults (number of processes and seconds of delay) easier 481 to change. 482 483Thu Apr 5 1984 - wnl (1.3) 484 Changed the order in which things are done at initialization time. 485 This way, if an error occurs before starting the main loop, curses 486 will never get started. Also changed other error handlers so that 487 endwin() is called before any flavor of exit. Specifying a number 488 of processes that is more than the screen can handle is no longer 489 fatal. It displays a warning message and pretends the user 490 specified the maximum for the screen. Finally cured all the TSTP 491 blues (well, almost all). I removed my TSTP handler and convinced 492 the system to always use the one that curses sets up. Turns out 493 that "sleep" was stepping all over it during a pause. So, I don't 494 use sleep anymore. The only problem that remains with it now is 495 redrawing the old display before updating it after a pause. 496 497Tue Apr 3 1984 - wnl (from 1.0 to 1.2) 498 I changed the format of the TIME column from just "seconds" to 499 "minutes:seconds". I also made pausing work correctly. Screen 500 redraws with an up to date display. For compatibility with 4.2, I 501 changed the name of the "zero" function to "bzero". The makefile 502 has been altered to handle versions for 4.1 and 4.2, and README 503 has been updated to reflect these recent changes. 504