top: program code changes, enable NUMA/Node extensions

This commit extends the top Summary Area cpu states to
include information on Non-Uniform Memory Architecture
nodes. It is based upon changes originally proposed by
Lance Shelton who was instrumental in the final patch.

With this change, the user will have new commands that
will provide alternatives to the individual cpu stats:

. '2' toggles between cpu & numa node summary displays
. '3' provides node summary and related cpu statistics

These extensions required some minimal system support.
Typically, the numactl package (and maybe libnuma-dev)
are all that's needed to show a single node which owns
all the processors. Failing that, or for slightly more
variety, top also offers a #define named PRETEND_NUMA.

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
Signed-off-by: Lance Shelton <LShelton@fusionio.com>
This commit is contained in:
Lance Shelton
2013-04-08 00:00:00 -07:00
committed by Craig Small
parent c2afde130e
commit 8d989c68c0
4 changed files with 168 additions and 32 deletions

View File

@@ -442,6 +442,10 @@ static void build_norm_nlstab (void) {
Norm_nlstab[WORD_exclude_txt] = _("exclude");
Norm_nlstab[OSEL_statlin_fmt] = _("<Enter> to resume, filters: %s");
Norm_nlstab[WORD_noneone_txt] = _("none");
Norm_nlstab[NUMA_nodenam_fmt] = _("Node%-2d:");
Norm_nlstab[NUMA_nodeget_fmt] = _("expand which node (0-%d)");
Norm_nlstab[NUMA_nodebad_txt] = _("invalid node");
Norm_nlstab[NUMA_nodenot_txt] = _("sorry, NUMA extensions unavailable");
}
@@ -481,7 +485,7 @@ static void build_uniq_nlstab (void) {
"\n"
" Z~5,~1B~5,E,e Global: '~1Z~2' colors; '~1B~2' bold; '~1E~2'/'~1e~2' summary/task memory scale\n"
" l,t,m Toggle Summary: '~1l~2' load avg; '~1t~2' task/cpu stats; '~1m~2' memory info\n"
" 0,1,I Toggle: '~10~2' Zero suppress; '~11~2' separate cpu(s); '~1I~2' Irix mode\n"
" 0,1,2,3,I Toggle: '~10~2' zeros; '~11~2/~12~2/~13~2' cpus or numa node views; '~1I~2' Irix mode\n"
" f,F,X Fields: '~1f~2'/'~1F~2' add/remove/order/sort; '~1X~2' increase fixed-width\n"
"\n"
" L,&,<,> . Locate: '~1L~2'/'~1&~2' find/again; Move sort column: '~1<~2'/'~1>~2' left/right\n"