From ffeef984991b8e21e3d853727a6461514c02a6e8 Mon Sep 17 00:00:00 2001 From: Jim Warner Date: Wed, 28 Sep 2016 13:13:13 -0500 Subject: [PATCH] top: adapt for loss of fields obsoleted with linux 2.6 It would have been nice to remove this 'nDRT' guy from the fields management screen and man document as well. But, while this version of top could be made to handle an older rcfile, the reverse would not have been true. Besides, it's been zero for so long already we'll just include a 'deprecated' note in top's man page for now. [ the 'nTH ' field number was corrected in there too ] Signed-off-by: Jim Warner --- top/top.1 | 4 +++- top/top.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/top/top.1 b/top/top.1 index 2408fcea..75130888 100644 --- a/top/top.1 +++ b/top/top.1 @@ -984,6 +984,8 @@ written to \*(AS. Dirty pages must be written to \*(AS before the corresponding physical memory location can be used for some other virtual page. +This field was deprecated with linux 2.6 and is always zero. + .TP 4 47.\fB nMaj \*(Em Major Page Fault Count \fR The number of\fB major\fR page faults that have occurred for a task. @@ -1001,7 +1003,7 @@ A minor page fault does not involve \*(AS access in making that page available. .TP 4 -48.\fB nTH \*(Em Number of Threads \fR +49.\fB nTH \*(Em Number of Threads \fR The number of threads associated with a process. .TP 4 diff --git a/top/top.c b/top/top.c index 7a575380..bf76b080 100644 --- a/top/top.c +++ b/top/top.c @@ -1540,7 +1540,7 @@ static struct { #endif { 4, -1, A_right, -1, PIDS_FLT_MAJ }, // ul_int EU_FL1 { 4, -1, A_right, -1, PIDS_FLT_MIN }, // ul_int EU_FL2 - { 4, -1, A_right, -1, PIDS_MEM_DT_PGS }, // ul_int EU_DRT ( always 0 w/ since 2.6 ) + { 4, -1, A_right, -1, PIDS_noop }, // ul_int EU_DRT ( always 0 w/ since 2.6 ) { 1, -1, A_right, -1, PIDS_STATE }, // s_ch EU_STA { -1, -1, A_left, -1, PIDS_CMD }, // str EU_CMD { 10, -1, A_left, -1, PIDS_WCHAN_NAME }, // str EU_WCH