top: cosmetic changes with two abreast summary display <=== port of newlib bf916fdf
______________________________ original newlib message This commit will change some comments, adjust a little whitespace but mostly rename some #define identifiers. Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
parent
ad8a8bee17
commit
729a25ee1c
13
top/top.c
13
top/top.c
@ -255,8 +255,8 @@ static int Numa_node_sel = -1;
|
|||||||
commands -- which are now both 4-way toggles */
|
commands -- which are now both 4-way toggles */
|
||||||
#define GRAPH_length_max 100 // the actual bars or blocks
|
#define GRAPH_length_max 100 // the actual bars or blocks
|
||||||
#define GRAPH_length_min 10 // the actual bars or blocks
|
#define GRAPH_length_min 10 // the actual bars or blocks
|
||||||
#define GRAPH_prefix_std 25 // '%Cpunnn: 100.0/100.0 100[' or 'nnn-nnn: 100.0/100.0 100['
|
#define GRAPH_prefix_std 25 // '.......: 100.0/100.0 100['
|
||||||
#define GRAPH_prefix_abv 12 // '%Cpunnn:100[' or 'nnn-nnn:100[' or 'GiB Mem 100[' or 'GiB Swap 99['
|
#define GRAPH_prefix_abv 12 // '.......:100['
|
||||||
#define GRAPH_suffix 2 // '] ' (bracket + trailing space)
|
#define GRAPH_suffix 2 // '] ' (bracket + trailing space)
|
||||||
// first 3 more static (adj_geometry), last 3 volatile (sum_tics/do_memory)
|
// first 3 more static (adj_geometry), last 3 volatile (sum_tics/do_memory)
|
||||||
struct graph_parms {
|
struct graph_parms {
|
||||||
@ -278,11 +278,11 @@ static const char Osel_filterO_fmt[] = "\ttype=%d,\t" OSEL_FILTER "%s\n";
|
|||||||
static const char Osel_filterI_fmt[] = "\ttype=%d,\t" OSEL_FILTER "%*s\n";
|
static const char Osel_filterI_fmt[] = "\ttype=%d,\t" OSEL_FILTER "%*s\n";
|
||||||
|
|
||||||
/* Support for adjoining display (if terminal is wide enough) */
|
/* Support for adjoining display (if terminal is wide enough) */
|
||||||
#ifdef TOG4_OFF_SEP
|
#ifdef TOG4_SEP_OFF
|
||||||
static char Adjoin_sp[] = " ";
|
static char Adjoin_sp[] = " ";
|
||||||
#define ADJOIN_space (sizeof(Adjoin_sp) - 1)
|
#define ADJOIN_space (sizeof(Adjoin_sp) - 1)
|
||||||
#else
|
#else
|
||||||
#ifdef TOG4_STD_SEP
|
#ifdef TOG4_SEP_STD
|
||||||
static char Adjoin_sp[] = "~1 ~6 ";
|
static char Adjoin_sp[] = "~1 ~6 ";
|
||||||
#else
|
#else
|
||||||
static char Adjoin_sp[] = " ~6 ~1";
|
static char Adjoin_sp[] = " ~6 ~1";
|
||||||
@ -6530,7 +6530,7 @@ static void do_memory (void) {
|
|||||||
#define mkM(x) (float)kb_main_ ## x / scT(div)
|
#define mkM(x) (float)kb_main_ ## x / scT(div)
|
||||||
#define mkS(x) (float)kb_swap_ ## x / scT(div)
|
#define mkS(x) (float)kb_swap_ ## x / scT(div)
|
||||||
#define prT(b,z) { if (9 < snprintf(b, 10, scT(fmts), z)) b[8] = '+'; }
|
#define prT(b,z) { if (9 < snprintf(b, 10, scT(fmts), z)) b[8] = '+'; }
|
||||||
#ifdef TOG4_OFF_MEM
|
#ifdef TOG4_MEM_1UP
|
||||||
#define mem2UP 1
|
#define mem2UP 1
|
||||||
#else
|
#else
|
||||||
#define mem2UP 0
|
#define mem2UP 0
|
||||||
@ -6584,8 +6584,7 @@ static void do_memory (void) {
|
|||||||
rx = sum_rx(Graph_mems);
|
rx = sum_rx(Graph_mems);
|
||||||
prT(bfT(0), mkM(total));
|
prT(bfT(0), mkM(total));
|
||||||
snprintf(row, sizeof(row), "%s %s:~3%#5.1f~2/%-9.9s~3%s"
|
snprintf(row, sizeof(row), "%s %s:~3%#5.1f~2/%-9.9s~3%s"
|
||||||
, scT(label), N_txt(WORD_abv_mem_txt), rx->pcnt_tot, bfT(0)
|
, scT(label), N_txt(WORD_abv_mem_txt), rx->pcnt_tot, bfT(0), rx->graph);
|
||||||
, rx->graph);
|
|
||||||
Msg_row += sum_see(row, mem2UP);
|
Msg_row += sum_see(row, mem2UP);
|
||||||
|
|
||||||
Graph_mems->total = kb_swap_total;
|
Graph_mems->total = kb_swap_total;
|
||||||
|
10
top/top.h
10
top/top.h
@ -64,9 +64,9 @@
|
|||||||
//#define SCROLLV_BY_1 /* when scrolling left/right do not move 8 */
|
//#define SCROLLV_BY_1 /* when scrolling left/right do not move 8 */
|
||||||
//#define STRINGCASENO /* case insenstive compare/locate versions */
|
//#define STRINGCASENO /* case insenstive compare/locate versions */
|
||||||
//#define TERMIOS_ONLY /* use native input only (just limp along) */
|
//#define TERMIOS_ONLY /* use native input only (just limp along) */
|
||||||
//#define TOG4_OFF_MEM /* don't show two abreast memory statistic */
|
//#define TOG4_MEM_1UP /* don't show two abreast memory statistic */
|
||||||
//#define TOG4_OFF_SEP /* don't show two abreast visual separator */
|
//#define TOG4_SEP_OFF /* don't show two abreast visual separator */
|
||||||
//#define TOG4_STD_SEP /* normal mem sep if 2 abreast & no graphs */
|
//#define TOG4_SEP_STD /* normal mem sep if 2 abreast & no graphs */
|
||||||
//#define TREE_NORESET /* sort keys should not force 'V' view off */
|
//#define TREE_NORESET /* sort keys should not force 'V' view off */
|
||||||
//#define TREE_SCANALL /* rescan array w/ forest view, avoid sort */
|
//#define TREE_SCANALL /* rescan array w/ forest view, avoid sort */
|
||||||
//#define TREE_VALTMRK /* use an indented '+' with collapsed pids */
|
//#define TREE_VALTMRK /* use an indented '+' with collapsed pids */
|
||||||
@ -700,8 +700,8 @@ typedef struct WIN_t {
|
|||||||
#if defined(SCALE_FORMER) && defined(SCALE_POSTFX)
|
#if defined(SCALE_FORMER) && defined(SCALE_POSTFX)
|
||||||
# warning 'SCALE_POSTFX' is ignored when 'SCALE_FORMER' is active
|
# warning 'SCALE_POSTFX' is ignored when 'SCALE_FORMER' is active
|
||||||
#endif
|
#endif
|
||||||
#if defined(TOG4_STD_SEP) && defined(TOG4_OFF_SEP)
|
#if defined(TOG4_SEP_STD) && defined(TOG4_SEP_OFF)
|
||||||
# warning 'TOG4_STD_SEP' has no effect when 'TOG4_OFF_SEP' is active
|
# warning 'TOG4_SEP_STD' has no effect when 'TOG4_SEP_OFF' is active
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*###### Some Prototypes (ha!) #########################################*/
|
/*###### Some Prototypes (ha!) #########################################*/
|
||||||
|
Loading…
Reference in New Issue
Block a user