Page MenuHomeFreeBSD

D6493.id16839.diff
No OneTemporary

D6493.id16839.diff

Index: contrib/top/FREEBSD-upgrade
===================================================================
--- contrib/top/FREEBSD-upgrade
+++ contrib/top/FREEBSD-upgrade
@@ -0,0 +1,248 @@
+$FreeBSD$
+
+This file contains notes regading 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
+
+Top's upstream project pages 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 <rwestlun@gmail.com>.
+
+
+
+########### 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 CHANGES:
+
+These changes are what needs to be ported to 3.8-beta1. This is an overview of
+what we changed in 3.5-beta12 and how it might apply to 3.8-beta1.
+
+ svn diff https://svn.freebsd.org/base/vendor/top/3.5beta12/ https://svn.freebsd.org/base/head/contrib/top@r300394
+
+
+QUESTIONS:
+
+ Does FreeBSD still define "mips" when building on mips? If so, patch
+ loadavg.h
+
+ Does FreeBSD need to build with lower than C11? If so, add sys/sdefs.h to
+ utils.c
+
+ Under what circumstances do I add my name to the copyright?
+
+ Does $FreeBSD$ go in any modified files?
+
+ How careful do I need to be with preserving the options/commands that
+ top(1) takes?
+
+ r81187 moved logic out of handlers and used flags. The program structure
+ changed, and I don't fully understand the implications of changing it.
+
+ New code in display.c adds 30 secs to uptime; this make is 30 seconds ahead
+ of the version in the tree, but now it matches uptime(1). I'm not sure why.
+
+ I/O display mode calculates VCSW differently -- need to figure out why.
+
+ Priority is calculated differently -- need to figure out why.
+
+ Showing full process titles displays differently -- need to figure out why.
+
+
+CHANGES FROM UPSTREAM (3.5-beta12 -> 3.8-beta1):
+
+ Process count in header counts system processes regardless of whether
+ they're displayed (-S). Previous behavior was to only count them if they're
+ being displayed.
+
+ Uptime field in header now matches uptime(1). Previously, it was 30 seconds
+ behind.
+
+ top(1) now supports color via the TOPCOLORS environment variable.
+
+
+CHANGES I MADE TO 3.8-beta1:
+
+ Implement jail ID display column. The runtime command 'j' and command-line
+ option -j togle 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.
+
+
+ARGUMENT CHANGES TO BE RESOLVED:
+
+- Conflicting runtime commands:
+ CMD OLD NEW
+ C toggle CPU/WCPU toggle color
+ P toggle per-CPU statistics sort by CPU usage
+ t toggle display of this process alias for H (display threads)
+
+- Old commands not yet ported:
+ CMD OLD NEW
+ e show last error from kill/renice -
+ J filter by jail -
+ z toggle display of system idle process -
+ a toggle full process titles -
+
+- New runtime commands:
+ CMD OLD NEW
+ f - toggle full process titles
+ M - sort by mem usage
+ N - sort by PID
+ T - sort by CPU time
+ U - toggle display of username/UID
+ c - filter by command name
+
+Same runtime commands: ^L, ' ', q, h, ?, d, H, i, I, k, m, n, #, o, r, s, S, u, j
+
+
+- Conflicting arguments:
+ CMD OLD NEW
+ -C toggle CPU/WCPU display toggle color
+ -a show full command names don't limit number of processes
+ -t do not display this process show threads
+
+- Old arguments not yet ported:
+ CMD OLD NEW
+ -H show threads -
+ -j show JID column -
+ -n alias -b (batch mode) -
+ -P per-CPU statics -
+ -z do not show the system idle process -
+ -J filter by JID or jail name -
+
+- New arguments:
+ CMD OLD NEW
+ -c - show full command names
+ -T - show color tag names
+
+- Syntax changed:
+ CMD OLD NEW
+ -m -mcpu -or -mio -m0 or -m1
+
+Same arguments: -S, -b, -i, -I, -q, -u, -v, -d, -s, -o, -U
+
+
+
+########### 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
+
+

File Metadata

Mime Type
text/plain
Expires
Fri, Jun 12, 3:36 PM (39 m, 14 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33910980
Default Alt Text
D6493.id16839.diff (7 KB)

Event Timeline