top: man page tabs and such, go faster, quit w/ q
This commit is contained in:
parent
bc9cdacdcc
commit
e3dd77d439
14
top.1
14
top.1
@ -7,7 +7,7 @@
|
|||||||
. any later version published by the Free Software Foundation;
|
. any later version published by the Free Software Foundation;
|
||||||
. with no Front-Cover Texts, no Back-Cover Texts, and with the following
|
. with no Front-Cover Texts, no Back-Cover Texts, and with the following
|
||||||
. Invariant Sections (and any sub-sections therein):
|
. Invariant Sections (and any sub-sections therein):
|
||||||
. this .ig-section
|
. all .ig sections, including this one
|
||||||
. DIFFERENCES / New Features
|
. DIFFERENCES / New Features
|
||||||
. STUPID TRICKS Sampler
|
. STUPID TRICKS Sampler
|
||||||
. NOTES and Rantings
|
. NOTES and Rantings
|
||||||
@ -28,7 +28,7 @@
|
|||||||
.ll +(\n[half_xtra] + \n[half_xtra])
|
.ll +(\n[half_xtra] + \n[half_xtra])
|
||||||
.
|
.
|
||||||
\# Special right justify macros ---------------------
|
\# Special right justify macros ---------------------
|
||||||
\# - right justify start
|
\# - right justify begin
|
||||||
.de Rjb
|
.de Rjb
|
||||||
.ll -\n[half_xtra]
|
.ll -\n[half_xtra]
|
||||||
.rj \\$1
|
.rj \\$1
|
||||||
@ -370,7 +370,7 @@ for a successful\fB close-encounter-of-the-1st-kind\fR with \*(Us.
|
|||||||
You need remember just the\fB help key\fR ('h' or '?') to survive
|
You need remember just the\fB help key\fR ('h' or '?') to survive
|
||||||
\*(EM nay, prosper!
|
\*(EM nay, prosper!
|
||||||
What about quitting, you ask?
|
What about quitting, you ask?
|
||||||
Well, of course there's the 'Q' \*(CI, but then \*(Me does quite well
|
Well, of course there's the 'q' \*(CI, but then \*(Me does quite well
|
||||||
with\fB signals\fR.
|
with\fB signals\fR.
|
||||||
So just zap him with the traditional \fI^C\fR when you're done.
|
So just zap him with the traditional \fI^C\fR when you're done.
|
||||||
.br
|
.br
|
||||||
@ -794,7 +794,7 @@ Some commands appear more than once \*(EM their meaning or scope may vary
|
|||||||
depending on the context in which they are issued.
|
depending on the context in which they are issued.
|
||||||
|
|
||||||
3a.\fI GLOBAL_Commands\fR
|
3a.\fI GLOBAL_Commands\fR
|
||||||
<Ret>, <Sp> ?, =, A, d, G, h, I, k, Q, r, s, W, Z
|
<Ret>, <Sp> ?, =, A, d, G, h, I, k, q, r, s, W, Z
|
||||||
3b.\fI SUMMARY_Area_Commands\fR
|
3b.\fI SUMMARY_Area_Commands\fR
|
||||||
l, m, t, 1
|
l, m, t, 1
|
||||||
3c.\fI TASK_Area_Commands\fR
|
3c.\fI TASK_Area_Commands\fR
|
||||||
@ -894,11 +894,7 @@ depending on your progress:
|
|||||||
2) at the\fB signal\fR prompt, type 0
|
2) at the\fB signal\fR prompt, type 0
|
||||||
|
|
||||||
.TP 7
|
.TP 7
|
||||||
\ \ \'\fBQ\fR\' :\fIQuit\fR
|
\ \ \'\fBq\fR\' :\fIQuit\fR
|
||||||
Please note that this is a capital \'Q' since the 'a' and 'w' keys will
|
|
||||||
probably be used frequently and they are adjacent to 'q'.
|
|
||||||
This \*(Me cares deeply for you and does not want you quitting ever \*(EM
|
|
||||||
make that accidentally.
|
|
||||||
|
|
||||||
.TP 7
|
.TP 7
|
||||||
*\ \'\fBr\fR\' :\fIRenice_a_Task\fR
|
*\ \'\fBr\fR\' :\fIRenice_a_Task\fR
|
||||||
|
11
top.c
11
top.c
@ -732,11 +732,12 @@ static char *scale_tics (TICS_t tics, const unsigned width)
|
|||||||
unsigned i, t;
|
unsigned i, t;
|
||||||
|
|
||||||
/* try successively higher units until it fits */
|
/* try successively higher units until it fits */
|
||||||
t = tics / Hertz;
|
t = (tics * 100) / (TICS_t)Hertz;
|
||||||
sprintf(buf, "%u:%02u.%02u" /* mins:secs.hundredths */
|
sprintf(buf, "%u:%02u.%02u" /* mins:secs.hundredths */
|
||||||
, t / 60, t % 60, (unsigned)((tics * 100) / Hertz) % 100);
|
, t / 6000, (t / 100) % 60, t % 100);
|
||||||
if (strlen(buf) <= width)
|
if (strlen(buf) <= width)
|
||||||
return buf;
|
return buf;
|
||||||
|
t /= 100;
|
||||||
|
|
||||||
sprintf(buf, "%u:%02u", t / 60, t % 60); /* minutes:seconds */
|
sprintf(buf, "%u:%02u", t / 60, t % 60); /* minutes:seconds */
|
||||||
if (strlen(buf) <= width)
|
if (strlen(buf) <= width)
|
||||||
@ -1783,7 +1784,7 @@ static void frame_states (proc_t **ppt, int show)
|
|||||||
}
|
}
|
||||||
/* finally calculate an integer version of %cpu for this task
|
/* finally calculate an integer version of %cpu for this task
|
||||||
and plug it into the unfilled slot in proc_t */
|
and plug it into the unfilled slot in proc_t */
|
||||||
this->pcpu = (tics * 1000 / Hertz) / etime;
|
this->pcpu = (tics * 1000 / (TICS_t)Hertz) / etime;
|
||||||
if (this->pcpu > 999) this->pcpu = 999;
|
if (this->pcpu > 999) this->pcpu = 999;
|
||||||
/* if in Solaris mode, adjust cpu percentage not only for the cpu
|
/* if in Solaris mode, adjust cpu percentage not only for the cpu
|
||||||
the process is running on, but for all cpus together */
|
the process is running on, but for all cpus together */
|
||||||
@ -2276,11 +2277,7 @@ static void do_key (unsigned c)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef QUIT_NORMALQ
|
|
||||||
case 'q':
|
case 'q':
|
||||||
#else
|
|
||||||
case 'Q':
|
|
||||||
#endif
|
|
||||||
stop(0);
|
stop(0);
|
||||||
|
|
||||||
case 'r':
|
case 'r':
|
||||||
|
8
top.h
8
top.h
@ -28,7 +28,6 @@
|
|||||||
//#define CASEUP_SCALE /* show scaled time/num suffix upper case */
|
//#define CASEUP_SCALE /* show scaled time/num suffix upper case */
|
||||||
//#define CASEUP_SUMMK /* show memory summary kilobytes with 'K' */
|
//#define CASEUP_SUMMK /* show memory summary kilobytes with 'K' */
|
||||||
//#define POSIX_CMDLIN /* use '[ ]' for kernel threads, not '( )' */
|
//#define POSIX_CMDLIN /* use '[ ]' for kernel threads, not '( )' */
|
||||||
//#define QUIT_NORMALQ /* use 'q' to quit, not new default 'Q' */
|
|
||||||
//#define SORT_SUPRESS /* *attempt* to reduce qsort overhead */
|
//#define SORT_SUPRESS /* *attempt* to reduce qsort overhead */
|
||||||
//#define TICS_64_BITS /* accommodate Linux 2.5.xx 64-bit jiffies */
|
//#define TICS_64_BITS /* accommodate Linux 2.5.xx 64-bit jiffies */
|
||||||
//#define UNEQUAL_SORT /* use pid's as a secondary sort key */
|
//#define UNEQUAL_SORT /* use pid's as a secondary sort key */
|
||||||
@ -350,11 +349,6 @@ typedef struct win {
|
|||||||
|
|
||||||
/* Keyboard Help specially formatted string(s) --
|
/* Keyboard Help specially formatted string(s) --
|
||||||
see 'show_special' for syntax details + other cautions. */
|
see 'show_special' for syntax details + other cautions. */
|
||||||
#ifdef QUIT_NORMALQ
|
|
||||||
#define HELP_Qkey " q "
|
|
||||||
#else
|
|
||||||
#define HELP_Qkey " Q "
|
|
||||||
#endif
|
|
||||||
#define KEYS_help \
|
#define KEYS_help \
|
||||||
"Help for Interactive Commands\02 - %s\n" \
|
"Help for Interactive Commands\02 - %s\n" \
|
||||||
"Window \01%s\06: \01Cumulative mode \03%s\02. \01System\06: \01Delay \03%.1f secs\02; \01Secure mode \03%s\02.\n" \
|
"Window \01%s\06: \01Cumulative mode \03%s\02. \01System\06: \01Delay \03%.1f secs\02; \01Secure mode \03%s\02.\n" \
|
||||||
@ -375,7 +369,7 @@ typedef struct win {
|
|||||||
"\n" \
|
"\n" \
|
||||||
"%s" \
|
"%s" \
|
||||||
" W Write configuration file\n" \
|
" W Write configuration file\n" \
|
||||||
HELP_Qkey "Quit\n" \
|
" q Quit\n" \
|
||||||
" ( commands shown with '.' require a \01visible\02 task display \01window\02 ) \n" \
|
" ( commands shown with '.' require a \01visible\02 task display \01window\02 ) \n" \
|
||||||
"Press '\01h\02' or '\01?\02' for help with \01Windows\02,\n" \
|
"Press '\01h\02' or '\01?\02' for help with \01Windows\02,\n" \
|
||||||
"any other key to continue " \
|
"any other key to continue " \
|
||||||
|
Loading…
Reference in New Issue
Block a user