Index: contrib/top/FREEBSD-upgrade =================================================================== --- contrib/top/FREEBSD-upgrade +++ contrib/top/FREEBSD-upgrade @@ -0,0 +1,158 @@ +$FreeBSD$ + +This file contains notes regarding the upgrade of top(1). See the vendor +import instructions at: + + https://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html#svn-advanced-use-vendor-imports + +The upstream project pages for top(1) are: + + http://www.unixtop.org/ + + https://sourceforge.net/projects/unixtop/ + +The version of top(1) in base is: 3.5-beta12, from March 2000. +The current upstream release is: 3.8-beta1, from May 2008. +This upgrade is in progress by Randy Westlund . + + + +########### 3.8-beta1 ########## + +IMPORTING: + +When 3.8-beta1 was imported into vendor/top, the distribution's /machine +directory that holds m_${OS_NAME}.c files was flattened, removing everything +except m_freebsd.{c,man}. + +Run ./configure to generate config.h, then make the following changes before +including this in contrib/top. + + - Remove UNAME_HARDWARE. It should be defined in usr.bin/top/Makefile. + - Change DEFAULT_DELAY from 5 to 2: refresh every 2 seconds. + - Change DEFAULT_TOPN from 30 to -1: show all processes. + - Change NOMINAL_TOPN from 40 to 18: show only 18 on non-terminals. + + +UPSTREAM CHANGES: + +Upstream has made many changes (see the Changes file in the distribution), a +fair number of which are for FreeBSD. These likely came from pkgsrc. + +Upstream switched to GNU autoconf, replacing the csh configure script that we +didn't use. + +The OS-specific bits specified in contrib/top/machine.h no longer require +usr.bin/top/machine.c; there's now a m_freebsd.c module in the upstream +distribution that handles this. It needs significant modification; perhaps +this can be upstreamed. + + +LOCAL PATCHES AGAINST 3.5-beta12: + +These changes are what needs to be ported to 3.8-beta1. + + svn diff https://svn.freebsd.org/base/vendor/top/3.5beta12/ https://svn.freebsd.org/base/head/contrib/top@r300394 + + +LOCAL CHANGES I PORTED FROM 3.5-beta12 TO 3.8-beta1: + + Implement jail ID display column. The runtime command 'j' and command-line + option -j toggle display of the column. + + Implement display of an ARC summary line for systems with ZFS. This + includes color tag support. + + Implement the lastpid field in the freebsd-specific code so that it appears + in the interface. + + Replace strcpy() with strlcpy(). + + Add static assertion in utils.c to warn of problems if sizeof(int) is ever + greater than 4. + + +NEW LOCAL CHANGES I MADE: + + Fix a bug that referenced a nonexistent sysctl in m_freebsd.c: + s/smp.smp_active/kern.smp.active/ + + + +########### 3.5-beta12 ########## + +contrib/top/machine.h specifies an interface that must be provided by the +target OS. That interface is implemented in usr.bin/top/machine.c + +The upstream configure script and makefile are ignored; usr.bin/top/Makefile +implements all the necessary steps. + + +FREEBSD'S PATCHES AGAINST 3.5-beta12: + +CHANGE NEEDED IN 3.8-beta1? + +display.c + - functions for printing uptime, mem, arc rewritten + +loadavg.h (define load_avg typedef depending on platform) + - treat freebsd like netbsd for mips build applies cleanly + - typedef fixpt_t load_avg; type is never used + +layout.h + - replace defines with ints unnecessary + +screen.c + - replace strcpy with strncpy applied with strlcpy + +sigconv.awk + - change regex to match signals with numbers not necessary + e.g. SIGUSR1 + - change output format for signal list upstreamed + +top.local.H -> top.local.hs (defines, processed by the csh configure script) + - renamed, no other changes file removed upstream + +username.c + - replace username length of 8 with no longer needed + MAXLOGNAME and include + sys/param.h, sys/types.h + +utils.c + - add assertion for int width applies cleanly + - prevent division by 0 bug unnecessary in both versions + - prevent -Wimplicit-cast upstreamed + - make time format use consistent long format upstreamed + - add format_k2(.), used by no longer necessary + usr.bin/top/machine.c: changes format_k + to use 100k rather than 10k for + human-readable numbers + +utils.h + - declaration of format_k2(.) no longer necessary + +commands.c + - add several new runtime commands format changed, conflicts + +machine.h + - additions to structures (swap, arc, ncpu) structs significantly changed + +top.X -> top.xs (man page) + - renamed, significant changes + +top.c + - add headers: errno.h, sys.jail.h, jail.h whole file completely + - add {u|i}_{arc|swap}() functions rewritten, needs to be + - added handlers for new options reimplemented + - fix bug where top eats cpu when terminal partially upstreamed, + disappears, r86042 can not reproduce + - move event handling to main loop with flags + rather than holding logic in the signal + handler + +top.h + - add one to display lines (for swap and arc) display lines define is gone + - increase max display cols applies cleanly + - add display mode enum maybe no longer needed + +