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:
committed by
Craig Small
parent
c2afde130e
commit
8d989c68c0
@ -23,6 +23,7 @@
|
||||
#include "../proc/readproc.h"
|
||||
|
||||
/* Defines represented in configure.ac ----------------------------- */
|
||||
//#define NUMA_ENABLED /* enable summary area NUMA/Node extension */
|
||||
//#define OOMEM_ENABLE /* enable the SuSE out-of-memory additions */
|
||||
//#define SIGNALS_LESS /* favor reduced signal load over response */
|
||||
|
||||
@ -44,6 +45,7 @@
|
||||
//#define PRETEND2_5_X /* pretend we're linux 2.5.x (for IO-wait) */
|
||||
//#define PRETEND4CPUS /* pretend we're smp with 4 ticsers (sic) */
|
||||
//#define PRETENDNOCAP /* use a terminal without essential caps */
|
||||
//#define PRETEND_NUMA /* pretend we've got some linux NUMA Nodes */
|
||||
//#define RCFILE_NOERR /* rcfile errs silently default, vs. fatal */
|
||||
//#define RECALL_FIXED /* don't reorder saved strings if recalled */
|
||||
//#define RMAN_IGNORED /* don't consider auto right margin glitch */
|
||||
@ -76,6 +78,9 @@
|
||||
to kernel and/or cpu anomalies (see CPU_ZEROTICS), thanks to:
|
||||
Jaromir Capik, <jcapik@redhat.com> - February, 2012 */
|
||||
|
||||
/* For the impetus and NUMA/Node prototype design, thanks to:
|
||||
Lance Shelton <LShelton@fusionio.com> - April, 2013 */
|
||||
|
||||
#ifdef PRETEND2_5_X
|
||||
#define linux_version_code LINUX_VERSION(2,5,43)
|
||||
#endif
|
||||
@ -287,6 +292,7 @@ typedef struct CPU_t {
|
||||
letter shown is the corresponding 'command' toggle */
|
||||
// 'View_' flags affect the summary (minimum), taken from 'Curwin'
|
||||
#define View_CPUSUM 0x008000 // '1' - show combined cpu stats (vs. each)
|
||||
#define View_CPUNOD 0x400000 // '2' - show numa node cpu stats ('3' also)
|
||||
#define View_LOADAV 0x004000 // 'l' - display load avg and uptime summary
|
||||
#define View_STATES 0x002000 // 't' - display task/cpu(s) states summary
|
||||
#define View_MEMORY 0x001000 // 'm' - display memory summary
|
||||
@ -613,6 +619,9 @@ typedef struct WIN_t {
|
||||
#if defined(RECALL_FIXED) && defined(TERMIOS_ONLY)
|
||||
# error 'RECALL_FIXED' conflicts with 'TERMIOS_ONLY'
|
||||
#endif
|
||||
#if defined(PRETEND_NUMA) && !defined(NUMA_ENABLED)
|
||||
# error 'PRETEND_NUMA' also requires 'NUMA_ENABLED'
|
||||
#endif
|
||||
#if (LRGBUFSIZ < SCREENMAX)
|
||||
# error 'LRGBUFSIZ' must NOT be less than 'SCREENMAX'
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user