top: add the field 'USED' to top's existing repertoire
After revisiting the issue of a new field, combining 2 existing fields (RES and SWAP), I've decided it indeed makes sense. After all, with the vastly expanded field capability and the ease of adding new fields, it would save some precious horizontal screen real estate while also eliminating some mental/manual user calculations. (everything is perfectly justified plus right margins) (are completely filled, but of course it must be luck) Reference(s): http://www.freelists.org/post/procps/top-enhancements-i-hope http://www.freelists.org/post/procps/top-regression-reports Signed-off-by: Jim Warner <james.warner@comcast.net> top/top.1 | 23 ++++++++++++++--------- top/top.c | 14 ++++++++++++-- top/top.h | 6 ++++++ top/top_nls.c | 3 +++ 4 files changed, 35 insertions(+), 11 deletions(-)
This commit is contained in:
committed by
Jaromir Capik
parent
9dd7251ca3
commit
709785e20b
@ -185,6 +185,7 @@ enum pflag {
|
||||
#endif
|
||||
P_ENV,
|
||||
P_FV1, P_FV2,
|
||||
P_USE,
|
||||
#ifdef USE_X_COLHDR
|
||||
// not really pflags, used with tbl indexing
|
||||
P_MAXPFLGS
|
||||
@ -462,6 +463,11 @@ typedef struct WIN_t {
|
||||
if ( (*P)->n < (*Q)->n ) return SORT_lt; \
|
||||
if ( (*P)->n > (*Q)->n ) return SORT_gt; \
|
||||
return SORT_eq; }
|
||||
#define SCB_NUM2(f,n1,n2) \
|
||||
static int SCB_NAME(f) (const proc_t **P, const proc_t **Q) { \
|
||||
if ( ((*P)->n1+(*P)->n2) < ((*Q)->n1+(*Q)->n2) ) return SORT_lt; \
|
||||
if ( ((*P)->n1+(*P)->n2) > ((*Q)->n1+(*Q)->n2) ) return SORT_gt; \
|
||||
return SORT_eq; }
|
||||
#define SCB_NUMx(f,n) \
|
||||
static int SCB_NAME(f) (const proc_t **P, const proc_t **Q) { \
|
||||
return Frame_srtflg * ( (*Q)->n - (*P)->n ); }
|
||||
|
Reference in New Issue
Block a user