diff --git a/free.1 b/free.1 index 21cce28a..85efef88 100644 --- a/free.1 +++ b/free.1 @@ -32,9 +32,7 @@ kernels 2.6.32, displayed as zero if not available) Memory used by kernel buffers (Buffers in /proc/meminfo) .TP \fBcached\fR -Memory used by the page cache (calculated as Cached - Shmem in -/proc/meminfo - the Cached value is actually the sum of page cache and -tmpfs memory) +Memory used by the page cache (Cached in /proc/meminfo) .SH OPTIONS .TP \fB\-b\fR, \fB\-\-bytes\fR diff --git a/proc/sysinfo.c b/proc/sysinfo.c index e07ca866..85fb0a43 100644 --- a/proc/sysinfo.c +++ b/proc/sysinfo.c @@ -682,8 +682,6 @@ nextline: } kb_swap_used = kb_swap_total - kb_swap_free; kb_main_used = kb_main_total - kb_main_free; - /* "Cached" includes "Shmem" - we want only the page cache here */ - kb_main_cached -= kb_main_shared; } /*****************************************************************/ diff --git a/ps/ps.1 b/ps/ps.1 index cdb7536b..90f12acb 100644 --- a/ps/ps.1 +++ b/ps/ps.1 @@ -1683,7 +1683,7 @@ number of kernel threads owned by the process. T} tid TID T{ -the unique number representing a dispatacable entity (alias +the unique number representing a dispatchable entity (alias .BR lwp , \ spid ). This value may also appear as: a process ID (pid); a process group ID (pgrp); a session ID for the session leader (sid); a thread group ID for the thread diff --git a/sysctl.8 b/sysctl.8 index faf2255a..a74b2d77 100644 --- a/sysctl.8 +++ b/sysctl.8 @@ -63,8 +63,8 @@ Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. Specifying \- as filename means reading data from standard input. Using this option will mean arguments to .B sysctl -are files, which are read in order they are specified. The file argument can -may be specified as reqular expression. +are files, which are read in the order they are specified. +The file argument may be specified as reqular expression. .TP \fB\-a\fR, \fB\-\-all\fR Display all values currently available. @@ -112,10 +112,10 @@ Alias of \fB\-p\fR Alias of \fB\-a\fR .TP \fB\-o\fR -Does nothing in favour of BSD compatibility. +Does nothing, exists for BSD compatibility. .TP \fB\-x\fR -Does nothing in favour of BSD compatibility. +Does nothing, exists for BSD compatibility. .TP \fB\-h\fR, \fB\-\-help\fR Display help text and exit. diff --git a/top/top.1 b/top/top.1 index f25acfff..5ce405e7 100644 --- a/top/top.1 +++ b/top/top.1 @@ -1,7 +1,7 @@ .ig . manual page for NEW and IMPROVED linux top . -. Copyright (c) 2002-2013, by: James C. Warner +. Copyright (c) 2002-2014, by: James C. Warner . All rights reserved. 8921 Hilloway Road . Eden Prairie, Minnesota 55347 USA . @@ -13,14 +13,6 @@ . .ll +(\n[half_xtra] + \n[half_xtra]) . -\# ** we use single quote char (') a lot, so change the no-break ctrl char -.c2 ` -. -\# Our own Bullet style(s) -------------------------- -.de jBu -.IP "o" 3 -.. -. \# Commonly used strings (for consistency) ---------- \# - our em-dashes .ds Em \fR\ \-\-\ \fR @@ -32,11 +24,11 @@ .ds F \fIOff\fR .ds O \fIOn\fR . -.ds AK asterisk (\'*\') +.ds AK asterisk (`*') .ds AM alternate\-display mode .ds AS auxiliary storage .ds CF configuration file -.ds CG \'current\' window/field group +.ds CG `current' window/field group .ds CI interactive command \# - Note: our 'Command Line' used in 2 places \# ( and managed to fit in an 80x24 terminal ) @@ -44,7 +36,7 @@ \-\fBu\fR|\fBU\fR user \-\fBp\fR pid \-\fBo\fR fld \-\fBw\fR [cols] \fR .ds CO command\-line option .ds CT command toggle -.ds CW \'current\' window +.ds CW `current' window .ds FG field group .ds FM full\-screen mode .ds KA arrow key @@ -76,7 +68,7 @@ . .\" Document ///////////////////////////////////////////////////////////// .\" ---------------------------------------------------------------------- -.TH TOP 1 "November 2013" "procps-ng" "User Commands" +.TH TOP 1 "April 2014" "procps-ng" "User Commands" .\" ---------------------------------------------------------------------- .\" ---------------------------------------------------------------------- @@ -90,7 +82,7 @@ top \- display Linux processes \*(WE \*(CL -The traditional switches '\-' and whitespace are optional. +The traditional switches `\-' and whitespace are optional. .\" ---------------------------------------------------------------------- .SH DESCRIPTION @@ -157,9 +149,9 @@ The remaining Table of Contents .\" ...................................................................... .SS Operation .\" ---------------------------------------------------------------------- -When operating \*(We, the two most important keys are the help ('h' or '?') +When operating \*(We, the two most important keys are the help (h or ?) key and quit ('q') key. -Alternatively, you could simply use the traditional interrupt key ('^C') +Alternatively, you could simply use the traditional interrupt key (^C) when you're done. When started for the first time, you'll be presented with these traditional @@ -245,31 +237,31 @@ All are explained in detail in the sections that follow. .nf \fIGlobal-defaults\fR - 'A' - Alt display Off (full-screen) - * 'd' - Delay time 3.0 seconds - * 'H' - Threads mode Off (summarize as tasks) - 'I' - Irix mode On\ \ (no, 'solaris' smp) - * 'p' - PID monitoring Off (show all processes) - * 's' - Secure mode Off (unsecured) - 'B' - Bold enable On\ \ (yes, bold globally) + A \- Alt display Off (full-screen) + * d \- Delay time 3.0 seconds + * H \- Threads mode Off (summarize as tasks) + I \- Irix mode On (no, `solaris' smp) + * p \- PID monitoring Off (show all processes) + * s \- Secure mode Off (unsecured) + B \- Bold enable On (yes, bold globally) \fISummary-Area-defaults\fR - 'l' - Load Avg/Uptime On\ \ (thus program name) - 't' - Task/Cpu states On\ \ (1+1 lines, see '1') - 'm' - Mem/Swap usage On\ \ (2 lines worth) - '1' - Single Cpu On\ \ (thus 1 line if smp) + l \- Load Avg/Uptime On (thus program name) + t \- Task/Cpu states On (1+1 lines, see `1') + m \- Mem/Swap usage On (2 lines worth) + 1 \- Single Cpu On (thus 1 line if smp) \fITask-Area-defaults\fR - 'b' - Bold hilite On\ \ (not 'reverse') - * 'c' - Command line Off (name, not cmdline) - * 'i' - Idle tasks On\ \ (show all tasks) - 'J' - Num align right On\ \ (not left justify) - 'j' - Str align right Off (not right justify) - 'R' - Reverse sort On\ \ (pids high-to-low) - * 'S' - Cumulative time Off (no, dead children) - * 'u' - User filter Off (show euid only) - * 'U' - User filter Off (show any uid) - 'x' - Column hilite Off (no, sort field) - 'y' - Row hilite On\ \ (yes, running tasks) - 'z' - color/mono Off (no, colors) + b \- Bold hilite On (not `reverse') + * c \- Command line Off (name, not cmdline) + * i \- Idle tasks On (show all tasks) + J \- Num align right On (not left justify) + j \- Str align right Off (not right justify) + R \- Reverse sort On (pids high-to-low) + * S \- Cumulative time Off (no, dead children) + * u \- User filter Off (show euid only) + * U \- User filter Off (show any uid) + x \- Column hilite Off (no, sort field) + y \- Row hilite On (yes, running tasks) + z \- color/mono Off (no, colors) .fi .\" ---------------------------------------------------------------------- @@ -279,7 +271,7 @@ The command-line syntax for \*(We consists of: \*(CL -The typically mandatory switches ('\-') and even whitespace are completely +The typically mandatory switch ('\-') and even whitespace are completely optional. .TP 5 @@ -288,38 +280,38 @@ Show library version and the usage prompt, then quit. .TP 5 \-\fBb\fR\ \ :\fIBatch-mode\fR operation \fR -Starts \*(We in 'Batch' mode, which could be useful for sending output +Starts \*(We in Batch mode, which could be useful for sending output from \*(We to other programs or to a file. In this mode, \*(We will not accept input and runs until the iterations -limit you've set with the '\-n' \*(CO or until killed. +limit you've set with the `\-n' \*(CO or until killed. .TP 5 \-\fBc\fR\ \ :\fICommand-line/Program-name\fR toggle \fR -Starts \*(We with the last remembered 'c' state reversed. +Starts \*(We with the last remembered `c' state reversed. Thus, if \*(We was displaying command lines, now that field will show program names, and visa versa. -\*(XC 'c' \*(CI for additional information. +\*(XC `c' \*(CI for additional information. .TP 5 \-\fBd\fR\ \ :\fIDelay-time\fR interval as:\ \ \fB-d ss.t\fR (\fIsecs\fR.\fItenths\fR) \fR Specifies the delay between screen updates, and overrides the corresponding value in one's personal \*(CF or the startup default. -Later this can be changed with the 'd' or 's' \*(CIs. +Later this can be changed with the `d' or `s' \*(CIs. Fractional seconds are honored, but a negative number is not allowed. In all cases, however, such changes are prohibited if \*(We is running -in 'Secure mode', except for root (unless the 's' \*(CO was used). -For additional information on 'Secure mode' \*(Xt 6a. SYSTEM Configuration File. +in Secure mode, except for root (unless the `s' \*(CO was used). +For additional information on Secure mode \*(Xt 6a. SYSTEM Configuration File. .TP 5 \-\fBH\fR\ \ :\fIThreads-mode\fR operation \fR Instructs \*(We to display individual threads. Without this \*(CO a summation of all threads in each process is shown. -Later this can be changed with the 'H' \*(CI. +Later this can be changed with the `H' \*(CI. .TP 5 \-\fBi\fR\ \ :\fIIdle-process\fR toggle \fR -Starts \*(We with the last remembered 'i' state reversed. +Starts \*(We with the last remembered `i' state reversed. When this toggle is \*F, tasks that have not used any \*(PU since the last update will not be displayed. For additional information regarding this toggle @@ -334,8 +326,8 @@ produce before ending. \-\fBo\fR\ \ :\fIOverride-sort-field\fR as:\fB\ \ \-o fieldname \fR Specifies the name of the field on which tasks will be sorted, independent of what is reflected in the configuration file. -You can prepend a '+' or '\-' to the field name to also override the sort direction. -A leading '+' will force sorting high to low, whereas a '\-' will ensure a low to high +You can prepend a `+' or `\-' to the field name to also override the sort direction. +A leading `+' will force sorting high to low, whereas a `\-' will ensure a low to high ordering. This option exists primarily to support automated/scripted batch mode @@ -360,9 +352,9 @@ itself once it is running. This is a \*(CO only and should you wish to return to normal operation, it is not necessary to quit and restart \*(We \*(Em just issue any -of these \*(CIs: '=', 'u' or 'U'. +of these \*(CIs: `=', `u' or `U'. -The 'p', 'u' and 'U' \*(COs are mutually exclusive. +The `p', `u' and `U' \*(COs are mutually exclusive. .TP 5 \-\fBs\fR\ \ :\fISecure-mode\fR operation \fR @@ -372,25 +364,25 @@ This mode is far better controlled through the system \*(CF .TP 5 \-\fBS\fR\ \ :\fICumulative-time\fR toggle \fR -Starts \*(We with the last remembered 'S' state reversed. -When 'Cumulative time' mode is \*O, each process is listed with the \*(Pu +Starts \*(We with the last remembered `S' state reversed. +When Cumulative time mode is \*O, each process is listed with the \*(Pu time that it and its dead children have used. -\*(XC 'S' \*(CI for additional information regarding this mode. +\*(XC `S' \*(CI for additional information regarding this mode. .TP 5 \-\fBu\fR | \-\fBU\fR\ \ :\fIUser-filter-mode\fR as:\ \ \fB-u\fR | \fB-U number\fR or\fB name \fR Display only processes with a user id or user name matching that given. -The '\-u' option matches on \fI effective\fR user whereas the '\-U' option +The `\-u' option matches on \fI effective\fR user whereas the `\-U' option matches on\fI any\fR user (real, effective, saved, or filesystem). Prepending an exclamation point ('!') to the user id or name instructs top to display only processes with users not matching the one provided. -The 'p', 'u' and 'U' \*(COs are mutually exclusive. +The `p', `u' and `U' \*(COs are mutually exclusive. .TP 5 \-\fBw\fR\ \ :\fIOutput-width-override\fR as:\ \ \fB-w\fR [\fB number\fR ] \fR -In 'Batch' mode, when used without an argument \*(We will format +In Batch mode, when used without an argument \*(We will format output using the COLUMNS= and LINES= environment variables, if set. Otherwise, width will be fixed at the maximum \*(WX columns. With an argument, output width can be decreased or increased (up to \*(WX) @@ -400,10 +392,10 @@ In normal display mode, when used without an argument \*(We will\fI attempt\fR to format output using the COLUMNS= and LINES= environment variables, if set. With an argument, output width can only be decreased, not increased. Whether using environment variables or an argument with \-w, when\fI not\fR -in 'Batch' mode actual terminal dimensions can never be exceeded. +in Batch mode actual terminal dimensions can never be exceeded. \*(NT Without the use of this \*(CO, output width is always based on the -terminal at which \*(We was invoked whether or not in 'Batch' mode. +terminal at which \*(We was invoked whether or not in Batch mode. .\" ---------------------------------------------------------------------- .SH 2. SUMMARY Display @@ -456,7 +448,7 @@ kernel versions are shown first. .\" ---------------------------------------------------------------------- This portion consists of two lines which may express values in kibibytes (KiB) through exbibytes (EiB) depending on the scaling factor enforced -with the 'E' \*(CI. +with the `E' \*(CI. Line 1 reflects \*(MP, classified as: .nf @@ -487,16 +479,16 @@ This table may help in interpreting the scaled values displayed: Listed below are \*(We's available process fields (columns). They are shown in strict ascii alphabetical order. You may customize their position and whether or not they are displayable -with the 'f' or 'F' (Fields Management) \*(CIs. +with the `f' or `F' (Fields Management) \*(CIs. Any field is selectable as the sort field, and you control whether they are sorted high-to-low or low-to-high. For additional information on sort provisions \*(Xt 4c. TASK AREA Commands, SORTING. -The fields related to \*(MP or \*(MV reference '(KiB)' as the default, +The fields related to \*(MP or \*(MV reference `(KiB)' as the default, unsuffixed display mode. -Such fields can, however, be scaled differently via the 'e' \*(CI. +Such fields can, however, be scaled differently via the `e' \*(CI. .TP 4 1.\fB %CPU \*(Em \*(PU Usage \fR @@ -506,12 +498,12 @@ expressed as a percentage of total \*(PU time. In a true SMP environment, if a process is multi-threaded and \*(We is \fInot\fR operating in Threads mode, amounts greater than 100% may be reported. -You toggle Threads mode with the 'H' \*(CI. +You toggle Threads mode with the `H' \*(CI. -Also for multi-processor environments, if 'Irix mode' is \*F, \*(We -will operate in 'Solaris mode' where a task's \*(Pu usage will be +Also for multi-processor environments, if Irix mode is \*F, \*(We +will operate in Solaris mode where a task's \*(Pu usage will be divided by the total number of \*(PUs. -You toggle 'Irix/Solaris' modes with the 'I' \*(CI. +You toggle Irix/Solaris modes with the `I' \*(CI. .TP 4 2.\fB %MEM \*(Em Memory Usage (RES) \fR @@ -520,7 +512,7 @@ A task's currently used share of available \*(MP. .TP 4 3.\fB CGROUPS \*(Em Control Groups \fR The names of the control group(s) to which a process belongs, -or '\-' if not applicable for that process. +or `\-' if not applicable for that process. Control Groups provide for allocating resources (cpu, memory, network bandwidth, etc.) among installation-defined groups of processes. @@ -531,7 +523,7 @@ Many different hierarchies of cgroups can exist simultaneously on a system and each hierarchy is attached to one or more subsystems. A subsystem represents a single resource. -\*(NT The 'CGROUPS' field, unlike most columns, is not fixed-width. +\*(NT The CGROUPS field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \*(WX characters). Even so, such variable width fields could still suffer truncation. @@ -541,13 +533,13 @@ any truncated data. .TP 4 4.\fB CODE \*(Em Code Size (KiB) \fR The amount of \*(MP devoted to executable code, also known as -the 'text resident set' size or TRS. +the Text Resident Set size or TRS. .TP 4 5.\fB COMMAND \*(Em Command\fB Name\fR or Command\fB Line \fR Display the command line used to start a task or the name of the associated program. -You toggle between command\fI line\fR and\fI name\fR with 'c', which is both +You toggle between command\fI line\fR and\fI name\fR with `c', which is both a \*(CO and an \*(CI. When you've chosen to display command lines, processes without a command @@ -555,31 +547,31 @@ line (like kernel threads) will be shown with only the program name in brackets, as in this example: \fR[kthreadd] -This field may also be impacted by the 'forest view' display mode. -\*(XC 'V' \*(CI for additional information regarding that mode. +This field may also be impacted by the forest view display mode. +\*(XC `V' \*(CI for additional information regarding that mode. -\*(NT The 'COMMAND' field, unlike most columns, is not fixed-width. +\*(NT The COMMAND field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \*(WX characters). Even so, such variable width fields could still suffer truncation. This is especially true for this field when command lines are being -displayed (the 'c' \*(CI.) +displayed (the `c' \*(CI.) \*(XT 5c. SCROLLING a Window for additional information on accessing any truncated data. .TP 4 6.\fB DATA \*(Em Data + Stack Size (KiB) \fR The amount of \*(MP devoted to other than executable code, also known as -the 'data resident set' size or DRS. +the Data Resident Set size or DRS. .TP 4 7.\fB ENVIRON \*(Em Environment variables \fR Display all of the environment variables, if any, as seen by the respective processes. These variables will be displayed in their raw native order, not the -sorted order you are accustomed to seeing with an unqualified 'set'. +sorted order you are accustomed to seeing with an unqualified `set'. -\*(NT The 'ENVIRON' field, unlike most columns, is not fixed-width. +\*(NT The ENVIRON field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \*(WX characters). Even so, such variable width fields could still suffer truncation. @@ -632,7 +624,7 @@ member of a process group, called the process group leader. 14.\fB PID \*(Em Process Id \fR The task's unique process ID, which periodically wraps, though never restarting at zero. -In kernel terms, it is a dispatchable entity defined by a 'task_struct'. +In kernel terms, it is a dispatchable entity defined by a task_struct. This value may also be used as: a process group ID (\*(Xa PGRP); a session ID for the session leader (\*(Xa SID); @@ -646,8 +638,8 @@ The process ID (pid) of a task's parent. .TP 4 16.\fB PR \*(Em Priority \fR The scheduling priority of the task. -If you see 'rt' in this field, it means the task is running under -'real time' scheduling priority. +If you see `rt' in this field, it means the task is running +under real time scheduling priority. Under linux, real time priority is somewhat misleading since traditionally the operating itself was not preemptible. @@ -674,7 +666,7 @@ The status of the task which can be one of: \fBT\fR = traced or stopped \fBZ\fR = zombie -Tasks shown as running should be more properly thought of as 'ready to run' +Tasks shown as running should be more properly thought of as ready to run \*(Em their task_struct is simply represented on the Linux run-queue. Even without a true SMP machine, you may see numerous tasks in this state depending on \*(We's delay interval and nice value. @@ -705,7 +697,7 @@ The IDs of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list. -\*(NT The 'SUPGIDS' field, unlike most columns, is not fixed-width. +\*(NT The SUPGIDS field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \*(WX characters). Even so, such variable width fields could still suffer truncation. @@ -718,7 +710,7 @@ The names of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list. -\*(NT The 'SUPGRPS' field, unlike most columns, is not fixed-width. +\*(NT The SUPGRPS field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum \*(WX characters). Even so, such variable width fields could still suffer truncation. @@ -737,19 +729,19 @@ The non-resident portion of a task's address space. 28.\fB TGID \*(Em Thread Group Id \fR The ID of the thread group to which a task belongs. It is the PID of the thread group leader. -In kernel terms, it represents those tasks that share an 'mm_struct'. +In kernel terms, it represents those tasks that share an mm_struct. .TP 4 29.\fB TIME \*(Em \*(PU Time \fR Total \*(PU time the task has used since it started. -When 'Cumulative mode' is \*O, each process is listed with the \*(Pu +When Cumulative mode is \*O, each process is listed with the \*(Pu time that it and its dead children have used. -You toggle 'Cumulative mode' with 'S', which is both a \*(CO and an \*(CI. -\*(XC 'S' \*(CI for additional information regarding this mode. +You toggle Cumulative mode with `S', which is both a \*(CO and an \*(CI. +\*(XC `S' \*(CI for additional information regarding this mode. .TP 4 30.\fB TIME+ \*(Em \*(PU Time, hundredths \fR -The same as 'TIME', but reflecting more granularity through hundredths +The same as TIME, but reflecting more granularity through hundredths of a second. .TP 4 @@ -765,7 +757,7 @@ The name of the controlling terminal. This is usually the device (serial port, pty, etc.) from which the process was started, and which it uses for input or output. However, a task need not be associated with a terminal, in which case -you'll see '?' displayed. +you'll see `?' displayed. .TP 4 33.\fB UID \*(Em User Id \fR @@ -788,7 +780,7 @@ swapped out and pages that have been mapped but not used. .TP 4 37.\fB WCHAN \*(Em Sleeping in Function \fR -Depending on the availability of the kernel link map ('System.map'), this +Depending on the availability of the kernel link map (System.map), this field will show the name or the address of the kernel function in which the task is currently sleeping. Running tasks will display a dash ('\-') in this column. @@ -844,7 +836,7 @@ IP addresses, IP routing, port numbers, etc. 45.\fB nsPID \*(Em PID namespace \fR The Inode of the namespace used to isolate process ID numbers meaning they need not remain unique. -Thus, each such namespace could have its own 'init' (PID #1) to +Thus, each such namespace could have its own `init' (PID #1) to manage various initialization tasks and reap orphaned child processes. .TP 4 @@ -873,44 +865,44 @@ last update (see nMin). .\" ...................................................................... .SS 3b. MANAGING Fields .\" ---------------------------------------------------------------------- -After pressing the \*(CI 'f' or 'F' (Fields Management) you will be presented +After pressing the \*(CI `f' or `F' (Fields Management) you will be presented with a screen showing: 1) the \*(CW name; 2) the designated sort field; 3) all fields in their current order along with descriptions. Entries marked with an asterisk are the currently displayed fields, screen width permitting. .RS +4 -.jBu +.IP \(bu 3 As the on screen instructions indicate, you navigate among the fields with the\fB Up\fR and\fB Down\fR \*(KAs. The PgUp, PgDn, Home and End keys can also be used to quickly reach the first or last available field. -.jBu +.IP \(bu 3 The\fB Right\fR \*(KA selects a field for repositioning and the\fB Left\fR \*(KA or the <\fBEnter\fR> key commits that field's placement. -.jBu -The '\fBd\fR' key or the <\fBSpace\fR> bar toggles a field's display +.IP \(bu 3 +The `\fBd\fR' key or the <\fBSpace\fR> bar toggles a field's display status, and thus the presence or absence of the asterisk. -.jBu -The '\fBs\fR' key designates a field as the sort field. +.IP \(bu 3 +The `\fBs\fR' key designates a field as the sort field. \*(XT 4c. TASK AREA Commands, SORTING for additional information regarding your selection of a sort field. -.jBu -The '\fBa\fR' and '\fBw\fR' keys can be used to cycle through all available -windows and the '\fBq\fR' or <\fBEsc\fR> keys exit Fields Management. +.IP \(bu 3 +The `\fBa\fR' and `\fBw\fR' keys can be used to cycle through all available +windows and the `\fBq\fR' or <\fBEsc\fR> keys exit Fields Management. .RS -4 .PP The Fields Management screen can also be used to change the \*(CG in either \*(FM or \*(AM. -Whatever was targeted when 'q' or was pressed will be made current +Whatever was targeted when `q' or was pressed will be made current as you return to the \*(We display. -\*(XT 5. ALTERNATE\-DISPLAY Provisions and the 'g' \*(CI for insight +\*(XT 5. ALTERNATE\-DISPLAY Provisions and the `g' \*(CI for insight into \*(CWs and \*(FGs. .PP @@ -939,9 +931,9 @@ depending on the context in which they are issued. Size: #, i, n Sorting: <, >, f, F, R 4d.\fI Color-Mapping \fR - , a, B, b, H, M, q, S, T, w, z, 0 - 7 + , a, B, b, H, M, q, S, T, w, z, 0 \- 7 5b.\fI Commands-for-Windows \fR - -, _, =, +, A, a, g, G, w + \-, _, =, +, A, a, g, G, w 5c.\fI Scrolling-a-Window \fR C, Up, Dn, Left, Right, PgUp, PgDn, Home, End 5d.\fI Searching-in-a-Window \fR @@ -953,7 +945,7 @@ depending on the context in which they are issued. .\" ---------------------------------------------------------------------- The global \*(CIs are\fB always\fR available\fR in both \*(FM and \*(AM. However, some of these \*(CIs are\fB not available\fR when running -in 'Secure mode'. +in Secure mode. If you wish to know in advance whether or not your \*(We has been secured, simply ask for help and view the system summary on the second @@ -974,18 +966,18 @@ There are two help levels available. The first will provide a reminder of all the basic \*(CIs. If \*(We is\fI secured\fR, that screen will be abbreviated. -Typing 'h' or '?' on that help screen will take you to help for +Typing `h' or `?' on that help screen will take you to help for those \*(CIs applicable to \*(AM. .TP 7 \ \ \ \fB=\fR\ \ :\fIExit-Task-Limits \fR Removes restrictions on which tasks are shown. -This command will reverse any 'i' (idle tasks) and 'n' (max tasks) +This command will reverse any `i' (idle tasks) and `n' (max tasks) commands that might be active. -It also provides for an exit from pid monitoring, 'user' filtering and -'other' filtering. -See the '\-p' \*(CO for a discussion of PID monitoring, the 'U' or 'u' -\*(CIs for user filtering and the 'O' or 'o' \*(CIs for 'other' filtering. +It also provides for an exit from PID monitoring, User filtering +and Other filtering. +See the `\-p' \*(CO for a discussion of PID monitoring, the `U' or `u' +\*(CIs for User filtering and the `O' or `o' \*(CIs for Other filtering. Additionally, any window that has been scrolled will be reset with this command. @@ -1003,19 +995,19 @@ Fields like UID, GID, NI, PR or P are not affected by this toggle. .TP 7 \ \ \ \fBA\fR\ \ :\fIAlternate-Display-Mode\fR toggle \fR This command will switch between \*(FM and \*(AM. -\*(XT 5. ALTERNATE\-DISPLAY Provisions and the 'g' \*(CI for insight +\*(XT 5. ALTERNATE\-DISPLAY Provisions and the `g' \*(CI for insight into \*(CWs and \*(FGs. .TP 7 \ \ \ \fBB\fR\ \ :\fIBold-Disable/Enable\fR toggle \fR -This command will influence use of the 'bold' terminfo capability and +This command will influence use of the bold terminfo capability and alters\fB both\fR the \*(SA and \*(TA for the \*(CW. While it is intended primarily for use with dumb terminals, it can be applied anytime. \*(NT When this toggle is \*O and \*(We is operating in monochrome mode, the\fB entire display\fR will appear as normal text. -Thus, unless the 'x' and/or 'y' toggles are using reverse for emphasis, +Thus, unless the `x' and/or `y' toggles are using reverse for emphasis, there will be no visual confirmation that they are even on. .TP 7 @@ -1038,7 +1030,7 @@ With this command you can cycle through the available \*(SA memory scaling which ranges from KiB (kibibytes or 1,024 bytes) through EiB (exbibytes or 1,152,921,504,606,846,976 bytes). -If you see a '+' between a displayed number and the following label, it +If you see a `+' between a displayed number and the following label, it means that \*(We was forced to truncate some portion of that number. By raising the scaling factor, such truncation can be avoided. @@ -1053,7 +1045,7 @@ scaling might still be necessary in order to accommodate current values. If you wish to see a more homogeneous result in the memory columns, raising the scaling range will usually accomplish that goal. Raising it too high, however, is likely to produce an all zero result -which cannot be suppressed with the '0' \*(CI. +which cannot be suppressed with the `0' \*(CI. .TP 7 \ \ \ \fBg\fR\ \ :\fIChoose-Another-Window/Field-Group \fR @@ -1070,7 +1062,7 @@ Otherwise, \*(We displays a summation of all threads in each process. .TP 7 \ \ \ \fBI\fR\ \ :\fIIrix/Solaris-Mode\fR toggle \fR -When operating in 'Solaris mode' ('I' toggled \*F), a task's \*(Pu usage +When operating in Solaris mode (`I' toggled \*F), a task's \*(Pu usage will be divided by the total number of \*(PUs. After issuing this command, you'll be told the new state of this toggle. @@ -1090,6 +1082,7 @@ depending on your progress: .nf 1) at the pid prompt, type an invalid number 2) at the signal prompt, type 0 (or any invalid signal) + 3) at any prompt, type .fi .TP 7 @@ -1114,6 +1107,7 @@ depending on your progress: .nf 1) at the pid prompt, type an invalid number 2) at the nice prompt, type with no input + 3) at any prompt, type .fi .TP 7 @@ -1127,7 +1121,7 @@ restart later in exactly that same state. \ \ \ \fBX\fR\ \ :\fIExtra-Fixed-Width \fR Some fields are fixed width and not scalable. As such, they are subject to truncation which would be indicated -by a '+' in the last position. +by a `+' in the last position. This \*(CI can be used to alter the widths of the following fields: @@ -1138,7 +1132,7 @@ This \*(CI can be used to alter the widths of the following fields: SUID 5 SUSER 8 nsMNT 10 UID 5 USER 8 nsNET 10 TTY 8 nsPID 10 - nsUSR 10 + nsUSER 10 nsUTS 10 .fi @@ -1157,7 +1151,7 @@ To narrow them you must specify a smaller number or restore the defaults. .TP 7 \ \ \ \fBY\fR\ \ :\fIInspect-Other-Output \fR -After issuing the 'Y' \*(CI, you will be prompted for a target PID. +After issuing the `Y' \*(CI, you will be prompted for a target PID. Typing a value or accepting the default results in a separate screen. That screen can be used to view a variety of files or piped command output while the normal \*(We iterative display is paused. @@ -1170,18 +1164,18 @@ Most of the keys used to navigate the Inspect feature are reflected in its header prologue. There are, however, additional keys available once you have selected a particular file or command. -They are familiar to anyone who has used the pager 'less' and are +They are familiar to anyone who has used the pager `less' and are summarized here for future reference. .nf \fI key function \fR - '=' alternate status\-line, file or pipeline - '/' find, equivalent to 'L' locate - 'n' find next, equivalent to '&' locate next + = alternate status\-line, file or pipeline + / find, equivalent to `L' locate + n find next, equivalent to `&' locate next scroll down, equivalent to - 'b' scroll up, equivalent to - 'g' first line, equivalent to - 'G' last line, equivalent to + b scroll up, equivalent to + g first line, equivalent to + G last line, equivalent to .fi .TP 7 @@ -1191,7 +1185,7 @@ colors for the \*(CW, or for all windows. For details regarding this \*(CI \*(Xt 4d. COLOR Mapping. .IP "*" 3 -The commands shown with an \*(AK are not available in 'Secure mode', +The commands shown with an \*(AK are not available in Secure mode, nor will they be shown on the level-1 help screen. .\" ...................................................................... @@ -1202,7 +1196,7 @@ They affect the beginning lines of your display and will determine the position of messages and prompts. These commands always impact just the \*(CG. -\*(XT 5. ALTERNATE\-DISPLAY Provisions and the 'g' \*(CI for insight into +\*(XT 5. ALTERNATE\-DISPLAY Provisions and the `g' \*(CI for insight into \*(CWs and \*(FGs. .TP 7 @@ -1219,11 +1213,11 @@ when operating in \*(FM or the \*(CW name when operating in \*(AM. .TP 7 \ \ \ \fBt\fR\ \ :\fITask/Cpu-States\fR toggle \fR This command affects from 2 to many \*(SA lines, depending on the state -of the '1', '2' or '3' \*(CTs and whether or not \*(We is running under +of the `1', `2' or `3' \*(CTs and whether or not \*(We is running under true SMP. -This portion of the \*(SA is also influenced by the 'H' \*(CI toggle, -as reflected in the total label which shows either 'Tasks' or 'Threads'. +This portion of the \*(SA is also influenced by the `H' \*(CI toggle, +as reflected in the total label which shows either Tasks or Threads. .TP 7 \ \ \ \fBm\fR\ \ :\fIMemory/Swap-Usage\fR toggle \fR @@ -1232,18 +1226,18 @@ and virtual memory. .TP 7 \ \ \ \fB1\fR\ \ :\fISingle/Separate-Cpu-States\fR toggle \fR -This command affects how the 't' command's Cpu States portion is shown. +This command affects how the `t' command's Cpu States portion is shown. Although this toggle exists primarily to serve massively-parallel SMP machines, it is not restricted to solely SMP environments. -When you see '%Cpu(s):' in the \*(SA, the '1' toggle is \*O and all +When you see `%Cpu(s):' in the \*(SA, the `1' toggle is \*O and all \*(Pu information is gathered in a single line. -Otherwise, each \*(Pu is displayed separately as: '%Cpu0, %Cpu1, ...' +Otherwise, each \*(Pu is displayed separately as: `%Cpu0, %Cpu1, ...' up to available screen height. .TP 7 \ \ \ \fB2\fR\ \ :\fINUMA-Nodes/Cpu-Summary\fR toggle \fR -This command toggles between the '1' command cpu summary display (only) +This command toggles between the `1' command cpu summary display (only) or a summary display plus the cpu usage statistics for each NUMA Node. It is only available if a system has the requisite NUMA support. @@ -1251,7 +1245,7 @@ It is only available if a system has the requisite NUMA support. \ \ \ \fB3\fR\ \ :\fIExpand-NUMA-Node \fR You will be invited to enter a number representing a NUMA Node. Thereafter, a node summary plus the statistics for each cpu in that -node will be shown until either the '1' or '2' \*(CT is pressed. +node will be shown until either the `1' or `2' \*(CT is pressed. This \*(CI is only available if a system has the requisite NUMA support. .PP @@ -1268,10 +1262,10 @@ The \*(TA \*(CIs are\fB always\fR available in \*(FM. The \*(TA \*(CIs are\fB never available\fR in \*(AM\fI if\fR the \*(CW's \*(TD has been toggled \*F (\*(Xt 5. ALTERNATE\-DISPLAY Provisions). -.TP 2 +.PP .\" .................................................. .B APPEARANCE\fR of \*(TW -.PD 0 + .TP 7 \ \ \ \fBJ\fR\ \ :\fIJustify-Numeric-Columns\fR toggle \fR Alternates between right-justified (the default) and @@ -1289,12 +1283,12 @@ If the character data completely fills the available column, this .PP .RS +2 The following commands will also be influenced by the state of the -global 'B' (bold enable) toggle. +global `B' (bold enable) toggle. .RS -2 .TP 7 \ \ \ \fBb\fR\ \ :\fIBold/Reverse\fR toggle \fR -This command will impact how the 'x' and 'y' toggles are displayed. +This command will impact how the `x' and `y' toggles are displayed. Further, it will only be available when at least one of those toggles is \*O. .TP 7 @@ -1304,9 +1298,9 @@ If you forget which field is being sorted this command can serve as a quick visual reminder, providing the sort field is being displayed. The sort field might\fI not\fR be visible because: 1) there is insufficient\fI Screen Width \fR - 2) the 'f' \*(CI turned it \*F + 2) the `f' \*(CI turned it \*F -\*(NT Whenever 'Searching' and/or 'Other Filtering' is active in a window, +\*(NT Whenever Searching and/or Other Filtering is active in a window, column highlighting is temporarily disabled. \*(XC notes at the end of topics 5d. SEARCHING and 5e. FILTERING for an explanation why. @@ -1315,7 +1309,7 @@ explanation why. \ \ \ \fBy\fR\ \ :\fIRow-Highlight\fR toggle \fR Changes highlighting for "running" tasks. For additional insight into this task state, -\*(Xt 3a. DESCRIPTIONS of Fields, the 'S' field (Process Status). +\*(Xt 3a. DESCRIPTIONS of Fields, the `S' field (Process Status). Use of this provision provides important insight into your system's health. The only costs will be a few additional tty escape sequences. @@ -1325,15 +1319,15 @@ The only costs will be a few additional tty escape sequences. Switches the \*(CW between your last used color scheme and the older form of black-on-white or white-on-black. This command will alter\fB both\fR the \*(SA and \*(TA but does not affect -the state of the 'x', 'y' or 'b' toggles. +the state of the `x', `y' or `b' toggles. .PP .\" .................................................. .B CONTENT\fR of \*(TW -.PD 0 + .TP 7 \ \ \ \fBc\fR\ \ :\fICommand-Line/Program-Name\fR toggle \fR -This command will be honored whether or not the 'COMMAND' column +This command will be honored whether or not the COMMAND column is currently visible. Later, should that field come into view, the change you applied will be seen. @@ -1356,24 +1350,24 @@ related \*(CIs. .TP 7 \ \ \ \fBS\fR\ \ :\fICumulative-Time-Mode\fR toggle \fR -When 'Cumulative mode' is \*O, each process is listed with the \*(Pu +When Cumulative mode is \*O, each process is listed with the \*(Pu time that it and its dead children have used. When \*F, programs that fork into many separate tasks will appear less demanding. -For programs like 'init' or a shell this is appropriate but for others, +For programs like `init' or a shell this is appropriate but for others, like compilers, perhaps not. -Experiment with two \*(TWs sharing the same sort field but with different 'S' +Experiment with two \*(TWs sharing the same sort field but with different `S' states and see which representation you prefer. After issuing this command, you'll be informed of the new state of this toggle. -If you wish to know in advance whether or not 'Cumulative mode' is in +If you wish to know in advance whether or not Cumulative mode is in effect, simply ask for help and view the window summary on the second line. .TP 7 \ \ \ \fBu\fR | \fBU\fR\ \ :\fIShow-Specific-User-Only \fR You will be prompted for the\fB uid\fR or\fB name\fR of the user to display. -The '\-u' option matches on \fB effective\fR user whereas the '\-U' option +The \-u option matches on \fB effective\fR user whereas the \-U option matches on\fB any\fR user (real, effective, saved, or filesystem). Thereafter, in that \*(TW only matching users will be shown, or possibly @@ -1390,8 +1384,8 @@ command but just press at the prompt. In this mode, processes are reordered according to their parents and the layout of the COMMAND column resembles that of a tree. In forest view mode it is still possible to toggle between program -name and command line (\*(Xc 'c' \*(CI) or between processes and -threads (\*(Xc 'H' \*(CI). +name and command line (\*(Xc `c' \*(CI) or between processes and +threads (\*(Xc `H' \*(CI). \*(NT Typing any key affecting the sort order will exit forest view mode in the \*(CW. @@ -1400,7 +1394,7 @@ mode in the \*(CW. .PP .\" .................................................. .B SIZE\fR of \*(TW -.PD 0 + .TP 7 \ \ \ \fBi\fR\ \ :\fIIdle-Process\fR toggle \fR Displays all tasks or just active tasks. @@ -1425,31 +1419,33 @@ already been painted. \*(NT If you wish to increase the size of the last visible \*(TD when in \*(AM, simply decrease the size of the \*(TD(s) above it. +.PP -.TP 2 .\" .................................................. .B SORTING\fR of \*(TW +.PP +.RS +3 For compatibility, this \*(We supports most of the former \*(We sort keys. Since this is primarily a service to former \*(We users, these commands do not appear on any help screen. .nf - \fI command sorted-field supported \fR - A start time (non-display) \fB No \fR - M %MEM Yes - N PID Yes - P %CPU Yes - T TIME+ Yes + \fI command sorted-field supported \fR + A start time (non-display) \fB No \fR + M %MEM Yes + N PID Yes + P %CPU Yes + T TIME+ Yes .fi Before using any of the following sort provisions, \*(We suggests that you -temporarily turn on column highlighting using the 'x' \*(CI. +temporarily turn on column highlighting using the `x' \*(CI. That will help ensure that the actual sort environment matches your intent. The following \*(CIs will\fB only\fR be honored when the current sort field is\fB visible\fR. The sort field might\fI not\fR be visible because: - 1) there is insufficient\fI Screen Width \fR - 2) the 'f' \*(CI turned it \*F + 1) there is insufficient\fI Screen Width \fR + 2) the `f' \*(CI turned it \*F .TP 7 \ \ \ \fB<\fR\ \ :\fIMove-Sort-Field-Left \fR @@ -1462,10 +1458,8 @@ Moves the sort column to the right unless the current sort field is the last field being displayed. .PP -.in +2 The following \*(CIs will\fB always\fR be honored whether or not the current sort field is visible. -.in .TP 7 \ \ \ \fBf\fR | \fBF\fR\ \ :\fIFields-Management \fR @@ -1479,15 +1473,14 @@ when running \*(We with column highlighting turned \*F. Using this \*(CI you can alternate between high-to-low and low-to-high sorts. .PP -.in +2 \*(NT Field sorting uses internal values, not those in column display. Thus, the TTY and WCHAN fields will violate strict ASCII collating sequence. -.in +.RE .\" ...................................................................... .SS 4d. COLOR Mapping .\" ---------------------------------------------------------------------- -When you issue the 'Z' \*(CI, you will be presented with a separate screen. +When you issue the `Z' \*(CI, you will be presented with a separate screen. That screen can be used to change the colors in just the \*(CW or in all four windows before returning to the \*(We display. @@ -1497,24 +1490,25 @@ The following \*(CIs are available. \fB4\fR upper case letters to select a\fB target \fR \fB8\fR numbers to select a\fB color \fR normal toggles available \fR - 'B' :bold disable/enable - 'b' :running tasks "bold"/reverse - 'z' :color/mono + B :bold disable/enable + b :running tasks "bold"/reverse + z :color/mono other commands available \fR - 'a'/'w' :apply, then go to next/prior + a/w :apply, then go to next/prior :apply and exit - 'q' :abandon current changes and exit + q :abandon current changes and exit .fi -If you use 'a' or 'w' to cycle the targeted window, you will +If you use `a' or `w' to cycle the targeted window, you will have applied the color scheme that was displayed when you left that window. You can, of course, easily return to any window and reapply different -colors or turn colors \*F completely with the 'z' toggle. +colors or turn colors \*F completely with the `z' toggle. The Color Mapping screen can also be used to change the \*(CG in either \*(FM or \*(AM. -Whatever was targeted when 'q' or was pressed will be made current +Whatever was targeted when `q' or was pressed will be made current as you return to the \*(We display. +.PP .\" ---------------------------------------------------------------------- .SH 5. ALTERNATE\-DISPLAY Provisions @@ -1526,7 +1520,7 @@ as you return to the \*(We display. .B Field Groups/Windows\fR: In \*(FM there is a single window represented by the entire screen. That single window can still be changed to display 1 of 4 different\fB field -groups\fR (\*(Xc 'g' \*(CI, repeated below). +groups\fR (\*(Xc `g' \*(CI, repeated below). Each of the 4 \*(FGs has a unique separately configurable\fB \*(SA \fR and its own configurable\fB \*(TA\fR. @@ -1537,6 +1531,7 @@ The \*(SA will always exist, even if it's only the message line. At any given time only\fI one\fR \*(SA can be displayed. However, depending on your commands, there could be from\fI zero \fR to\fI four\fR separate \*(TDs currently showing on the screen. +.PP .TP 3 .B Current Window\fR: @@ -1547,7 +1542,7 @@ restricted for the \*(CW. A further complication arises when you have toggled the first \*(SA line \*F. -With the loss of the window name (the 'l' toggled line), you'll not easily +With the loss of the window name (the `l' toggled line), you'll not easily know what window is the \*(CW. .\" ...................................................................... @@ -1555,13 +1550,13 @@ know what window is the \*(CW. .\" ---------------------------------------------------------------------- .TP 7 \ \ \ \fB-\fR | \fB_\fR\ \ :\fIShow/Hide-Window(s)\fR toggles \fR -The '\-' key turns the \*(CW's \*(TD \*O and \*F. +The `\-' key turns the \*(CW's \*(TD \*O and \*F. When \*O, that \*(TA will show a minimum of the columns header you've -established with the 'f' \*(CI. +established with the `f' \*(CI. It will also reflect any other \*(TA options/toggles you've applied yielding zero or more tasks. -The '_' key does the same for all \*(TDs. +The `_' key does the same for all \*(TDs. In other words, it switches between the currently visible \*(TD(s) and any \*(TD(s) you had toggled \*F. If all 4 \*(TDs are currently visible, this \*(CI will leave the \*(SA @@ -1569,18 +1564,18 @@ as the only display element. .TP 7 *\ \ \fB=\fR | \fB+\fR\ \ :\fIEqualize-(reinitialize)-Window(s) \fR -The '=' key forces the \*(CW's \*(TD to be visible. -It also reverses any 'i' (idle tasks), 'n' (max tasks), 'u'/'U' (user filter) -and 'o'/'O' (other filter) commands that might be active. +The `=' key forces the \*(CW's \*(TD to be visible. +It also reverses any `i' (idle tasks), `n' (max tasks), `u/U' (user filter) +and `o/O' (other filter) commands that might be active. Also, if the window had been scrolled, it will be reset with this command. \*(XT 5c. SCROLLING a Window for additional information regarding vertical and horizontal scrolling. -The '+' key does the same for all windows. +The `+' key does the same for all windows. The four \*(TDs will reappear, evenly balanced. -They will also have retained any customizations you had previously applied, -except for the 'i' (idle tasks), 'n' (max tasks), 'u'/'U' (user filter), -'o'/'O' (other filter) and scrolling \*(CIs. +They will also have retained any customizations you had previously +applied, except for the `i' (idle tasks), `n' (max tasks), `u/U' +(user filter), `o/O' (other filter) and scrolling \*(CIs. .TP 7 *\ \ \fBA\fR\ \ :\fIAlternate-Display-Mode\fR toggle \fR @@ -1594,10 +1589,10 @@ chosen to make visible. *\ \ \fBa\fR | \fBw\fR\ \ :\fINext-Window-Forward/Backward \fR This will change the \*(CW, which in turn changes the window to which commands are directed. -These keys act in a circular fashion so you can reach any desired \*(CW +These keys act in a circular fashion so you can reach any desired window using either key. -Assuming the window name is visible (you have not toggled 'l' \*F), +Assuming the window name is visible (you have not toggled `l' \*F), whenever the \*(CW name loses its emphasis/color, that's a reminder the \*(TD is \*F and many commands will be restricted. @@ -1607,21 +1602,21 @@ You will be prompted to enter a number between 1 and 4 designating the \*(FG which should be made the \*(CW. In \*(FM, this command is necessary to alter the \*(CW. -In \*(AM, it is simply a less convenient alternative to the 'a' and 'w' +In \*(AM, it is simply a less convenient alternative to the `a' and `w' commands. .TP 7 \ \ \ \fBG\fR\ \ :\fIChange-Window/Field-Group-Name \fR You will be prompted for a new name to be applied to the \*(CW. It does not require that the window name be visible -(the 'l' toggle to be \*O). +(the `l' toggle to be \*O). .IP "*" 3 The \*(CIs shown with an \*(AK have use beyond \*(AM. .nf - \'=', 'A', 'g' are always available - \'a', 'w' act the same with color mapping - \ and fields management + =, A, g are always available + a, w act the same with color mapping + and fields management .fi .\" ...................................................................... @@ -1659,7 +1654,7 @@ Additionally, there are special provisions for any variable width field when positioned as the last displayed field. Once that field is reached via the right arrow key, and is thus the only column shown, you can continue scrolling horizontally within such a field. -\*(XC 'C' \*(CI below for additional information. +\*(XC `C' \*(CI below for additional information. .TP 4 \fBHome\fR\ \ :\fIJump-to-Home-Position \fR @@ -1689,7 +1684,7 @@ variable width column has also been scrolled. The coordinates shown as \fBn\fR/\fBn\fR are relative to the upper left corner of the \*(CW. -The additional '\fB+\ nn\fR' represents the displacement into a variable +The additional `\fB+\ nn\fR' represents the displacement into a variable width column when it has been scrolled horizontally. Such displacement occurs in normal 8 character tab stop amounts via the right and left arrow keys. @@ -1706,7 +1701,7 @@ The second \fBn\fR is updated automatically to reflect total tasks. The first \fBn\fR represents the leftmost displayed column and is controlled by \*(KSs. The second \fBn\fR is the total number of displayable fields and is -established with the '\fBf\fR' \*(CI. +established with the `\fBf\fR' \*(CI. .RS -4 .PP @@ -1732,7 +1727,7 @@ Searches are not limited to values from a single field or column. All of the values displayed in a task row are allowed in a search string. You may include spaces, numbers, symbols and even forest view artwork. -Keying with no input will effectively disable the '&' key until +Keying with no input will effectively disable the `&' key until a new search string is entered. .TP 4 @@ -1744,7 +1739,7 @@ the next occurrence. When a match is found, the current window is repositioned vertically so the task row containing that string is first. The scroll coordinates message can provide confirmation of such vertical -repositioning (\*(Xc 'C' \*(CI). +repositioning (\*(Xc `C' \*(CI). Horizontal scrolling, however, is never altered via searching. The availability of a matching string will be influenced by the following @@ -1758,7 +1753,7 @@ b. Scrolling a window vertically and/or horizontally, \*(Xt 5c. SCROLLING a Window. .TP 3 c. The state of the command/command-line toggle, -\*(Xc 'c' \*(CI. +\*(Xc `c' \*(CI. .TP 3 d. The stability of the chosen sort column, for example PID is good but %CPU bad. @@ -1767,20 +1762,21 @@ for example PID is good but %CPU bad. .PP If a search fails, restoring the \*(CW home (unscrolled) position, scrolling horizontally, displaying command-lines or choosing a more stable sort field -could yet produce a successful '&' search. +could yet produce a successful `&' search. The above \*(CIs are\fB always\fR available in \*(FM but\fB never\fR available in \*(AM if the \*(CW's \*(TD has been toggled \*F. -\*(NT Whenever a search key is typed, \*(We will turn column highlighting -\*F to prevent false matches on internal non-display escape sequences. +\*(NT Whenever a Search is active in a window, \*(We will turn +column highlighting \*F to prevent false matches on internal non-display +escape sequences. Such highlighting will be restored when a window's search string is empty. -\*(XC 'x' \*(CI for additional information on sort column highlighting. +\*(XC `x' \*(CI for additional information on sort column highlighting. .\" ...................................................................... .SS 5e. FILTERING in a Window .\" ---------------------------------------------------------------------- -You can use the 'Other Filter' feature to establish selection criteria which +You can use this Other Filter feature to establish selection criteria which will then determine which tasks are shown in the \*(CW. Establishing a filter requires: 1) a field name; 2) an operator; and @@ -1790,28 +1786,31 @@ a mistake, command recall will be your friend. Remember the Up/Down \*(KAs or their aliases when prompted for input. .B Filter Basics -.IP " . " 6 -field names are case sensitive and spelled as in the header -.IP " . " 6 -selection values need not comprise the full displayed field -.IP " . " 6 -a selection is either case insensitive or sensitive to case -.IP " . " 6 -the default is inclusion, prepending '!' denotes exclusions -.IP " . " 6 -multiple selection criteria can be applied to a \*(TW -.IP " . " 6 -inclusion and exclusion criteria can be used simultaneously -.IP " . " 6 -the 1 equality and 2 relational filters can be freely mixed -.IP " . " 6 -separate unique filters are maintained for each \*(TW -.RE +.RS +3 +.TP 3 +1. field names are case sensitive and spelled as in the header +.TP 3 +2. selection values need not comprise the full displayed field +.TP 3 +3. a selection is either case insensitive or sensitive to case +.TP 3 +4. the default is inclusion, prepending `!' denotes exclusions +.TP 3 +5. multiple selection criteria can be applied to a \*(TW +.TP 3 +6. inclusion and exclusion criteria can be used simultaneously +.TP 3 +7. the 1 equality and 2 relational filters can be freely mixed +.TP 3 +8. separate unique filters are maintained for each \*(TW +.PP If a field is not turned on or is not currently in view, then your selection criteria will not affect the display. Later, should a filtered field become visible, the selection criteria will then be applied. +.PP +.RE .B Keyboard Summary .TP 6 @@ -1824,7 +1823,7 @@ matching. You will be prompted to establish a \fBcase sensitive\fR filter. .TP 6 -\ \fB^O\fR\ \ :\fIShow-Active-Filters\fR (Ctrl key + 'o') +\ \fB^O\fR\ \ :\fIShow-Active-Filters\fR (Ctrl key + `o') This can serve as a reminder of which filters are active in the \*(CW. A summary will be shown on the message line until you press the key. @@ -1836,8 +1835,9 @@ It also has additional impact so please \*(Xt 4a. GLOBAL Commands. .TP 6 \ \ \fB+\fR\ \ :\fIReset-Filtering\fR in all windows This clears the selection criteria in all windows, assuming you are in \*(AM. -As with the '=' \*(CI, it too has additional consequences so you might wish to +As with the `=' \*(CI, it too has additional consequences so you might wish to \*(Xt 5b. COMMANDS for Windows. +.PP .RE .B Input Requirements @@ -1856,27 +1856,28 @@ These examples use spaces for clarity but your input generally would not. Items #1, #3 and #4 should be self\-explanatory. Item \fB#2\fR represents both a required \fIdelimiter\fR and the \fIoperator\fR -which must be one of either equality ('=') or relation ('<' or '>'). +which must be one of either equality (`=') or relation (`<' or `>'). -The '=' equality operator requires only a partial match and that -can reduce your 'if\-value' input requirements. -The '>' or '<' relational operators always employ string comparisons, +The `=' equality operator requires only a partial match and that +can reduce your `if\-value' input requirements. +The `>' or `<' relational operators always employ string comparisons, even with numeric fields. They are designed to work with a field's default \fIjustification\fR and with homogeneous data. When some field's numeric amounts have been subjected to \fIscaling\fR while others have not, that data is no longer homogeneous. -If you establish a relational filter and you \fBhave\fR changed the default -'Numeric' or 'Character' \fIjustification\fR, that filter is likely to fail. +If you establish a relational filter and you \fBhave\fR changed the +default Numeric or Character \fIjustification\fR, that filter is likely to fail. When a relational filter is applied to a memory field and you \fBhave not\fR changed the \fIscaling\fR, it may produce misleading results. -This happens, for example, because '100.0m' (MiB) would appear greater than -'1.000g' (GiB) when compared as strings. +This happens, for example, because `100.0m' (MiB) would appear greater +than `1.000g' (GiB) when compared as strings. If your filtered results appear suspect, simply altering justification or scaling may yet achieve the desired objective. -See the 'j', 'J' and 'e' \*(CIs for additional information. +See the `j', `J' and `e' \*(CIs for additional information. +.PP .RE .B Potential Problems @@ -1886,7 +1887,7 @@ These \fBGROUP\fR filters could produce the exact same results or the second one might not display anything at all, just a blank \*(TW. .nf GROUP=root ( only the same results when ) - GROUP=ROOT ( invoked via lower case 'o' ) + GROUP=ROOT ( invoked via lower case `o' ) .fi Either of these \fBRES\fR filters might yield inconsistent and/or @@ -1894,7 +1895,7 @@ misleading results, depending on the current memory scaling factor. Or both filters could produce the exact same results. .nf RES>9999 ( only the same results when ) - !RES<10000 ( memory scaling is at 'KiB' ) + !RES<10000 ( memory scaling is at `KiB' ) .fi This \fBnMin\fR filter illustrates a problem unique to scalable fields. @@ -1904,12 +1905,13 @@ So while amounts greater than 9999 exist, they will appear as 2.6m, 197k, etc. .nf nMin>9999 ( always a blank \*(TW ) .fi +.PP .RE .B Potential Solutions .RS +3 .P -These examples illustrate how 'Other Filtering' can be creatively +These examples illustrate how Other Filtering can be creatively applied to achieve almost any desired result. Single quotes are sometimes shown to delimit the spaces which are part of a filter or to represent a request for status (^O) accurately. @@ -1920,14 +1922,14 @@ only multi-threaded processes being shown. It also reminds us that a trailing space is part of every displayed field. The second filter achieves the exact same results with less typing. .nf - !nTH=' 1 ' ( ' for clarity only ) + !nTH=` 1 ' ( ' for clarity only ) nTH>1 ( same with less i/p ) .fi With Forest View mode active and the \fBCOMMAND\fR column in view, this filter effectively collapses child processes so that just 3 levels are shown. .nf - !COMMAND=' `- ' ( ' for clarity only ) + !COMMAND=` `- ' ( ' for clarity only ) .fi The final two filters appear as in response to the status request key (^O). @@ -1935,18 +1937,20 @@ In reality, each filter would have required separate input. The \fBPR\fR example shows the two concurrent filters necessary to display tasks with priorities of 20 or more, since some might be negative. Then by exploiting trailing spaces, the \fBnMin\fR series of filters could -achieve the failed '9999' objective discussed above. +achieve the failed `9999' objective discussed above. .nf - 'PR>20' + '!PR=-' ( 2 for right result ) - '!nMin=0 ' + '!nMin=1 ' + '!nMin=2 ' + '!nMin=3 ' ... + `PR>20' + `!PR=-' ( 2 for right result ) + `!nMin=0 ' + `!nMin=1 ' + `!nMin=2 ' + `!nMin=3 ' ... .fi -.RE +.RS -3 -\*(NT When 'Other Filtering' is active, \*(We turns column highlighting -\*F to prevent false matches on internal non-display escape sequences. +\*(NT Whenever Other Filtering is active in a window, \*(We will turn +column highlighting \*F to prevent false matches on internal non-display +escape sequences. Such highlighting will be restored when a window is no longer subject to filtering. -\*(XC 'x' \*(CI for additional information on sort column highlighting. +\*(XC `x' \*(CI for additional information on sort column highlighting. +.RE .\" ---------------------------------------------------------------------- .SH 6. FILES @@ -1954,7 +1958,7 @@ to filtering. .\" ...................................................................... .SS 6a. SYSTEM Configuration File .\" ---------------------------------------------------------------------- -The presence of this file will influence which version of the 'help' screen +The presence of this file will influence which version of the help screen is shown to an ordinary user. More importantly, it will limit what ordinary users are allowed to do when \*(We is running. @@ -1968,20 +1972,20 @@ They will not be able to issue the following commands. The system \*(CF is\fB not\fR created by \*(We. Rather, you create this file manually and place it in the \fI/etc \fR directory. -Its name must be 'toprc' and must have no leading '.' (period). +Its name must be `toprc' and must have no leading `.' (period). It must have only two lines. Here is an example of the contents of\fI /etc/toprc\fR: .nf - s # line 1: 'secure' mode switch - 5.0 # line 2: 'delay'\ \ interval in seconds + s # line 1: secure mode switch + 5.0 # line 2: delay interval in seconds .fi .\" ...................................................................... .SS 6b. PERSONAL Configuration File .\" ---------------------------------------------------------------------- -This file is written as '$HOME/.your\-name\-4\-\*(We' + 'rc'. -Use the 'W' \*(CI to create it or update it. +This file is written as `$HOME/.your\-name\-4\-\*(We' + `rc'. +Use the `W' \*(CI to create it or update it. Here is the general layout: .nf @@ -1990,9 +1994,9 @@ Here is the general layout: per ea # line a: winname,fieldscur window # line b: winflags,sortindx,maxtasks " # line c: summclr,msgsclr,headclr,taskclr - global # line 15: fixed-width incr + global # line 15: width, memory scaling & zeroes overrides " # any remaining lines are devoted to the - " # generalized 'inspect' provisions + " # generalized inspect provisions " # discussed below .fi @@ -2002,13 +2006,13 @@ personal \*(CF to the current directory, subject to permissions. .\" ...................................................................... .SS 6c. ADDING INSPECT Entries .\" ---------------------------------------------------------------------- -To exploit the 'Y' \*(CI, you must add entries at the\fB end\fR of the +To exploit the `Y' \*(CI, you must add entries at the\fB end\fR of the \*(We personal \*(CF. Such entries simply reflect a file to be read or command/pipeline to be executed whose results will then be displayed in a separate scrollable, searchable window. -If you don't know the location or name of your \*(We rcfile, use the 'W' +If you don't know the location or name of your \*(We rcfile, use the `W' \*(CI to rewrite it and note those details. Inspect entries can be added with a redirected echo or by editing the \*(CF. @@ -2017,33 +2021,33 @@ rather than append (>>) to that file. Conversely, when using an editor care must be taken not to corrupt existing lines, some of which will contain unprintable data or unusual characters. -Those Inspect entries beginning with a '#' character are ignored, regardless +Those Inspect entries beginning with a `#' character are ignored, regardless of content. Otherwise they consist of the following 3 elements, each of which\fI must\fR -be separated by a tab character (thus 2 '\\t' total): +be separated by a tab character (thus 2 `\\t' total): .nf - .type: literal 'file' or 'pipe' + .type: literal `file' or `pipe' .name: selection shown on the Inspect screen .fmts: string representing a path or command .fi The two types of Inspect entries are\fI not\fR interchangeable. -Those designated '\fBfile\fR' will be accessed using fopen and -must reference a single file in the '.fmts' element. -Entries specifying '\fBpipe\fR' will employ popen, their '.fmts' element +Those designated `\fBfile\fR' will be accessed using fopen and +must reference a single file in the `.fmts' element. +Entries specifying `\fBpipe\fR' will employ popen, their `.fmts' element could contain many pipelined commands and, none can be interactive. -If the file or pipeline represented in your '.fmts' deals with the specific PID +If the file or pipeline represented in your `.fmts' deals with the specific PID input or accepted when prompted, then the format string must also contain -the '\fB%d\fR' specifier, as these examples illustrate. +the `\fB%d\fR' specifier, as these examples illustrate. .nf .fmts= /proc/\fI%d\fR/numa_maps .fmts= lsof -P -p\fI %d\fR .fi -For '\fBpipe\fR' type entries only, you may also wish to redirect stderr to +For `\fBpipe\fR' type entries only, you may also wish to redirect stderr to stdout for a more comprehensive result. Thus the format string becomes: @@ -2053,7 +2057,7 @@ Thus the format string becomes: Here are examples of both types of Inspect entries as they might appear in the rcfile. -The first entry will be ignored due to the initial '#' character. +The first entry will be ignored due to the initial `#' character. For clarity, the pseudo tab depictions (^I) are surrounded by an extra space but the actual tabs would not be. .nf @@ -2065,9 +2069,9 @@ extra space but the actual tabs would not be. .fi Except for the commented entry above, these next examples show what could -be echoed to achieve similar results, assuming the rcfile name was '.toprc'. +be echoed to achieve similar results, assuming the rcfile name was `.toprc'. However, due to the embedded tab characters, each of these lines should be -preceded by '\fB/bin/echo \-e\fR', not just a simple an 'echo', to +preceded by `\fB/bin/echo \-e\fR', not just a simple an `echo', to enable backslash interpretation regardless of which shell you use. .nf @@ -2080,25 +2084,25 @@ enable backslash interpretation regardless of which shell you use. If any inspect entry you create produces output with unprintable characters they will be displayed in either the ^C notation or hexadecimal form, depending on their value. -This applies to tab characters as well, which will show as '^I'. +This applies to tab characters as well, which will show as `^I'. If you want a truer representation, any embedded tabs should be expanded. .nf - # next would have contained '\\t' ... + # next would have contained `\\t' ... # file ^I ^I /proc/%d/status - # but this will eliminate embedded '\\t' ... - pipe ^I ^I cat /proc/%d/status | expand - + # but this will eliminate embedded `\\t' ... + pipe ^I ^I cat /proc/%d/status | expand \- .fi -The above example takes what could have been a 'file' entry but employs -a 'pipe' instead so as to expand the embedded tabs. +The above example takes what could have been a `file' entry but employs +a `pipe' instead so as to expand the embedded tabs. -\*(NT While '\fBpipe\fR' type entries have been discussed in terms of pipelines +\*(NT While `\fBpipe\fR' type entries have been discussed in terms of pipelines and commands, there is nothing to prevent you from including \fI shell scripts\fR as well. -Perhaps even newly created scripts designed specifically for the 'Y' \*(CI. +Perhaps even newly created scripts designed specifically for the `Y' \*(CI. -Lastly, as the number of your Inspect entries grows over time, the 'Options:' +Lastly, as the number of your Inspect entries grows over time, the `Options:' row will be truncated when screen width is exceeded. That does not affect operation other than to make some selections invisible. @@ -2111,8 +2115,8 @@ there is an easy solution hinted at below. Options: help 1 2 3 4 5 6 7 8 9 10 11 ... .fi -The entries in the \*(We rcfile would have a number for the '.name' element and -the 'help' entry would identify a shell script you've written explaining what +The entries in the \*(We rcfile would have a number for the `.name' element and +the `help' entry would identify a shell script you've written explaining what those numbered selections actually mean. In that way, many more choices can be made visible. @@ -2121,7 +2125,7 @@ In that way, many more choices can be made visible. .\" ---------------------------------------------------------------------- .SH 7. STUPID TRICKS Sampler .\" ---------------------------------------------------------------------- -Many of these 'tricks' work best when you give \*(We a scheduling boost. +Many of these tricks work best when you give \*(We a scheduling boost. So plan on starting him with a nice value of \-10, assuming you've got the authority. @@ -2132,7 +2136,7 @@ the authority. For these stupid tricks, \*(We needs \*(FM. .\" ( apparently AM static was a potential concern ) -.jBu +.IP \(bu 3 The user interface, through prompts and help, intentionally implies that the delay interval is limited to tenths of a second. However, you're free to set any desired delay. @@ -2155,8 +2159,8 @@ Then do the following: What you'll see is a very busy Linux doing what he's always done for you, but there was no program available to illustrate this. -.jBu -Under an xterm using 'white-on-black' colors, on \*(We's Color Mapping screen +.IP \(bu 3 +Under an xterm using `white-on-black' colors, on \*(We's Color Mapping screen set the task color to black and be sure that task highlighting is set to bold, not reverse. Then set the delay interval to around .3 seconds. @@ -2164,10 +2168,10 @@ Then set the delay interval to around .3 seconds. After bringing the most active processes into view, what you'll see are the ghostly images of just the currently running tasks. -.jBu +.IP \(bu 3 Delete the existing rcfile, or create a new symlink. -Start this new version then type 'T' (a secret key, -\*(Xt 4c. Task Area Commands, SORTING) followed by 'W' and 'q'. +Start this new version then type `T' (a secret key, +\*(Xt 4c. Task Area Commands, SORTING) followed by `W' and `q'. Finally, restart the program with \-d0 (zero delay). Your display will be refreshed at three times the rate of the former \*(We, @@ -2180,21 +2184,21 @@ on whether or not \*(We will ever reach the \*(We. .\" ---------------------------------------------------------------------- For these stupid tricks, \*(We needs \*(AM. -.jBu +.IP \(bu 3 With 3 or 4 \*(TDs visible, pick any window other than the last -and turn idle processes \*F using the 'i' \*(CT. -Depending on where you applied 'i', sometimes several \*(TDs are bouncing and +and turn idle processes \*F using the `i' \*(CT. +Depending on where you applied `i', sometimes several \*(TDs are bouncing and sometimes it's like an accordion, as \*(We tries his best to allocate space. -.jBu +.IP \(bu 3 Set each window's summary lines differently: one with no memory ('m'); another with no states ('t'); maybe one with nothing at all, just the message line. -Then hold down 'a' or 'w' and watch a variation on bouncing windows \*(Em +Then hold down `a' or `w' and watch a variation on bouncing windows \*(Em hopping windows. -.jBu +.IP \(bu 3 Display all 4 windows and for each, in turn, set idle processes to \*F using -the 'i' \*(CT. +the `i' \*(CT. You've just entered the "extreme bounce" zone. .\" ...................................................................... @@ -2202,13 +2206,13 @@ You've just entered the "extreme bounce" zone. .\" ---------------------------------------------------------------------- This stupid trick also requires \*(AM. -.jBu +.IP \(bu 3 Display all 4 windows and make sure that 1:Def is the \*(CW. -Then, keep increasing window size with the 'n' \*(CI until all the other +Then, keep increasing window size with the `n' \*(CI until all the other \*(TDs are "pushed out of the nest". When they've all been displaced, toggle between all visible/invisible windows -using the '_' \*(CT. +using the `_' \*(CT. Then ponder this: .br is \*(We fibbing or telling honestly your imposed truth? @@ -2219,16 +2223,16 @@ Then ponder this: This stupid trick works best without \*(AM, since justification is active on a per window basis. -.jBu +.IP \(bu 3 Start \*(We and make COMMAND the last (rightmost) column displayed. -If necessary, use the 'c' \*(CT to display command lines and ensure -that forest view mode is active with the 'V' \*(CT. +If necessary, use the `c' \*(CT to display command lines and ensure +that forest view mode is active with the `V' \*(CT. Then use the up/down arrow keys to position the display so that some -truncated command lines are shown ('+' in last position). +truncated command lines are shown (`+' in last position). You may have to resize your xterm to produce truncation. -Lastly, use the 'j' \*(CT to make the COMMAND column right justified. +Lastly, use the `j' \*(CT to make the COMMAND column right justified. Now use the right arrow key to reach the COMMAND column. Continuing with the right arrow key, watch closely the direction diff --git a/top/top.c b/top/top.c index d7674956..bc755f34 100644 --- a/top/top.c +++ b/top/top.c @@ -1,6 +1,6 @@ /* top.c - Source file: show Linux processes */ /* - * Copyright (c) 2002-2013, by: James C. Warner + * Copyright (c) 2002-2014, by: James C. Warner * All rights reserved. 8921 Hilloway Road * Eden Prairie, Minnesota 55347 USA * @@ -1150,8 +1150,11 @@ static char *ioline (const char *prompt) { key = iokey(2); switch (key) { case 0: + buf[0] = '\0'; + return buf; case kbd_ESC: - buf[0] = '\0'; // fall through ! + buf[0] = kbd_ESC; + return buf; case kbd_ENTER: continue; case kbd_INS: @@ -1180,13 +1183,13 @@ static char *ioline (const char *prompt) { if (plin->bkw) { plin = plin->bkw; memset(buf, '\0', sizeof(buf)); - pos = snprintf(buf, sizeof(buf), "%s", plin->str); + pos = snprintf(buf, sizeof(buf), "%.*s", Screen_cols - beg - 1, plin->str); } break; case kbd_DOWN: memset(buf, '\0', sizeof(buf)); if (plin->fwd) plin = plin->fwd; - pos = snprintf(buf, sizeof(buf), "%s", plin->str); + pos = snprintf(buf, sizeof(buf), "%.*s", Screen_cols - beg - 1, plin->str); break; default: // what we REALLY wanted (maybe) if (isprint(key) && logCOL < bufMAX && phyCOL < Screen_cols) { @@ -1197,7 +1200,7 @@ static char *ioline (const char *prompt) { } putp(fmtmk("%s%s%s", tg2(beg, Msg_row), Cap_clr_eol, buf)); putp(tg2(beg+pos, Msg_row)); - } while (key && key != kbd_ENTER && key != kbd_ESC); + } while (key != kbd_ENTER); // weed out duplicates, including empty strings (top-of-stack)... for (i = 0, plin = anchor; ; i++) { @@ -1275,6 +1278,10 @@ static int readfile (FILE *fp, char **baddr, size_t *bsize, size_t *bread) { /*###### Small Utility routines ########################################*/ +#define GET_NUM_BAD INT_MIN +#define GET_NUM_ESC (INT_MIN + 1) +#define GET_NUM_NOT (INT_MIN + 2) + /* * Get a float from the user */ static float get_float (const char *prompt) { @@ -1282,20 +1289,18 @@ static float get_float (const char *prompt) { float f; line = ioline(prompt); - if (!line[0] || Frames_signal) return -1.0; + if (line[0] == kbd_ESC || Frames_signal) return GET_NUM_ESC; + if (!line[0]) return GET_NUM_NOT; // note: we're not allowing negative floats if (strcspn(line, "+,.0123456789")) { show_msg(N_txt(BAD_numfloat_txt)); - return -1.0; + return GET_NUM_BAD; } sscanf(line, "%f", &f); return f; } // end: get_float -#define GET_INT_BAD INT_MIN -#define GET_INTNONE (INT_MIN + 1) - /* * Get an integer from the user, returning INT_MIN for error */ static int get_int (const char *prompt) { @@ -1303,12 +1308,12 @@ static int get_int (const char *prompt) { int n; line = ioline(prompt); - if (Frames_signal) return GET_INT_BAD; - if (!line[0]) return GET_INTNONE; + if (line[0] == kbd_ESC || Frames_signal) return GET_NUM_ESC; + if (!line[0]) return GET_NUM_NOT; // note: we've got to allow negative ints (renice) if (strcspn(line, "-+0123456789")) { show_msg(N_txt(BAD_integers_txt)); - return GET_INT_BAD; + return GET_NUM_BAD; } sscanf(line, "%d", &n); return n; @@ -2518,17 +2523,15 @@ static void procs_hlp (proc_t *this) { HST_t *h; if (!this) { - static struct timeval oldtimev; - struct timeval timev; - struct timezone timez; + static double uptime_sav; + double uptime_cur; float et; void *v; - gettimeofday(&timev, &timez); - et = (timev.tv_sec - oldtimev.tv_sec) - + (float)(timev.tv_usec - oldtimev.tv_usec) / 1000000.0; - oldtimev.tv_sec = timev.tv_sec; - oldtimev.tv_usec = timev.tv_usec; + uptime(&uptime_cur, NULL); + et = uptime_cur - uptime_sav; + if (et < 0.01) et = 0.005; + uptime_sav = uptime_cur; // if in Solaris mode, adjust our scaling for all cpus Frame_etscale = 100.0f / ((float)Hertz * (float)et * (Rc.mode_irixps ? 1 : smp_num_cpus)); @@ -2920,7 +2923,9 @@ static void insp_find_str (int ch, int *col, int *row) { return; } if (ch == 'L' || ch == '/') { - snprintf(Insp_sel->fstr, FNDBUFSIZ, "%s", ioline(N_txt(GET_find_str_txt))); + char *str = ioline(N_txt(GET_find_str_txt)); + if (*str == kbd_ESC) return; + snprintf(Insp_sel->fstr, FNDBUFSIZ, "%s", str); Insp_sel->flen = strlen(Insp_sel->fstr); found = 0; } @@ -3467,7 +3472,7 @@ static void configs_read (void) { if (2 != fscanf(fp, "%3s\tfieldscur=%79s\n" , w->rc.winname, w->rc.fieldscur)) goto default_or_error; -#if PFLAGSSIZ > 80 +#if PFLAGSSIZ != 80 // too bad fscanf is not as flexible with his format string as snprintf # error Hey, fix the above fscanf 'PFLAGSSIZ' dependency ! #endif @@ -4137,7 +4142,9 @@ static void find_string (int ch) { return; } if ('L' == ch) { - snprintf(Curwin->findstr, FNDBUFSIZ, "%s", ioline(N_txt(GET_find_str_txt))); + char *str = ioline(N_txt(GET_find_str_txt)); + if (*str == kbd_ESC) return; + snprintf(Curwin->findstr, FNDBUFSIZ, "%s", str); Curwin->findlen = strlen(Curwin->findstr); found = 0; #ifndef USE_X_COLHDR @@ -4227,7 +4234,9 @@ static void other_selection (int ch) { sel = strstr; } glob = ioline(fmtmk(N_fmt(OSEL_prompts_fmt), Curwin->osel_tot + 1, typ)); - if (!snprintf(raw, sizeof(raw), "%s", glob)) return; + if (*glob == kbd_ESC + || !snprintf(raw, sizeof(raw), "%s", glob)) + return; for (osel = Curwin->osel_1st; osel; ) { if (!strcmp(osel->raw, glob)) { // #1: is criteria duplicate? show_msg(N_txt(OSEL_errdups_txt)); @@ -4345,7 +4354,7 @@ static void keys_global (int ch) { else { float tmp = get_float(fmtmk(N_fmt(DELAY_change_fmt), Rc.delay_time)); - if (-1 < tmp) Rc.delay_time = tmp; + if (tmp > -1) Rc.delay_time = tmp; } break; case 'E': @@ -4381,17 +4390,21 @@ static void keys_global (int ch) { if (Secure_mode) { show_msg(N_txt(NOT_onsecure_txt)); } else { - int pid, sig = SIGTERM, def = w->ppt[w->begtask]->tid; - if (GET_INT_BAD < (pid = get_int(fmtmk(N_txt(GET_pid2kill_fmt), def)))) { + int sig = SIGTERM, + def = w->ppt[w->begtask]->tid, + pid = get_int(fmtmk(N_txt(GET_pid2kill_fmt), def)); + if (pid > GET_NUM_ESC) { char *str; - if (0 > pid) pid = def; + if (pid == GET_NUM_NOT) pid = def; str = ioline(fmtmk(N_fmt(GET_sigs_num_fmt), pid, SIGTERM)); - if (*str) sig = signal_name_to_number(str); - if (Frames_signal) break; - if (0 < sig && kill(pid, sig)) - show_msg(fmtmk(N_fmt(FAIL_signals_fmt) - , pid, sig, strerror(errno))); - else if (0 > sig) show_msg(N_txt(BAD_signalid_txt)); + if (*str != kbd_ESC) { + if (*str) sig = signal_name_to_number(str); + if (Frames_signal) break; + if (0 < sig && kill(pid, sig)) + show_msg(fmtmk(N_fmt(FAIL_signals_fmt) + , pid, sig, strerror(errno))); + else if (0 > sig) show_msg(N_txt(BAD_signalid_txt)); + } } } break; @@ -4399,21 +4412,24 @@ static void keys_global (int ch) { if (Secure_mode) show_msg(N_txt(NOT_onsecure_txt)); else { - int val, pid, def = w->ppt[w->begtask]->tid; - if (GET_INT_BAD < (pid = get_int(fmtmk(N_txt(GET_pid2nice_fmt), def)))) { - if (0 > pid) pid = def; - if (GET_INTNONE < (val = get_int(fmtmk(N_fmt(GET_nice_num_fmt), pid)))) - if (setpriority(PRIO_PROCESS, (unsigned)pid, val)) - show_msg(fmtmk(N_fmt(FAIL_re_nice_fmt) - , pid, val, strerror(errno))); + int val, + def = w->ppt[w->begtask]->tid, + pid = get_int(fmtmk(N_txt(GET_pid2nice_fmt), def)); + if (pid > GET_NUM_ESC) { + if (pid == GET_NUM_NOT) pid = def; + val = get_int(fmtmk(N_fmt(GET_nice_num_fmt), pid)); + if (val > GET_NUM_NOT + && setpriority(PRIO_PROCESS, (unsigned)pid, val)) + show_msg(fmtmk(N_fmt(FAIL_re_nice_fmt) + , pid, val, strerror(errno))); } } break; case 'X': { int wide = get_int(fmtmk(N_fmt(XTRA_fixwide_fmt), Rc.fixed_widest)); - if (GET_INTNONE < wide) { - if (-1 < wide) Rc.fixed_widest = wide; - else if (INT_MIN < wide) Rc.fixed_widest = -1; + if (wide > GET_NUM_NOT) { + if (wide > -1) Rc.fixed_widest = wide; + else Rc.fixed_widest = -1; } } break; @@ -4421,9 +4437,10 @@ static void keys_global (int ch) { if (!Inspect.total) ioline(N_txt(YINSP_noents_txt)); else { - int pid, def = w->ppt[w->begtask]->tid; - if (GET_INT_BAD < (pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def)))) { - if (0 > pid) pid = def; + int def = w->ppt[w->begtask]->tid, + pid = get_int(fmtmk(N_fmt(YINSP_pidsee_fmt), def)); + if (pid > GET_NUM_ESC) { + if (pid == GET_NUM_NOT) pid = def; if (pid) inspection_utility(pid); } } @@ -4469,7 +4486,7 @@ static void keys_summary (int ch) { show_msg(N_txt(NUMA_nodenot_txt)); else { int num = get_int(fmtmk(N_fmt(NUMA_nodeget_fmt), Numa_node_tot -1)); - if (GET_INTNONE < num) { + if (num > GET_NUM_NOT) { if (num >= 0 && num < Numa_node_tot) { Numa_node_sel = num; SETw(w, View_CPUNOD | View_STATES); @@ -4505,7 +4522,7 @@ static void keys_task (int ch) { case 'n': if (VIZCHKw(w)) { int num = get_int(fmtmk(N_fmt(GET_max_task_fmt), w->rc.maxtasks)); - if (GET_INTNONE < num) { + if (num > GET_NUM_NOT) { if (-1 < num ) w->rc.maxtasks = num; else show_msg(N_txt(BAD_max_task_txt)); } @@ -4603,9 +4620,10 @@ static void keys_task (int ch) { case 'U': case 'u': if (VIZCHKw(w)) { - const char *errmsg; - if ((errmsg = user_certify(w, ioline(N_txt(GET_user_ids_txt)), ch))) - show_msg(errmsg); + const char *errmsg, *str = ioline(N_txt(GET_user_ids_txt)); + if (*str != kbd_ESC + && (errmsg = user_certify(w, str, ch))) + show_msg(errmsg); } break; case 'V': @@ -4688,7 +4706,7 @@ static void keys_window (int ch) { if (ALTCHKw) { char tmp[SMLBUFSIZ]; STRLCPY(tmp, ioline(fmtmk(N_fmt(NAME_windows_fmt), w->rc.winname))); - if (tmp[0]) win_names(w, tmp); + if (tmp[0] && tmp[0] != kbd_ESC) win_names(w, tmp); } break; case kbd_UP: diff --git a/top/top.h b/top/top.h index 5d1aeadd..836b9fb9 100644 --- a/top/top.h +++ b/top/top.h @@ -1,6 +1,6 @@ /* top.h - Header file: show Linux processes */ /* - * Copyright (c) 2002-2013, by: James C. Warner + * Copyright (c) 2002-2014, by: James C. Warner * All rights reserved. 8921 Hilloway Road * Eden Prairie, Minnesota 55347 USA * diff --git a/top/top_nls.c b/top/top_nls.c index b47459af..ea1c0887 100644 --- a/top/top_nls.c +++ b/top/top_nls.c @@ -1,6 +1,6 @@ /* top_nls.c - provide the basis for future nls translations */ /* - * Copyright (c) 2011-2013, by: James C. Warner + * Copyright (c) 2011-2014, by: James C. Warner * All rights reserved. 8921 Hilloway Road * Eden Prairie, Minnesota 55347 USA * @@ -129,31 +129,31 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum 'UID' = 5 */ Head_nlstab[EU_UED] = _("UID"); Desc_nlstab[EU_UED] = _("Effective User Id"); -/* Translation Hint: maximum 'USER' = 8 */ +/* Translation Hint: maximum 'USER' = 7 */ Head_nlstab[EU_UEN] = _("USER"); Desc_nlstab[EU_UEN] = _("Effective User Name"); /* Translation Hint: maximum 'RUID' = 5 */ Head_nlstab[EU_URD] = _("RUID"); Desc_nlstab[EU_URD] = _("Real User Id"); -/* Translation Hint: maximum 'RUSER' = 8 */ +/* Translation Hint: maximum 'RUSER' = 7 */ Head_nlstab[EU_URN] = _("RUSER"); Desc_nlstab[EU_URN] = _("Real User Name"); /* Translation Hint: maximum 'SUID' = 5 */ Head_nlstab[EU_USD] = _("SUID"); Desc_nlstab[EU_USD] = _("Saved User Id"); -/* Translation Hint: maximum 'SUSER' = 8 */ +/* Translation Hint: maximum 'SUSER' = 7 */ Head_nlstab[EU_USN] = _("SUSER"); Desc_nlstab[EU_USN] = _("Saved User Name"); /* Translation Hint: maximum 'GID' = 5 */ Head_nlstab[EU_GID] = _("GID"); Desc_nlstab[EU_GID] = _("Group Id"); -/* Translation Hint: maximum 'GROUP' = 8 */ +/* Translation Hint: maximum 'GROUP' = 7 */ Head_nlstab[EU_GRP] = _("GROUP"); Desc_nlstab[EU_GRP] = _("Group Name"); /* Translation Hint: maximum 'PGRP' = 5 */ Head_nlstab[EU_PGD] = _("PGRP"); Desc_nlstab[EU_PGD] = _("Process Group Id"); -/* Translation Hint: maximum 'TTY' = 8 */ +/* Translation Hint: maximum 'TTY' = 7 */ Head_nlstab[EU_TTY] = _("TTY"); Desc_nlstab[EU_TTY] = _("Controlling Tty"); /* Translation Hint: maximum 'TPGID' = 5 */ @@ -180,7 +180,7 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum '' = 6 */ Head_nlstab[EU_TME] = _("TIME"); Desc_nlstab[EU_TME] = _("CPU Time"); -/* Translation Hint: maximum 'TIME+' = 9 */ +/* Translation Hint: maximum 'TIME+' = 7 */ Head_nlstab[EU_TM2] = _("TIME+"); Desc_nlstab[EU_TM2] = _("CPU Time, hundredths"); /* Translation Hint: maximum '%MEM' = 4 */ @@ -222,7 +222,7 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum 'WCHAN' = 7 */ Head_nlstab[EU_WCH] = _("WCHAN"); Desc_nlstab[EU_WCH] = _("Sleeping in Function"); -/* Translation Hint: maximum 'Flags' = 8 */ +/* Translation Hint: maximum 'Flags' = 7 */ Head_nlstab[EU_FLG] = _("Flags"); Desc_nlstab[EU_FLG] = _("Task Flags "); /* Translation Hint: maximum 'CGROUPS' = 7 */ @@ -241,7 +241,7 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum 'Adj' = 3 */ Head_nlstab[EU_OOA] = _("Adj"); Desc_nlstab[EU_OOA] = _("oom_adjustment (2^X)"); -/* Translation Hint: maximum 'Badness' = 8 */ +/* Translation Hint: maximum 'Badness' = 7 */ Head_nlstab[EU_OOM] = _("Badness"); Desc_nlstab[EU_OOM] = _("oom_score (badness)"); #endif @@ -259,22 +259,22 @@ static void build_two_nlstabs (void) { /* Translation Hint: maximum 'USED' = 4 */ Head_nlstab[EU_USE] = _("USED"); Desc_nlstab[EU_USE] = _("Res+Swap Size (KiB)"); -/* Translation Hint: maximum 'nsIPC' = 10 */ +/* Translation Hint: maximum 'nsIPC' = 7 */ Head_nlstab[EU_NS1] = _("nsIPC"); Desc_nlstab[EU_NS1] = _("IPC namespace Inode"); -/* Translation Hint: maximum 'nsMNT' = 10 */ +/* Translation Hint: maximum 'nsMNT' = 7 */ Head_nlstab[EU_NS2] = _("nsMNT"); Desc_nlstab[EU_NS2] = _("MNT namespace Inode"); -/* Translation Hint: maximum 'nsNET' = 10 */ +/* Translation Hint: maximum 'nsNET' = 7 */ Head_nlstab[EU_NS3] = _("nsNET"); Desc_nlstab[EU_NS3] = _("NET namespace Inode"); -/* Translation Hint: maximum 'nsPID' = 10 */ +/* Translation Hint: maximum 'nsPID' = 7 */ Head_nlstab[EU_NS4] = _("nsPID"); Desc_nlstab[EU_NS4] = _("PID namespace Inode"); -/* Translation Hint: maximum 'nsUSER' = 10 */ +/* Translation Hint: maximum 'nsUSER' = 7 */ Head_nlstab[EU_NS5] = _("nsUSER"); Desc_nlstab[EU_NS5] = _("USER namespace Inode"); -/* Translation Hint: maximum 'nsUTS' = 10 */ +/* Translation Hint: maximum 'nsUTS' = 7 */ Head_nlstab[EU_NS6] = _("nsUTS"); Desc_nlstab[EU_NS6] = _("UTS namespace Inode"); } diff --git a/top/top_nls.h b/top/top_nls.h index 1b6d5756..9010263e 100644 --- a/top/top_nls.h +++ b/top/top_nls.h @@ -1,6 +1,6 @@ /* top_nls.h - provide the basis for future nls translations */ /* - * Copyright (c) 2011-2013, by: James C. Warner + * Copyright (c) 2011-2014, by: James C. Warner * All rights reserved. 8921 Hilloway Road * Eden Prairie, Minnesota 55347 USA * diff --git a/vmstat.8 b/vmstat.8 index 2782a427..420d9f39 100644 --- a/vmstat.8 +++ b/vmstat.8 @@ -102,8 +102,7 @@ b: The number of processes in uninterruptible sleep. swpd: the amount of virtual memory used. free: the amount of idle memory. buff: the amount of memory used as buffers. -cache: the amount of memory used as cache (excluding tmpfs memory for -kernels 2.6.32+) +cache: the amount of memory used as cache. inact: the amount of inactive memory. (\-a option) active: the amount of active memory. (\-a option) .fi