From e1d412d71e41f55a496a5d8f350426655ecfbf31 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 17 Mar 2006 07:54:55 +0000 Subject: [PATCH] Top manpage + comment in code --- commands/simple/top.c | 2 ++ man/man1/top.1 | 60 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 man/man1/top.1 diff --git a/commands/simple/top.c b/commands/simple/top.c index c1bfe3ea3..ea67bf707 100644 --- a/commands/simple/top.c +++ b/commands/simple/top.c @@ -1,4 +1,6 @@ +/* Author: Ben Gras 17 march 2006 */ + #define _MINIX 1 #define _POSIX_SOURCE 1 diff --git a/man/man1/top.1 b/man/man1/top.1 new file mode 100644 index 000000000..8edb744c2 --- /dev/null +++ b/man/man1/top.1 @@ -0,0 +1,60 @@ +.TH TOP 1 +.SH NAME +top \- show processes sorted by cpu usage +.SH SYNOPSIS +.B top +.SH DESCRIPTION +Top displays a list of all running processes, once every update interval +(currently 5 seconds). It is sorted by the cpu usage of the processes in +the last interval. The first display is the cpu usage of processes since +the boot time. + +At the top of the screen, top shows the current system load averages in +the last 1-minute, 5-minute and 15-minute intervals. Then, over the +last top interval it displays: the number of alive, active, and sleeping +processes; memory free; and cpu usage. + +Then it displays all the alive processes sorted by cpu usage in the last +interval, with a number of fields for every process. Currently the +following fields are displayed: +.PP + PID + The process id of the process. Some processes (so-called kernel + tasks) don't have a real process id, as they are not processes + that are managed by the process manager, and aren't visible to + other user processes by pid. They are shown by having their process + slot number in square brackets. + USERNAME + The username of the effective uid at which the process runs, + or a number if the username could not be looked up. + PRI + The system scheduling priority the process is currently running as. + A lower priority number gives a higher scheduling priority. The + lowest is 0. The scale is internal to the kernel. + NICE + The base scheduling priority the process has been given at startup. + 0 is normal for a regular user process; the range is -20 to 20 + (PRIO_MIN and PRIO_MAX in . Most system processes + are given higher base priorities. + SIZE + Text + data size in kilobytes. + STATE + RUN if the process is runnable, empty if blocking. + TIME + Total number of cpu time spent in the process itself. So-called + system time (cpu time spent on behalf of this process by another + process, generally a system process) is not seen here. + CPU + Percentage of time that the process was running in the last interval. + COMMAND + Name of the command that belongs to this process. + +.SH "SEE ALSO" +.BR ps (1) +.SH BUGS +This is a from-scratch reimplementation of top for MINIX 3. +Many features (such as interactive commands) are not implemented. +Sorting is only done by cpu usage currently. Displayed state is +only RUN or empty. +.SH AUTHOR +Ben Gras (beng@few.vu.nl) -- 2.44.0